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 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 506 | # Strip off a particular parameter from the command line |
| 507 | # and return its value. |
| 508 | # Parameter 1: Command line parameter to strip off |
| 509 | # ENV I/O: CMD command line to search and modify |
| 510 | extract_cmdline_argument() { |
| 511 | __ARG=$(echo "$CMD" | sed -n "s/^.* $1=\([^ ]*\).*$/\1/p") |
| 512 | CMD=$(echo "$CMD" | sed "s/$1=\([^ ]*\)//") |
| 513 | } |
| 514 | |
| 515 | # Check compatibility of the ssl_client2/ssl_server2 command-line |
| 516 | # with a particular compile-time configurable option. |
| 517 | # Parameter 1: Command-line argument (e.g. extended_ms) |
| 518 | # Parameter 2: Corresponding compile-time configuration |
| 519 | # (e.g. MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET) |
| 520 | # ENV I/O: CMD command line to search and modify |
| 521 | # SKIP_NEXT set to "YES" on a mismatch |
| 522 | check_cmdline_param_compat() { |
| 523 | __VAL="$( get_config_value_or_default "$2" )" |
| 524 | if [ ! -z "$__VAL" ]; then |
| 525 | extract_cmdline_argument "$1" |
| 526 | if [ ! -z "$__ARG" ] && [ "$__ARG" != "$__VAL" ]; then |
| 527 | SKIP_NEXT="YES" |
| 528 | fi |
| 529 | fi |
| 530 | } |
| 531 | |
Hanno Becker | acd4fc0 | 2019-06-12 16:40:50 +0100 | [diff] [blame^] | 532 | check_cmdline_authmode_compat() { |
| 533 | __VAL="$( get_config_value_or_default "MBEDTLS_SSL_CONF_AUTHMODE" )" |
| 534 | if [ ! -z "$__VAL" ]; then |
| 535 | extract_cmdline_argument "auth_mode" |
| 536 | if [ "$__ARG" = "none" ] && [ "$__VAL" != "0" ]; then |
| 537 | SKIP_NEXT="YES"; |
| 538 | elif [ "$__ARG" = "optional" ] && [ "$__VAL" != "1" ]; then |
| 539 | SKIP_NEXT="YES" |
| 540 | elif [ "$__ARG" = "required" ] && [ "$__VAL" != "2" ]; then |
| 541 | SKIP_NEXT="YES" |
| 542 | fi |
| 543 | fi |
| 544 | } |
| 545 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 546 | # Go through all options that can be hardcoded at compile-time and |
| 547 | # detect whether the command line configures them in a conflicting |
| 548 | # way. If so, skip the test. Otherwise, remove the corresponding |
| 549 | # entry. |
| 550 | # Parameter 1: Command line to inspect |
| 551 | # Output: Modified command line |
| 552 | # ENV I/O: SKIP_TEST set to 1 on mismatch. |
| 553 | check_cmdline_compat() { |
| 554 | CMD="$1" |
| 555 | |
| 556 | # ExtendedMasterSecret configuration |
| 557 | check_cmdline_param_compat "extended_ms" \ |
| 558 | "MBEDTLS_SSL_CONF_EXTENDED_MASTER_SECRET" |
| 559 | check_cmdline_param_compat "enforce_extended_master_secret" \ |
| 560 | "MBEDTLS_SSL_CONF_ENFORCE_EXTENDED_MASTER_SECRET" |
Hanno Becker | 7f376f4 | 2019-06-12 16:20:48 +0100 | [diff] [blame] | 561 | |
| 562 | # DTLS anti replay protection configuration |
| 563 | check_cmdline_param_compat "anti_replay" \ |
| 564 | "MBEDTLS_SSL_CONF_ANTI_REPLAY" |
| 565 | |
Hanno Becker | de67154 | 2019-06-12 16:30:46 +0100 | [diff] [blame] | 566 | # DTLS bad MAC limit |
| 567 | check_cmdline_param_compat "badmac_limit" \ |
| 568 | "MBEDTLS_SSL_CONF_BADMAC_LIMIT" |
Hanno Becker | acd4fc0 | 2019-06-12 16:40:50 +0100 | [diff] [blame^] | 569 | |
| 570 | # Authentication mode |
| 571 | check_cmdline_authmode_compat |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 572 | } |
| 573 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 574 | # 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] | 575 | # Options: -s pattern pattern that must be present in server output |
| 576 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 577 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 578 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 579 | # -S pattern pattern that must be absent in server output |
| 580 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 581 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 582 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 583 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 584 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 585 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 586 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 587 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 588 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 589 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 590 | return |
| 591 | fi |
| 592 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 593 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 594 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 595 | # Do we only run numbered tests? |
| 596 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 597 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 598 | else |
| 599 | SKIP_NEXT="YES" |
| 600 | fi |
| 601 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 602 | # does this test use a proxy? |
| 603 | if [ "X$1" = "X-p" ]; then |
| 604 | PXY_CMD="$2" |
| 605 | shift 2 |
| 606 | else |
| 607 | PXY_CMD="" |
| 608 | fi |
| 609 | |
| 610 | # get commands and client output |
| 611 | SRV_CMD="$1" |
| 612 | CLI_CMD="$2" |
| 613 | CLI_EXPECT="$3" |
| 614 | shift 3 |
| 615 | |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 616 | check_cmdline_compat "$SRV_CMD" |
| 617 | SRV_CMD="$CMD" |
| 618 | |
| 619 | check_cmdline_compat "$CLI_CMD" |
| 620 | CLI_CMD="$CMD" |
| 621 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 622 | # Check if test uses files |
| 623 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 624 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 625 | requires_config_enabled MBEDTLS_FS_IO |
| 626 | fi |
| 627 | |
| 628 | # should we skip? |
| 629 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 630 | SKIP_NEXT="NO" |
| 631 | echo "SKIP" |
| 632 | SKIPS=$(( $SKIPS + 1 )) |
| 633 | return |
| 634 | fi |
| 635 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 636 | # fix client port |
| 637 | if [ -n "$PXY_CMD" ]; then |
| 638 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 639 | else |
| 640 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 641 | fi |
| 642 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 643 | # update DTLS variable |
| 644 | detect_dtls "$SRV_CMD" |
| 645 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 646 | # prepend valgrind to our commands if active |
| 647 | if [ "$MEMCHECK" -gt 0 ]; then |
| 648 | if is_polar "$SRV_CMD"; then |
| 649 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 650 | fi |
| 651 | if is_polar "$CLI_CMD"; then |
| 652 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 653 | fi |
| 654 | fi |
| 655 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 656 | TIMES_LEFT=2 |
| 657 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 658 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 659 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 660 | # run the commands |
| 661 | if [ -n "$PXY_CMD" ]; then |
| 662 | echo "$PXY_CMD" > $PXY_OUT |
| 663 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 664 | PXY_PID=$! |
| 665 | # assume proxy starts faster than server |
| 666 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 667 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 668 | check_osrv_dtls |
| 669 | echo "$SRV_CMD" > $SRV_OUT |
| 670 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 671 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 672 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 673 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 674 | echo "$CLI_CMD" > $CLI_OUT |
| 675 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 676 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 677 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 678 | sleep 0.05 |
| 679 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 680 | # terminate the server (and the proxy) |
| 681 | kill $SRV_PID |
| 682 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 683 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 684 | if [ -n "$PXY_CMD" ]; then |
| 685 | kill $PXY_PID >/dev/null 2>&1 |
| 686 | wait $PXY_PID |
| 687 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 688 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 689 | # retry only on timeouts |
| 690 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 691 | printf "RETRY " |
| 692 | else |
| 693 | TIMES_LEFT=0 |
| 694 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 695 | done |
| 696 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 697 | # 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] | 698 | # (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] | 699 | # expected client exit to incorrectly succeed in case of catastrophic |
| 700 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 701 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 702 | 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] | 703 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 704 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 705 | return |
| 706 | fi |
| 707 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 708 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 709 | 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] | 710 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 711 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 712 | return |
| 713 | fi |
| 714 | fi |
| 715 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 716 | # check server exit code |
| 717 | if [ $? != 0 ]; then |
| 718 | fail "server fail" |
| 719 | return |
| 720 | fi |
| 721 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 722 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 723 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 724 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 725 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 726 | 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] | 727 | return |
| 728 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 729 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 730 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 731 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 732 | # 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] | 733 | while [ $# -gt 0 ] |
| 734 | do |
| 735 | case $1 in |
| 736 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 737 | 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] | 738 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 739 | return |
| 740 | fi |
| 741 | ;; |
| 742 | |
| 743 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 744 | 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] | 745 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 746 | return |
| 747 | fi |
| 748 | ;; |
| 749 | |
| 750 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 751 | 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] | 752 | 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] | 753 | return |
| 754 | fi |
| 755 | ;; |
| 756 | |
| 757 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 758 | 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] | 759 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 760 | return |
| 761 | fi |
| 762 | ;; |
| 763 | |
| 764 | # The filtering in the following two options (-u and -U) do the following |
| 765 | # - ignore valgrind output |
| 766 | # - filter out everything but lines right after the pattern occurances |
| 767 | # - keep one of each non-unique line |
| 768 | # - count how many lines remain |
| 769 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 770 | # if there were no duplicates. |
| 771 | "-U") |
| 772 | 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 |
| 773 | fail "lines following pattern '$2' must be unique in Server output" |
| 774 | return |
| 775 | fi |
| 776 | ;; |
| 777 | |
| 778 | "-u") |
| 779 | 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 |
| 780 | 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] | 781 | return |
| 782 | fi |
| 783 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 784 | "-F") |
| 785 | if ! $2 "$SRV_OUT"; then |
| 786 | fail "function call to '$2' failed on Server output" |
| 787 | return |
| 788 | fi |
| 789 | ;; |
| 790 | "-f") |
| 791 | if ! $2 "$CLI_OUT"; then |
| 792 | fail "function call to '$2' failed on Client output" |
| 793 | return |
| 794 | fi |
| 795 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 796 | |
| 797 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 798 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 799 | exit 1 |
| 800 | esac |
| 801 | shift 2 |
| 802 | done |
| 803 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 804 | # check valgrind's results |
| 805 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 806 | 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] | 807 | fail "Server has memory errors" |
| 808 | return |
| 809 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 810 | 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] | 811 | fail "Client has memory errors" |
| 812 | return |
| 813 | fi |
| 814 | fi |
| 815 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 816 | # if we're here, everything is ok |
| 817 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 818 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 819 | mv $SRV_OUT o-srv-${TESTS}.log |
| 820 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 821 | if [ -n "$PXY_CMD" ]; then |
| 822 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 823 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 824 | fi |
| 825 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 826 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 827 | } |
| 828 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 829 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 830 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 831 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 832 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 833 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 834 | 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] | 835 | exit 1 |
| 836 | } |
| 837 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 838 | # |
| 839 | # MAIN |
| 840 | # |
| 841 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 842 | get_options "$@" |
| 843 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 844 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 845 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 846 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 847 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 848 | if [ ! -x "$P_SRV_BIN" ]; then |
| 849 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 850 | exit 1 |
| 851 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 852 | if [ ! -x "$P_CLI_BIN" ]; then |
| 853 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 854 | exit 1 |
| 855 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 856 | if [ ! -x "$P_PXY_BIN" ]; then |
| 857 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 858 | exit 1 |
| 859 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 860 | if [ "$MEMCHECK" -gt 0 ]; then |
| 861 | if which valgrind >/dev/null 2>&1; then :; else |
| 862 | echo "Memcheck not possible. Valgrind not found" |
| 863 | exit 1 |
| 864 | fi |
| 865 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 866 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 867 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 868 | exit 1 |
| 869 | fi |
| 870 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 871 | # used by watchdog |
| 872 | MAIN_PID="$$" |
| 873 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 874 | # We use somewhat arbitrary delays for tests: |
| 875 | # - how long do we wait for the server to start (when lsof not available)? |
| 876 | # - how long do we allow for the client to finish? |
| 877 | # (not to check performance, just to avoid waiting indefinitely) |
| 878 | # Things are slower with valgrind, so give extra time here. |
| 879 | # |
| 880 | # Note: without lsof, there is a trade-off between the running time of this |
| 881 | # script and the risk of spurious errors because we didn't wait long enough. |
| 882 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 883 | # 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] | 884 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 885 | START_DELAY=6 |
| 886 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 887 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 888 | START_DELAY=2 |
| 889 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 890 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 891 | |
| 892 | # some particular tests need more time: |
| 893 | # - for the client, we multiply the usual watchdog limit by a factor |
| 894 | # - for the server, we sleep for a number of seconds after the client exits |
| 895 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 896 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 897 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 898 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 899 | # 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] | 900 | # +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] | 901 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 902 | 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] | 903 | 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] | 904 | 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] | 905 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 906 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 907 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 908 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 909 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 910 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 911 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 912 | fi |
| 913 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 914 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 915 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 916 | fi |
| 917 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 918 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 919 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 920 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 921 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 922 | # Allow SHA-1, because many of our test certificates use it |
| 923 | P_SRV="$P_SRV allow_sha1=1" |
| 924 | P_CLI="$P_CLI allow_sha1=1" |
| 925 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 926 | # Also pick a unique name for intermediate files |
| 927 | SRV_OUT="srv_out.$$" |
| 928 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 929 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 930 | SESSION="session.$$" |
| 931 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 932 | SKIP_NEXT="NO" |
| 933 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 934 | trap cleanup INT TERM HUP |
| 935 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 936 | # Basic test |
| 937 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 938 | # Checks that: |
| 939 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 940 | # - the expected (highest security) parameters are selected |
| 941 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 942 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 943 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 944 | "$P_CLI" \ |
| 945 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 946 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 947 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 948 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 949 | -s "ECDHE curve: secp521r1" \ |
| 950 | -S "error" \ |
| 951 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 952 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 953 | run_test "Default, DTLS" \ |
| 954 | "$P_SRV dtls=1" \ |
| 955 | "$P_CLI dtls=1" \ |
| 956 | 0 \ |
| 957 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 958 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 959 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 960 | # Test current time in ServerHello |
| 961 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 962 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 963 | "$P_SRV debug_level=3" \ |
| 964 | "$P_CLI debug_level=3" \ |
| 965 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 966 | -f "check_server_hello_time" \ |
| 967 | -F "check_server_hello_time" |
| 968 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 969 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 970 | run_test "Unique IV in GCM" \ |
| 971 | "$P_SRV exchanges=20 debug_level=4" \ |
| 972 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 973 | 0 \ |
| 974 | -u "IV used" \ |
| 975 | -U "IV used" |
| 976 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 977 | # Tests for rc4 option |
| 978 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 979 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 980 | run_test "RC4: server disabled, client enabled" \ |
| 981 | "$P_SRV" \ |
| 982 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 983 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 984 | -s "SSL - The server has no ciphersuites in common" |
| 985 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 986 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 987 | run_test "RC4: server half, client enabled" \ |
| 988 | "$P_SRV arc4=1" \ |
| 989 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 990 | 1 \ |
| 991 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 992 | |
| 993 | run_test "RC4: server enabled, client disabled" \ |
| 994 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 995 | "$P_CLI" \ |
| 996 | 1 \ |
| 997 | -s "SSL - The server has no ciphersuites in common" |
| 998 | |
| 999 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1000 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1001 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1002 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1003 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1004 | -S "SSL - The server has no ciphersuites in common" |
| 1005 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1006 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1007 | |
| 1008 | requires_gnutls |
| 1009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1010 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1011 | "$G_SRV"\ |
| 1012 | "$P_CLI force_version=tls1_1" \ |
| 1013 | 0 |
| 1014 | |
| 1015 | requires_gnutls |
| 1016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1017 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1018 | "$G_SRV"\ |
| 1019 | "$P_CLI force_version=tls1" \ |
| 1020 | 0 |
| 1021 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1022 | # Tests for SHA-1 support |
| 1023 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1024 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 1025 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1026 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1027 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1028 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1029 | 1 \ |
| 1030 | -c "The certificate is signed with an unacceptable hash" |
| 1031 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1032 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1033 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1034 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1035 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1036 | 0 |
| 1037 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1038 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1039 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1040 | "$P_CLI allow_sha1=1" \ |
| 1041 | 0 |
| 1042 | |
| 1043 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1044 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1045 | "$P_CLI allow_sha1=0" \ |
| 1046 | 0 |
| 1047 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1048 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 1049 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1050 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1051 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1052 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1053 | 1 \ |
| 1054 | -s "The certificate is signed with an unacceptable hash" |
| 1055 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1056 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1057 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1058 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1059 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1060 | 0 |
| 1061 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1062 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1063 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1064 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1065 | 0 |
| 1066 | |
| 1067 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1068 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1069 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1070 | 0 |
| 1071 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1072 | # Tests for datagram packing |
| 1073 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1074 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1075 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1076 | 0 \ |
| 1077 | -c "next record in same datagram" \ |
| 1078 | -s "next record in same datagram" |
| 1079 | |
| 1080 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1081 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1082 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1083 | 0 \ |
| 1084 | -s "next record in same datagram" \ |
| 1085 | -C "next record in same datagram" |
| 1086 | |
| 1087 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1088 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1089 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1090 | 0 \ |
| 1091 | -S "next record in same datagram" \ |
| 1092 | -c "next record in same datagram" |
| 1093 | |
| 1094 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1095 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1096 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1097 | 0 \ |
| 1098 | -S "next record in same datagram" \ |
| 1099 | -C "next record in same datagram" |
| 1100 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1101 | # Tests for Truncated HMAC extension |
| 1102 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1103 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1104 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1105 | "$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] | 1106 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1107 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1108 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1109 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1110 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1111 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1112 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1113 | "$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] | 1114 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1115 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1116 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1117 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1118 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1119 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1120 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1121 | "$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] | 1122 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1123 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1124 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1125 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1126 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1127 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1128 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1129 | "$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] | 1130 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1131 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1132 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1133 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1134 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1135 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1136 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1137 | "$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] | 1138 | 0 \ |
| 1139 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1140 | -S "dumping 'expected mac' (10 bytes)" |
| 1141 | |
| 1142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1143 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1144 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1145 | "$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] | 1146 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1147 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1148 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1149 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1150 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1151 | "$P_SRV dtls=1 debug_level=4" \ |
| 1152 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1153 | 0 \ |
| 1154 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1155 | -S "dumping 'expected mac' (10 bytes)" |
| 1156 | |
| 1157 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1158 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1159 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1160 | "$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] | 1161 | 0 \ |
| 1162 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1163 | -S "dumping 'expected mac' (10 bytes)" |
| 1164 | |
| 1165 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1166 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1167 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1168 | "$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] | 1169 | 0 \ |
| 1170 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1171 | -S "dumping 'expected mac' (10 bytes)" |
| 1172 | |
| 1173 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1174 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1175 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1176 | "$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] | 1177 | 0 \ |
| 1178 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1179 | -S "dumping 'expected mac' (10 bytes)" |
| 1180 | |
| 1181 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1182 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1183 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1184 | "$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] | 1185 | 0 \ |
| 1186 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1187 | -S "dumping 'expected mac' (10 bytes)" |
| 1188 | |
| 1189 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1190 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1191 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1192 | "$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] | 1193 | 0 \ |
| 1194 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1195 | -s "dumping 'expected mac' (10 bytes)" |
| 1196 | |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1197 | # Tests for Context serialization |
| 1198 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1199 | skip_next_test |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1200 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1201 | run_test "(STUB) Context serialization, client serializes" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1202 | "$P_SRV serialize=0 exchanges=2" \ |
| 1203 | "$P_CLI serialize=1 exchanges=2" \ |
| 1204 | 0 \ |
Jarno Lamsa | dcfc2a7 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1205 | -c "Deserializing connection..." \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1206 | -S "Deserializing connection..." |
| 1207 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1208 | skip_next_test |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1209 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1210 | run_test "(STUB) Context serialization, server serializes" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1211 | "$P_SRV serialize=1 exchanges=2" \ |
| 1212 | "$P_CLI serialize=0 exchanges=2" \ |
| 1213 | 0 \ |
Jarno Lamsa | dcfc2a7 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1214 | -C "Deserializing connection..." \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1215 | -s "Deserializing connection..." |
| 1216 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1217 | skip_next_test |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1218 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1219 | run_test "(STUB) Context serialization, both serialize" \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1220 | "$P_SRV serialize=1 exchanges=2" \ |
| 1221 | "$P_CLI serialize=1 exchanges=2" \ |
| 1222 | 0 \ |
Jarno Lamsa | dcfc2a7 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1223 | -c "Deserializing connection..." \ |
Jarno Lamsa | fa45e60 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1224 | -s "Deserializing connection..." |
| 1225 | |
Jarno Lamsa | 8a91c06 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1226 | skip_next_test |
| 1227 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1228 | run_test "(STUB) Context serialization, re-init, client serializes" \ |
| 1229 | "$P_SRV serialize=0 exchanges=2" \ |
| 1230 | "$P_CLI serialize=2 exchanges=2" \ |
| 1231 | 0 \ |
| 1232 | -c "Deserializing connection..." \ |
| 1233 | -S "Deserializing connection..." |
| 1234 | |
| 1235 | skip_next_test |
| 1236 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1237 | run_test "(STUB) Context serialization, re-init, server serializes" \ |
| 1238 | "$P_SRV serialize=2 exchanges=2" \ |
| 1239 | "$P_CLI serialize=0 exchanges=2" \ |
| 1240 | 0 \ |
| 1241 | -C "Deserializing connection..." \ |
| 1242 | -s "Deserializing connection..." |
| 1243 | |
| 1244 | skip_next_test |
| 1245 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1246 | run_test "(STUB) Context serialization, re-init, both serialize" \ |
| 1247 | "$P_SRV serialize=2 exchanges=2" \ |
| 1248 | "$P_CLI serialize=2 exchanges=2" \ |
| 1249 | 0 \ |
| 1250 | -c "Deserializing connection..." \ |
| 1251 | -s "Deserializing connection..." |
| 1252 | |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1253 | # Tests for DTLS Connection ID extension |
| 1254 | |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1255 | # So far, the CID API isn't implemented, so we can't |
| 1256 | # grep for output witnessing its use. This needs to be |
| 1257 | # changed once the CID extension is implemented. |
| 1258 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1259 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1260 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1261 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1262 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1263 | 0 \ |
| 1264 | -s "Disable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1265 | -s "found CID extension" \ |
| 1266 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1267 | -c "Enable use of CID extension." \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1268 | -c "client hello, adding CID extension" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1269 | -S "server hello, adding CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1270 | -C "found CID extension" \ |
| 1271 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1272 | -C "Copy CIDs into SSL transform" \ |
| 1273 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1274 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1275 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1276 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1277 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1278 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1279 | 0 \ |
| 1280 | -c "Disable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1281 | -C "client hello, adding CID extension" \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1282 | -S "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1283 | -s "Enable use of CID extension." \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1284 | -S "server hello, adding CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1285 | -C "found CID extension" \ |
| 1286 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1287 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | ad8e2c9 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1288 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1289 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1290 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1291 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1292 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1293 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1294 | 0 \ |
| 1295 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1296 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1297 | -c "client hello, adding CID extension" \ |
| 1298 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1299 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1300 | -s "server hello, adding CID extension" \ |
| 1301 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1302 | -c "Use of CID extension negotiated" \ |
| 1303 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1304 | -c "Copy CIDs into SSL transform" \ |
| 1305 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1306 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1307 | -s "Use of Connection ID has been negotiated" \ |
| 1308 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1309 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1311 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1312 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1313 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1314 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1315 | 0 \ |
| 1316 | -c "Enable use of CID extension." \ |
| 1317 | -s "Enable use of CID extension." \ |
| 1318 | -c "client hello, adding CID extension" \ |
| 1319 | -s "found CID extension" \ |
| 1320 | -s "Use of CID extension negotiated" \ |
| 1321 | -s "server hello, adding CID extension" \ |
| 1322 | -c "found CID extension" \ |
| 1323 | -c "Use of CID extension negotiated" \ |
| 1324 | -s "Copy CIDs into SSL transform" \ |
| 1325 | -c "Copy CIDs into SSL transform" \ |
| 1326 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1327 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1328 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1329 | -c "Use of Connection ID has been negotiated" \ |
| 1330 | -c "ignoring unexpected CID" \ |
| 1331 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1332 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1333 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1334 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1335 | -p "$P_PXY mtu=800" \ |
| 1336 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1337 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1338 | 0 \ |
| 1339 | -c "Enable use of CID extension." \ |
| 1340 | -s "Enable use of CID extension." \ |
| 1341 | -c "client hello, adding CID extension" \ |
| 1342 | -s "found CID extension" \ |
| 1343 | -s "Use of CID extension negotiated" \ |
| 1344 | -s "server hello, adding CID extension" \ |
| 1345 | -c "found CID extension" \ |
| 1346 | -c "Use of CID extension negotiated" \ |
| 1347 | -s "Copy CIDs into SSL transform" \ |
| 1348 | -c "Copy CIDs into SSL transform" \ |
| 1349 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1350 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1351 | -s "Use of Connection ID has been negotiated" \ |
| 1352 | -c "Use of Connection ID has been negotiated" |
| 1353 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1354 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1355 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1356 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1357 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1358 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1359 | 0 \ |
| 1360 | -c "Enable use of CID extension." \ |
| 1361 | -s "Enable use of CID extension." \ |
| 1362 | -c "client hello, adding CID extension" \ |
| 1363 | -s "found CID extension" \ |
| 1364 | -s "Use of CID extension negotiated" \ |
| 1365 | -s "server hello, adding CID extension" \ |
| 1366 | -c "found CID extension" \ |
| 1367 | -c "Use of CID extension negotiated" \ |
| 1368 | -s "Copy CIDs into SSL transform" \ |
| 1369 | -c "Copy CIDs into SSL transform" \ |
| 1370 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1371 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1372 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1373 | -c "Use of Connection ID has been negotiated" \ |
| 1374 | -c "ignoring unexpected CID" \ |
| 1375 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1376 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1377 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1378 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1379 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1380 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1381 | 0 \ |
| 1382 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1383 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1384 | -c "client hello, adding CID extension" \ |
| 1385 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1386 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1387 | -s "server hello, adding CID extension" \ |
| 1388 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1389 | -c "Use of CID extension negotiated" \ |
| 1390 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1391 | -c "Copy CIDs into SSL transform" \ |
| 1392 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1393 | -s "Peer CID (length 0 Bytes):" \ |
| 1394 | -s "Use of Connection ID has been negotiated" \ |
| 1395 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1396 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1397 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1398 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1399 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1400 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1401 | 0 \ |
| 1402 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1403 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1404 | -c "client hello, adding CID extension" \ |
| 1405 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1406 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1407 | -s "server hello, adding CID extension" \ |
| 1408 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1409 | -c "Use of CID extension negotiated" \ |
| 1410 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1411 | -c "Copy CIDs into SSL transform" \ |
| 1412 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1413 | -c "Peer CID (length 0 Bytes):" \ |
| 1414 | -s "Use of Connection ID has been negotiated" \ |
| 1415 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1416 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1417 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1418 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1419 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1420 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1421 | 0 \ |
| 1422 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1423 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1424 | -c "client hello, adding CID extension" \ |
| 1425 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1426 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1427 | -s "server hello, adding CID extension" \ |
| 1428 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1429 | -c "Use of CID extension negotiated" \ |
| 1430 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1431 | -c "Copy CIDs into SSL transform" \ |
| 1432 | -S "Use of Connection ID has been negotiated" \ |
| 1433 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1434 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1435 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1436 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1437 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1438 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1439 | 0 \ |
| 1440 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1441 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1442 | -c "client hello, adding CID extension" \ |
| 1443 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1444 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1445 | -s "server hello, adding CID extension" \ |
| 1446 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1447 | -c "Use of CID extension negotiated" \ |
| 1448 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1449 | -c "Copy CIDs into SSL transform" \ |
| 1450 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1451 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1452 | -s "Use of Connection ID has been negotiated" \ |
| 1453 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1454 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1455 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1456 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1457 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1458 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1459 | 0 \ |
| 1460 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1461 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1462 | -c "client hello, adding CID extension" \ |
| 1463 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1464 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1465 | -s "server hello, adding CID extension" \ |
| 1466 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1467 | -c "Use of CID extension negotiated" \ |
| 1468 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1469 | -c "Copy CIDs into SSL transform" \ |
| 1470 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1471 | -s "Peer CID (length 0 Bytes):" \ |
| 1472 | -s "Use of Connection ID has been negotiated" \ |
| 1473 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1474 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1476 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1477 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1478 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1479 | 0 \ |
| 1480 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1481 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1482 | -c "client hello, adding CID extension" \ |
| 1483 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1484 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1485 | -s "server hello, adding CID extension" \ |
| 1486 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1487 | -c "Use of CID extension negotiated" \ |
| 1488 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1489 | -c "Copy CIDs into SSL transform" \ |
| 1490 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1491 | -c "Peer CID (length 0 Bytes):" \ |
| 1492 | -s "Use of Connection ID has been negotiated" \ |
| 1493 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1494 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1495 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1496 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1497 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1498 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1499 | 0 \ |
| 1500 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1501 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1502 | -c "client hello, adding CID extension" \ |
| 1503 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1504 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1505 | -s "server hello, adding CID extension" \ |
| 1506 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1507 | -c "Use of CID extension negotiated" \ |
| 1508 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1509 | -c "Copy CIDs into SSL transform" \ |
| 1510 | -S "Use of Connection ID has been negotiated" \ |
| 1511 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1512 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1513 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1514 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1515 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1516 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1517 | 0 \ |
| 1518 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1519 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1520 | -c "client hello, adding CID extension" \ |
| 1521 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1522 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1523 | -s "server hello, adding CID extension" \ |
| 1524 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1525 | -c "Use of CID extension negotiated" \ |
| 1526 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1527 | -c "Copy CIDs into SSL transform" \ |
| 1528 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1529 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1530 | -s "Use of Connection ID has been negotiated" \ |
| 1531 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1532 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1534 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1535 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1536 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1537 | 0 \ |
| 1538 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1539 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1540 | -c "client hello, adding CID extension" \ |
| 1541 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1542 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1543 | -s "server hello, adding CID extension" \ |
| 1544 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1545 | -c "Use of CID extension negotiated" \ |
| 1546 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1547 | -c "Copy CIDs into SSL transform" \ |
| 1548 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1549 | -s "Peer CID (length 0 Bytes):" \ |
| 1550 | -s "Use of Connection ID has been negotiated" \ |
| 1551 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1552 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1553 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1554 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1555 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1556 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1557 | 0 \ |
| 1558 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1559 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1560 | -c "client hello, adding CID extension" \ |
| 1561 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1562 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1563 | -s "server hello, adding CID extension" \ |
| 1564 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1565 | -c "Use of CID extension negotiated" \ |
| 1566 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | b7f9e9c | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1567 | -c "Copy CIDs into SSL transform" \ |
| 1568 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1569 | -c "Peer CID (length 0 Bytes):" \ |
| 1570 | -s "Use of Connection ID has been negotiated" \ |
| 1571 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1572 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1573 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1574 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1575 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1576 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1577 | 0 \ |
| 1578 | -c "Enable use of CID extension." \ |
Hanno Becker | 7345599 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1579 | -s "Enable use of CID extension." \ |
Hanno Becker | c008cb5 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1580 | -c "client hello, adding CID extension" \ |
| 1581 | -s "found CID extension" \ |
Hanno Becker | 4eb0587 | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1582 | -s "Use of CID extension negotiated" \ |
Hanno Becker | cf2a565 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1583 | -s "server hello, adding CID extension" \ |
| 1584 | -c "found CID extension" \ |
Hanno Becker | 5e2cd14 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1585 | -c "Use of CID extension negotiated" \ |
| 1586 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 6a3ff28 | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1587 | -c "Copy CIDs into SSL transform" \ |
| 1588 | -S "Use of Connection ID has been negotiated" \ |
| 1589 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1590 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1591 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 963cb35 | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1592 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1593 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | 9dae9fd | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1594 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1595 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1596 | 0 \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1597 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1598 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1599 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1600 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1601 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1602 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1603 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1604 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1605 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1606 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1608 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1609 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1610 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1611 | 0 \ |
| 1612 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1613 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1614 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1615 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1616 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1617 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1618 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1619 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1620 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1621 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1622 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1623 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 1624 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1625 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1626 | 0 \ |
| 1627 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1628 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1629 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1630 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1631 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1632 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1633 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1634 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1635 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1636 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1637 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1638 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1639 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1640 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1641 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1642 | 0 \ |
| 1643 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1644 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1645 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1646 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1647 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1648 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1649 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1650 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1651 | -c "ignoring unexpected CID" \ |
| 1652 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1653 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1654 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1656 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1657 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1658 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1659 | 0 \ |
| 1660 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1661 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1662 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1663 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1664 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1665 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1666 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1667 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1668 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1669 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1670 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1671 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 1672 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1673 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1674 | 0 \ |
| 1675 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1676 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1677 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1678 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1679 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1680 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1681 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1682 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1683 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1684 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1685 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1686 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1687 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1688 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1689 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1690 | 0 \ |
| 1691 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1692 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1693 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1694 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1695 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1696 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1697 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1698 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1699 | -c "ignoring unexpected CID" \ |
| 1700 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1701 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1702 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1704 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1705 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1706 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1707 | 0 \ |
| 1708 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1709 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1710 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1711 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1712 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1713 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1714 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1717 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 1718 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1719 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1720 | 0 \ |
| 1721 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1722 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1723 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1724 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1725 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1726 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1727 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1728 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 84bbc51 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1730 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1731 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1732 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1733 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1734 | 0 \ |
| 1735 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1736 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1737 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1738 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1739 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1740 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1741 | -c "ignoring unexpected CID" \ |
| 1742 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1743 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1744 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1746 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1747 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1748 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1749 | 0 \ |
| 1750 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1751 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1752 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1753 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1754 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1755 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1756 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1757 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1758 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 1759 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1760 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1762 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1763 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1764 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1765 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1766 | 0 \ |
| 1767 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1768 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1769 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1770 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1771 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1772 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1773 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1774 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1775 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 1776 | -c "ignoring unexpected CID" \ |
| 1777 | -s "ignoring unexpected CID" |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1778 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1779 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1780 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1781 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 1782 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1783 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1784 | 0 \ |
| 1785 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1786 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1787 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1788 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1789 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1790 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1791 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1792 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1793 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 1794 | |
Hanno Becker | a5a2b08 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 04ca04c | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1797 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1798 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 9687029 | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1799 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1800 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1801 | 0 \ |
| 1802 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1803 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1804 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1805 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1806 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1807 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1808 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1809 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | f6fb4ea | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1810 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 1811 | -c "ignoring unexpected CID" \ |
| 1812 | -s "ignoring unexpected CID" |
Hanno Becker | 2dcdc92 | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1813 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1814 | # Tests for Encrypt-then-MAC extension |
| 1815 | |
| 1816 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1817 | "$P_SRV debug_level=3 \ |
| 1818 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1819 | "$P_CLI debug_level=3" \ |
| 1820 | 0 \ |
| 1821 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1822 | -s "found encrypt then mac extension" \ |
| 1823 | -s "server hello, adding encrypt then mac extension" \ |
| 1824 | -c "found encrypt_then_mac extension" \ |
| 1825 | -c "using encrypt then mac" \ |
| 1826 | -s "using encrypt then mac" |
| 1827 | |
| 1828 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1829 | "$P_SRV debug_level=3 etm=0 \ |
| 1830 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1831 | "$P_CLI debug_level=3 etm=1" \ |
| 1832 | 0 \ |
| 1833 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1834 | -s "found encrypt then mac extension" \ |
| 1835 | -S "server hello, adding encrypt then mac extension" \ |
| 1836 | -C "found encrypt_then_mac extension" \ |
| 1837 | -C "using encrypt then mac" \ |
| 1838 | -S "using encrypt then mac" |
| 1839 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1840 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1841 | "$P_SRV debug_level=3 etm=1 \ |
| 1842 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1843 | "$P_CLI debug_level=3 etm=1" \ |
| 1844 | 0 \ |
| 1845 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1846 | -s "found encrypt then mac extension" \ |
| 1847 | -S "server hello, adding encrypt then mac extension" \ |
| 1848 | -C "found encrypt_then_mac extension" \ |
| 1849 | -C "using encrypt then mac" \ |
| 1850 | -S "using encrypt then mac" |
| 1851 | |
| 1852 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1853 | "$P_SRV debug_level=3 etm=1 \ |
| 1854 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1855 | "$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] | 1856 | 0 \ |
| 1857 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1858 | -s "found encrypt then mac extension" \ |
| 1859 | -S "server hello, adding encrypt then mac extension" \ |
| 1860 | -C "found encrypt_then_mac extension" \ |
| 1861 | -C "using encrypt then mac" \ |
| 1862 | -S "using encrypt then mac" |
| 1863 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1864 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1865 | "$P_SRV debug_level=3 etm=1 \ |
| 1866 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1867 | "$P_CLI debug_level=3 etm=0" \ |
| 1868 | 0 \ |
| 1869 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1870 | -S "found encrypt then mac extension" \ |
| 1871 | -S "server hello, adding encrypt then mac extension" \ |
| 1872 | -C "found encrypt_then_mac extension" \ |
| 1873 | -C "using encrypt then mac" \ |
| 1874 | -S "using encrypt then mac" |
| 1875 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1876 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1877 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1878 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1879 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1880 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1881 | 0 \ |
| 1882 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1883 | -S "found encrypt then mac extension" \ |
| 1884 | -S "server hello, adding encrypt then mac extension" \ |
| 1885 | -C "found encrypt_then_mac extension" \ |
| 1886 | -C "using encrypt then mac" \ |
| 1887 | -S "using encrypt then mac" |
| 1888 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1889 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1890 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1891 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1892 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1893 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1894 | 0 \ |
| 1895 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1896 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1897 | -S "server hello, adding encrypt then mac extension" \ |
| 1898 | -C "found encrypt_then_mac extension" \ |
| 1899 | -C "using encrypt then mac" \ |
| 1900 | -S "using encrypt then mac" |
| 1901 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1902 | # Tests for Extended Master Secret extension |
| 1903 | |
Jarno Lamsa | 31d940b | 2019-06-12 10:21:33 +0300 | [diff] [blame] | 1904 | run_test "Extended Master Secret: default (not enforcing)" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1905 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0 " \ |
| 1906 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 31d940b | 2019-06-12 10:21:33 +0300 | [diff] [blame] | 1907 | 0 \ |
| 1908 | -c "client hello, adding extended_master_secret extension" \ |
| 1909 | -s "found extended master secret extension" \ |
| 1910 | -s "server hello, adding extended master secret extension" \ |
| 1911 | -c "found extended_master_secret extension" \ |
| 1912 | -c "session hash for extended master secret" \ |
| 1913 | -s "session hash for extended master secret" |
| 1914 | |
| 1915 | run_test "Extended Master Secret: both enabled, both enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1916 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 1917 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 1918 | 0 \ |
| 1919 | -c "client hello, adding extended_master_secret extension" \ |
| 1920 | -s "found extended master secret extension" \ |
| 1921 | -s "server hello, adding extended master secret extension" \ |
| 1922 | -c "found extended_master_secret extension" \ |
| 1923 | -c "session hash for extended master secret" \ |
| 1924 | -s "session hash for extended master secret" |
| 1925 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1926 | run_test "Extended Master Secret: both enabled, client enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1927 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 1928 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1929 | 0 \ |
| 1930 | -c "client hello, adding extended_master_secret extension" \ |
| 1931 | -s "found extended master secret extension" \ |
| 1932 | -s "server hello, adding extended master secret extension" \ |
| 1933 | -c "found extended_master_secret extension" \ |
| 1934 | -c "session hash for extended master secret" \ |
| 1935 | -s "session hash for extended master secret" |
| 1936 | |
| 1937 | run_test "Extended Master Secret: both enabled, server enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1938 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 1939 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1940 | 0 \ |
| 1941 | -c "client hello, adding extended_master_secret extension" \ |
| 1942 | -s "found extended master secret extension" \ |
| 1943 | -s "server hello, adding extended master secret extension" \ |
| 1944 | -c "found extended_master_secret extension" \ |
| 1945 | -c "session hash for extended master secret" \ |
| 1946 | -s "session hash for extended master secret" |
| 1947 | |
| 1948 | run_test "Extended Master Secret: client enabled, server disabled, client enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1949 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 1950 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
| 1951 | 1 \ |
| 1952 | -c "client hello, adding extended_master_secret extension" \ |
| 1953 | -s "found extended master secret extension" \ |
| 1954 | -S "server hello, adding extended master secret extension" \ |
| 1955 | -C "found extended_master_secret extension" \ |
| 1956 | -c "Peer not offering extended master secret, while it is enforced" |
| 1957 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1958 | run_test "Extended Master Secret enforced: client disabled, server enabled, server enforcing" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 1959 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=1" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1960 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 41b3591 | 2019-06-10 15:51:11 +0300 | [diff] [blame] | 1961 | 1 \ |
| 1962 | -C "client hello, adding extended_master_secret extension" \ |
| 1963 | -S "found extended master secret extension" \ |
| 1964 | -S "server hello, adding extended master secret extension" \ |
| 1965 | -C "found extended_master_secret extension" \ |
| 1966 | -s "Peer not offering extended master secret, while it is enforced" |
| 1967 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1968 | run_test "Extended Master Secret: client enabled, server disabled, not enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1969 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
| 1970 | "$P_CLI debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1971 | 0 \ |
| 1972 | -c "client hello, adding extended_master_secret extension" \ |
| 1973 | -s "found extended master secret extension" \ |
| 1974 | -S "server hello, adding extended master secret extension" \ |
| 1975 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 1976 | -C "session hash for extended master secret" \ |
| 1977 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1978 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1979 | run_test "Extended Master Secret: client disabled, server enabled, not enforcing" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1980 | "$P_SRV debug_level=3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 1981 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1982 | 0 \ |
| 1983 | -C "client hello, adding extended_master_secret extension" \ |
| 1984 | -S "found extended master secret extension" \ |
| 1985 | -S "server hello, adding extended master secret extension" \ |
| 1986 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 1987 | -C "session hash for extended master secret" \ |
| 1988 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1989 | |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1990 | run_test "Extended Master Secret: client disabled, server disabled" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 1991 | "$P_SRV debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
| 1992 | "$P_CLI debug_level=3 extended_ms=0 enforce_extended_master_secret=0" \ |
Jarno Lamsa | 20095af | 2019-06-11 17:16:58 +0300 | [diff] [blame] | 1993 | 0 \ |
| 1994 | -C "client hello, adding extended_master_secret extension" \ |
| 1995 | -S "found extended master secret extension" \ |
| 1996 | -S "server hello, adding extended master secret extension" \ |
| 1997 | -C "found extended_master_secret extension" \ |
| 1998 | -C "session hash for extended master secret" \ |
| 1999 | -S "session hash for extended master secret" |
| 2000 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2001 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2002 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2003 | "$P_SRV debug_level=3 min_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2004 | "$P_CLI debug_level=3 force_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2005 | 0 \ |
| 2006 | -C "client hello, adding extended_master_secret extension" \ |
| 2007 | -S "found extended master secret extension" \ |
| 2008 | -S "server hello, adding extended master secret extension" \ |
| 2009 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2010 | -C "session hash for extended master secret" \ |
| 2011 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2012 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2013 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2014 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
Hanno Becker | af5ab91 | 2019-06-21 12:59:46 +0100 | [diff] [blame] | 2015 | "$P_SRV debug_level=3 force_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
| 2016 | "$P_CLI debug_level=3 min_version=ssl3 extended_ms=1 enforce_extended_master_secret=0" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2017 | 0 \ |
| 2018 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2019 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2020 | -S "server hello, adding extended master secret extension" \ |
| 2021 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 9c5bcc9 | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2022 | -C "session hash for extended master secret" \ |
| 2023 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2024 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2025 | # Tests for FALLBACK_SCSV |
| 2026 | |
| 2027 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2028 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2029 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2030 | 0 \ |
| 2031 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2032 | -S "received FALLBACK_SCSV" \ |
| 2033 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2034 | -C "is a fatal alert message (msg 86)" |
| 2035 | |
| 2036 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2037 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2038 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2039 | 0 \ |
| 2040 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2041 | -S "received FALLBACK_SCSV" \ |
| 2042 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2043 | -C "is a fatal alert message (msg 86)" |
| 2044 | |
| 2045 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2046 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2047 | "$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] | 2048 | 1 \ |
| 2049 | -c "adding FALLBACK_SCSV" \ |
| 2050 | -s "received FALLBACK_SCSV" \ |
| 2051 | -s "inapropriate fallback" \ |
| 2052 | -c "is a fatal alert message (msg 86)" |
| 2053 | |
| 2054 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2055 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2056 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2057 | 0 \ |
| 2058 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2059 | -s "received FALLBACK_SCSV" \ |
| 2060 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2061 | -C "is a fatal alert message (msg 86)" |
| 2062 | |
| 2063 | requires_openssl_with_fallback_scsv |
| 2064 | run_test "Fallback SCSV: default, openssl server" \ |
| 2065 | "$O_SRV" \ |
| 2066 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2067 | 0 \ |
| 2068 | -C "adding FALLBACK_SCSV" \ |
| 2069 | -C "is a fatal alert message (msg 86)" |
| 2070 | |
| 2071 | requires_openssl_with_fallback_scsv |
| 2072 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2073 | "$O_SRV" \ |
| 2074 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2075 | 1 \ |
| 2076 | -c "adding FALLBACK_SCSV" \ |
| 2077 | -c "is a fatal alert message (msg 86)" |
| 2078 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2079 | requires_openssl_with_fallback_scsv |
| 2080 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2081 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2082 | "$O_CLI -tls1_1" \ |
| 2083 | 0 \ |
| 2084 | -S "received FALLBACK_SCSV" \ |
| 2085 | -S "inapropriate fallback" |
| 2086 | |
| 2087 | requires_openssl_with_fallback_scsv |
| 2088 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2089 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2090 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2091 | 1 \ |
| 2092 | -s "received FALLBACK_SCSV" \ |
| 2093 | -s "inapropriate fallback" |
| 2094 | |
| 2095 | requires_openssl_with_fallback_scsv |
| 2096 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2097 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2098 | "$O_CLI -fallback_scsv" \ |
| 2099 | 0 \ |
| 2100 | -s "received FALLBACK_SCSV" \ |
| 2101 | -S "inapropriate fallback" |
| 2102 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2103 | # Test sending and receiving empty application data records |
| 2104 | |
| 2105 | run_test "Encrypt then MAC: empty application data record" \ |
| 2106 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2107 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2108 | 0 \ |
| 2109 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2110 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2111 | -c "0 bytes written in 1 fragments" |
| 2112 | |
| 2113 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2114 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2115 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2116 | 0 \ |
| 2117 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2118 | -c "0 bytes written in 1 fragments" |
| 2119 | |
| 2120 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2121 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2122 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2123 | 0 \ |
| 2124 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2125 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2126 | -c "0 bytes written in 1 fragments" |
| 2127 | |
| 2128 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2129 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2130 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2131 | 0 \ |
| 2132 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2133 | -c "0 bytes written in 1 fragments" |
| 2134 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2135 | ## ClientHello generated with |
| 2136 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2137 | ## then manually twiddling the ciphersuite list. |
| 2138 | ## The ClientHello content is spelled out below as a hex string as |
| 2139 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2140 | ## The expected response is an inappropriate_fallback alert. |
| 2141 | requires_openssl_with_fallback_scsv |
| 2142 | run_test "Fallback SCSV: beginning of list" \ |
| 2143 | "$P_SRV debug_level=2" \ |
| 2144 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2145 | 0 \ |
| 2146 | -s "received FALLBACK_SCSV" \ |
| 2147 | -s "inapropriate fallback" |
| 2148 | |
| 2149 | requires_openssl_with_fallback_scsv |
| 2150 | run_test "Fallback SCSV: end of list" \ |
| 2151 | "$P_SRV debug_level=2" \ |
| 2152 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2153 | 0 \ |
| 2154 | -s "received FALLBACK_SCSV" \ |
| 2155 | -s "inapropriate fallback" |
| 2156 | |
| 2157 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2158 | requires_openssl_with_fallback_scsv |
| 2159 | run_test "Fallback SCSV: not in list" \ |
| 2160 | "$P_SRV debug_level=2" \ |
| 2161 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2162 | 0 \ |
| 2163 | -S "received FALLBACK_SCSV" \ |
| 2164 | -S "inapropriate fallback" |
| 2165 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2166 | # Tests for CBC 1/n-1 record splitting |
| 2167 | |
| 2168 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2169 | "$P_SRV" \ |
| 2170 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2171 | request_size=123 force_version=tls1_2" \ |
| 2172 | 0 \ |
| 2173 | -s "Read from client: 123 bytes read" \ |
| 2174 | -S "Read from client: 1 bytes read" \ |
| 2175 | -S "122 bytes read" |
| 2176 | |
| 2177 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2178 | "$P_SRV" \ |
| 2179 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2180 | request_size=123 force_version=tls1_1" \ |
| 2181 | 0 \ |
| 2182 | -s "Read from client: 123 bytes read" \ |
| 2183 | -S "Read from client: 1 bytes read" \ |
| 2184 | -S "122 bytes read" |
| 2185 | |
| 2186 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2187 | "$P_SRV" \ |
| 2188 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2189 | request_size=123 force_version=tls1" \ |
| 2190 | 0 \ |
| 2191 | -S "Read from client: 123 bytes read" \ |
| 2192 | -s "Read from client: 1 bytes read" \ |
| 2193 | -s "122 bytes read" |
| 2194 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2195 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2196 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2197 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2198 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2199 | request_size=123 force_version=ssl3" \ |
| 2200 | 0 \ |
| 2201 | -S "Read from client: 123 bytes read" \ |
| 2202 | -s "Read from client: 1 bytes read" \ |
| 2203 | -s "122 bytes read" |
| 2204 | |
| 2205 | 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] | 2206 | "$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] | 2207 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2208 | request_size=123 force_version=tls1" \ |
| 2209 | 0 \ |
| 2210 | -s "Read from client: 123 bytes read" \ |
| 2211 | -S "Read from client: 1 bytes read" \ |
| 2212 | -S "122 bytes read" |
| 2213 | |
| 2214 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2215 | "$P_SRV" \ |
| 2216 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2217 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2218 | 0 \ |
| 2219 | -s "Read from client: 123 bytes read" \ |
| 2220 | -S "Read from client: 1 bytes read" \ |
| 2221 | -S "122 bytes read" |
| 2222 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2223 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2224 | "$P_SRV nbio=2" \ |
| 2225 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2226 | request_size=123 force_version=tls1" \ |
| 2227 | 0 \ |
| 2228 | -S "Read from client: 123 bytes read" \ |
| 2229 | -s "Read from client: 1 bytes read" \ |
| 2230 | -s "122 bytes read" |
| 2231 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2232 | # Tests for Session Tickets |
| 2233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2234 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2235 | "$P_SRV debug_level=3 tickets=1" \ |
| 2236 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2237 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2238 | -c "client hello, adding session ticket extension" \ |
| 2239 | -s "found session ticket extension" \ |
| 2240 | -s "server hello, adding session ticket extension" \ |
| 2241 | -c "found session_ticket extension" \ |
| 2242 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2243 | -S "session successfully restored from cache" \ |
| 2244 | -s "session successfully restored from ticket" \ |
| 2245 | -s "a session has been resumed" \ |
| 2246 | -c "a session has been resumed" |
| 2247 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2248 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2249 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2250 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2251 | 0 \ |
| 2252 | -c "client hello, adding session ticket extension" \ |
| 2253 | -s "found session ticket extension" \ |
| 2254 | -s "server hello, adding session ticket extension" \ |
| 2255 | -c "found session_ticket extension" \ |
| 2256 | -c "parse new session ticket" \ |
| 2257 | -S "session successfully restored from cache" \ |
| 2258 | -s "session successfully restored from ticket" \ |
| 2259 | -s "a session has been resumed" \ |
| 2260 | -c "a session has been resumed" |
| 2261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2262 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2263 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2264 | "$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] | 2265 | 0 \ |
| 2266 | -c "client hello, adding session ticket extension" \ |
| 2267 | -s "found session ticket extension" \ |
| 2268 | -s "server hello, adding session ticket extension" \ |
| 2269 | -c "found session_ticket extension" \ |
| 2270 | -c "parse new session ticket" \ |
| 2271 | -S "session successfully restored from cache" \ |
| 2272 | -S "session successfully restored from ticket" \ |
| 2273 | -S "a session has been resumed" \ |
| 2274 | -C "a session has been resumed" |
| 2275 | |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2276 | run_test "Session resume using tickets: session copy" \ |
| 2277 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2278 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2279 | 0 \ |
| 2280 | -c "client hello, adding session ticket extension" \ |
| 2281 | -s "found session ticket extension" \ |
| 2282 | -s "server hello, adding session ticket extension" \ |
| 2283 | -c "found session_ticket extension" \ |
| 2284 | -c "parse new session ticket" \ |
| 2285 | -S "session successfully restored from cache" \ |
| 2286 | -s "session successfully restored from ticket" \ |
| 2287 | -s "a session has been resumed" \ |
| 2288 | -c "a session has been resumed" |
| 2289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2290 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2291 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2292 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2293 | 0 \ |
| 2294 | -c "client hello, adding session ticket extension" \ |
| 2295 | -c "found session_ticket extension" \ |
| 2296 | -c "parse new session ticket" \ |
| 2297 | -c "a session has been resumed" |
| 2298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2299 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2300 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2301 | "( $O_CLI -sess_out $SESSION; \ |
| 2302 | $O_CLI -sess_in $SESSION; \ |
| 2303 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2304 | 0 \ |
| 2305 | -s "found session ticket extension" \ |
| 2306 | -s "server hello, adding session ticket extension" \ |
| 2307 | -S "session successfully restored from cache" \ |
| 2308 | -s "session successfully restored from ticket" \ |
| 2309 | -s "a session has been resumed" |
| 2310 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2311 | # Tests for Session Tickets with DTLS |
| 2312 | |
| 2313 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2314 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2315 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2316 | 0 \ |
| 2317 | -c "client hello, adding session ticket extension" \ |
| 2318 | -s "found session ticket extension" \ |
| 2319 | -s "server hello, adding session ticket extension" \ |
| 2320 | -c "found session_ticket extension" \ |
| 2321 | -c "parse new session ticket" \ |
| 2322 | -S "session successfully restored from cache" \ |
| 2323 | -s "session successfully restored from ticket" \ |
| 2324 | -s "a session has been resumed" \ |
| 2325 | -c "a session has been resumed" |
| 2326 | |
| 2327 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2328 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2329 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2330 | 0 \ |
| 2331 | -c "client hello, adding session ticket extension" \ |
| 2332 | -s "found session ticket extension" \ |
| 2333 | -s "server hello, adding session ticket extension" \ |
| 2334 | -c "found session_ticket extension" \ |
| 2335 | -c "parse new session ticket" \ |
| 2336 | -S "session successfully restored from cache" \ |
| 2337 | -s "session successfully restored from ticket" \ |
| 2338 | -s "a session has been resumed" \ |
| 2339 | -c "a session has been resumed" |
| 2340 | |
| 2341 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2342 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2343 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2344 | 0 \ |
| 2345 | -c "client hello, adding session ticket extension" \ |
| 2346 | -s "found session ticket extension" \ |
| 2347 | -s "server hello, adding session ticket extension" \ |
| 2348 | -c "found session_ticket extension" \ |
| 2349 | -c "parse new session ticket" \ |
| 2350 | -S "session successfully restored from cache" \ |
| 2351 | -S "session successfully restored from ticket" \ |
| 2352 | -S "a session has been resumed" \ |
| 2353 | -C "a session has been resumed" |
| 2354 | |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2355 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2356 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2357 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ |
| 2358 | 0 \ |
| 2359 | -c "client hello, adding session ticket extension" \ |
| 2360 | -s "found session ticket extension" \ |
| 2361 | -s "server hello, adding session ticket extension" \ |
| 2362 | -c "found session_ticket extension" \ |
| 2363 | -c "parse new session ticket" \ |
| 2364 | -S "session successfully restored from cache" \ |
| 2365 | -s "session successfully restored from ticket" \ |
| 2366 | -s "a session has been resumed" \ |
| 2367 | -c "a session has been resumed" |
| 2368 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2369 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2370 | "$O_SRV -dtls1" \ |
| 2371 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2372 | 0 \ |
| 2373 | -c "client hello, adding session ticket extension" \ |
| 2374 | -c "found session_ticket extension" \ |
| 2375 | -c "parse new session ticket" \ |
| 2376 | -c "a session has been resumed" |
| 2377 | |
| 2378 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2379 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2380 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2381 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2382 | rm -f $SESSION )" \ |
| 2383 | 0 \ |
| 2384 | -s "found session ticket extension" \ |
| 2385 | -s "server hello, adding session ticket extension" \ |
| 2386 | -S "session successfully restored from cache" \ |
| 2387 | -s "session successfully restored from ticket" \ |
| 2388 | -s "a session has been resumed" |
| 2389 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2390 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2392 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2393 | "$P_SRV debug_level=3 tickets=0" \ |
| 2394 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2395 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2396 | -c "client hello, adding session ticket extension" \ |
| 2397 | -s "found session ticket extension" \ |
| 2398 | -S "server hello, adding session ticket extension" \ |
| 2399 | -C "found session_ticket extension" \ |
| 2400 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2401 | -s "session successfully restored from cache" \ |
| 2402 | -S "session successfully restored from ticket" \ |
| 2403 | -s "a session has been resumed" \ |
| 2404 | -c "a session has been resumed" |
| 2405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2406 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2407 | "$P_SRV debug_level=3 tickets=1" \ |
| 2408 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2409 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2410 | -C "client hello, adding session ticket extension" \ |
| 2411 | -S "found session ticket extension" \ |
| 2412 | -S "server hello, adding session ticket extension" \ |
| 2413 | -C "found session_ticket extension" \ |
| 2414 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2415 | -s "session successfully restored from cache" \ |
| 2416 | -S "session successfully restored from ticket" \ |
| 2417 | -s "a session has been resumed" \ |
| 2418 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2419 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2420 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2421 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2422 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2423 | 0 \ |
| 2424 | -S "session successfully restored from cache" \ |
| 2425 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2426 | -S "a session has been resumed" \ |
| 2427 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2428 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2429 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2430 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2431 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2432 | 0 \ |
| 2433 | -s "session successfully restored from cache" \ |
| 2434 | -S "session successfully restored from ticket" \ |
| 2435 | -s "a session has been resumed" \ |
| 2436 | -c "a session has been resumed" |
| 2437 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2438 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2439 | "$P_SRV debug_level=3 tickets=0" \ |
| 2440 | "$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] | 2441 | 0 \ |
| 2442 | -s "session successfully restored from cache" \ |
| 2443 | -S "session successfully restored from ticket" \ |
| 2444 | -s "a session has been resumed" \ |
| 2445 | -c "a session has been resumed" |
| 2446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2447 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2448 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2449 | "$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] | 2450 | 0 \ |
| 2451 | -S "session successfully restored from cache" \ |
| 2452 | -S "session successfully restored from ticket" \ |
| 2453 | -S "a session has been resumed" \ |
| 2454 | -C "a session has been resumed" |
| 2455 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2456 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2457 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2458 | "$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] | 2459 | 0 \ |
| 2460 | -s "session successfully restored from cache" \ |
| 2461 | -S "session successfully restored from ticket" \ |
| 2462 | -s "a session has been resumed" \ |
| 2463 | -c "a session has been resumed" |
| 2464 | |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2465 | run_test "Session resume using cache: session copy" \ |
| 2466 | "$P_SRV debug_level=3 tickets=0" \ |
| 2467 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2468 | 0 \ |
| 2469 | -s "session successfully restored from cache" \ |
| 2470 | -S "session successfully restored from ticket" \ |
| 2471 | -s "a session has been resumed" \ |
| 2472 | -c "a session has been resumed" |
| 2473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2474 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2475 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2476 | "( $O_CLI -sess_out $SESSION; \ |
| 2477 | $O_CLI -sess_in $SESSION; \ |
| 2478 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2479 | 0 \ |
| 2480 | -s "found session ticket extension" \ |
| 2481 | -S "server hello, adding session ticket extension" \ |
| 2482 | -s "session successfully restored from cache" \ |
| 2483 | -S "session successfully restored from ticket" \ |
| 2484 | -s "a session has been resumed" |
| 2485 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2486 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2487 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2488 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2489 | 0 \ |
| 2490 | -C "found session_ticket extension" \ |
| 2491 | -C "parse new session ticket" \ |
| 2492 | -c "a session has been resumed" |
| 2493 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2494 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2495 | |
| 2496 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2497 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2498 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2499 | 0 \ |
| 2500 | -c "client hello, adding session ticket extension" \ |
| 2501 | -s "found session ticket extension" \ |
| 2502 | -S "server hello, adding session ticket extension" \ |
| 2503 | -C "found session_ticket extension" \ |
| 2504 | -C "parse new session ticket" \ |
| 2505 | -s "session successfully restored from cache" \ |
| 2506 | -S "session successfully restored from ticket" \ |
| 2507 | -s "a session has been resumed" \ |
| 2508 | -c "a session has been resumed" |
| 2509 | |
| 2510 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2511 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2512 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2513 | 0 \ |
| 2514 | -C "client hello, adding session ticket extension" \ |
| 2515 | -S "found session ticket extension" \ |
| 2516 | -S "server hello, adding session ticket extension" \ |
| 2517 | -C "found session_ticket extension" \ |
| 2518 | -C "parse new session ticket" \ |
| 2519 | -s "session successfully restored from cache" \ |
| 2520 | -S "session successfully restored from ticket" \ |
| 2521 | -s "a session has been resumed" \ |
| 2522 | -c "a session has been resumed" |
| 2523 | |
| 2524 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2525 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2526 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2527 | 0 \ |
| 2528 | -S "session successfully restored from cache" \ |
| 2529 | -S "session successfully restored from ticket" \ |
| 2530 | -S "a session has been resumed" \ |
| 2531 | -C "a session has been resumed" |
| 2532 | |
| 2533 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2534 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2535 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2536 | 0 \ |
| 2537 | -s "session successfully restored from cache" \ |
| 2538 | -S "session successfully restored from ticket" \ |
| 2539 | -s "a session has been resumed" \ |
| 2540 | -c "a session has been resumed" |
| 2541 | |
| 2542 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2543 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2544 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2545 | 0 \ |
| 2546 | -s "session successfully restored from cache" \ |
| 2547 | -S "session successfully restored from ticket" \ |
| 2548 | -s "a session has been resumed" \ |
| 2549 | -c "a session has been resumed" |
| 2550 | |
| 2551 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2552 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2553 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2554 | 0 \ |
| 2555 | -S "session successfully restored from cache" \ |
| 2556 | -S "session successfully restored from ticket" \ |
| 2557 | -S "a session has been resumed" \ |
| 2558 | -C "a session has been resumed" |
| 2559 | |
| 2560 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2561 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2562 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2563 | 0 \ |
| 2564 | -s "session successfully restored from cache" \ |
| 2565 | -S "session successfully restored from ticket" \ |
| 2566 | -s "a session has been resumed" \ |
| 2567 | -c "a session has been resumed" |
| 2568 | |
Manuel Pégourié-Gonnard | 57a348b | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2569 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2570 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2571 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2572 | 0 \ |
| 2573 | -s "session successfully restored from cache" \ |
| 2574 | -S "session successfully restored from ticket" \ |
| 2575 | -s "a session has been resumed" \ |
| 2576 | -c "a session has been resumed" |
| 2577 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2578 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2579 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2580 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2581 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2582 | rm -f $SESSION )" \ |
| 2583 | 0 \ |
| 2584 | -s "found session ticket extension" \ |
| 2585 | -S "server hello, adding session ticket extension" \ |
| 2586 | -s "session successfully restored from cache" \ |
| 2587 | -S "session successfully restored from ticket" \ |
| 2588 | -s "a session has been resumed" |
| 2589 | |
| 2590 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2591 | "$O_SRV -dtls1" \ |
| 2592 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2593 | 0 \ |
| 2594 | -C "found session_ticket extension" \ |
| 2595 | -C "parse new session ticket" \ |
| 2596 | -c "a session has been resumed" |
| 2597 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2598 | # Tests for Max Fragment Length extension |
| 2599 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2600 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2601 | 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] | 2602 | exit 1 |
| 2603 | fi |
| 2604 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2605 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2606 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2607 | fi |
| 2608 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2609 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2610 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2611 | "$P_SRV debug_level=3" \ |
| 2612 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2613 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2614 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2615 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2616 | -C "client hello, adding max_fragment_length extension" \ |
| 2617 | -S "found max fragment length extension" \ |
| 2618 | -S "server hello, max_fragment_length extension" \ |
| 2619 | -C "found max_fragment_length extension" |
| 2620 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2622 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2623 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2624 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2625 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2626 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2627 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2628 | -C "client hello, adding max_fragment_length extension" \ |
| 2629 | -S "found max fragment length extension" \ |
| 2630 | -S "server hello, max_fragment_length extension" \ |
| 2631 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2632 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2633 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2634 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2635 | |
| 2636 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2637 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2638 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2639 | "$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] | 2640 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2641 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2642 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2643 | -C "client hello, adding max_fragment_length extension" \ |
| 2644 | -S "found max fragment length extension" \ |
| 2645 | -S "server hello, max_fragment_length extension" \ |
| 2646 | -C "found max_fragment_length extension" \ |
| 2647 | -c "fragment larger than.*maximum " |
| 2648 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2649 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2650 | # (session fragment length will be 16384 regardless of mbedtls |
| 2651 | # content length configuration.) |
| 2652 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2653 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2654 | run_test "Max fragment length: disabled, larger message" \ |
| 2655 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2656 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2657 | 0 \ |
| 2658 | -C "Maximum fragment length is 16384" \ |
| 2659 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2660 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2661 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2662 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2663 | |
| 2664 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2665 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2666 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2667 | "$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] | 2668 | 1 \ |
| 2669 | -C "Maximum fragment length is 16384" \ |
| 2670 | -S "Maximum fragment length is 16384" \ |
| 2671 | -c "fragment larger than.*maximum " |
| 2672 | |
| 2673 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2674 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2675 | "$P_SRV debug_level=3" \ |
| 2676 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2677 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2678 | -c "Maximum fragment length is 4096" \ |
| 2679 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2680 | -c "client hello, adding max_fragment_length extension" \ |
| 2681 | -s "found max fragment length extension" \ |
| 2682 | -s "server hello, max_fragment_length extension" \ |
| 2683 | -c "found max_fragment_length extension" |
| 2684 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2686 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2687 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2688 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2689 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2690 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2691 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2692 | -C "client hello, adding max_fragment_length extension" \ |
| 2693 | -S "found max fragment length extension" \ |
| 2694 | -S "server hello, max_fragment_length extension" \ |
| 2695 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2696 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2697 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2698 | requires_gnutls |
| 2699 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2700 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2701 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2702 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2703 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2704 | -c "client hello, adding max_fragment_length extension" \ |
| 2705 | -c "found max_fragment_length extension" |
| 2706 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2707 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2708 | run_test "Max fragment length: client, message just fits" \ |
| 2709 | "$P_SRV debug_level=3" \ |
| 2710 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2711 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2712 | -c "Maximum fragment length is 2048" \ |
| 2713 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2714 | -c "client hello, adding max_fragment_length extension" \ |
| 2715 | -s "found max fragment length extension" \ |
| 2716 | -s "server hello, max_fragment_length extension" \ |
| 2717 | -c "found max_fragment_length extension" \ |
| 2718 | -c "2048 bytes written in 1 fragments" \ |
| 2719 | -s "2048 bytes read" |
| 2720 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2721 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2722 | run_test "Max fragment length: client, larger message" \ |
| 2723 | "$P_SRV debug_level=3" \ |
| 2724 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2725 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2726 | -c "Maximum fragment length is 2048" \ |
| 2727 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2728 | -c "client hello, adding max_fragment_length extension" \ |
| 2729 | -s "found max fragment length extension" \ |
| 2730 | -s "server hello, max_fragment_length extension" \ |
| 2731 | -c "found max_fragment_length extension" \ |
| 2732 | -c "2345 bytes written in 2 fragments" \ |
| 2733 | -s "2048 bytes read" \ |
| 2734 | -s "297 bytes read" |
| 2735 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2736 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2737 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2738 | "$P_SRV debug_level=3 dtls=1" \ |
| 2739 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2740 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2741 | -c "Maximum fragment length is 2048" \ |
| 2742 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2743 | -c "client hello, adding max_fragment_length extension" \ |
| 2744 | -s "found max fragment length extension" \ |
| 2745 | -s "server hello, max_fragment_length extension" \ |
| 2746 | -c "found max_fragment_length extension" \ |
| 2747 | -c "fragment larger than.*maximum" |
| 2748 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2749 | # Tests for renegotiation |
| 2750 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2751 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2752 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2753 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2754 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2755 | 0 \ |
| 2756 | -C "client hello, adding renegotiation extension" \ |
| 2757 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2758 | -S "found renegotiation extension" \ |
| 2759 | -s "server hello, secure renegotiation extension" \ |
| 2760 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2761 | -C "=> renegotiate" \ |
| 2762 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2763 | -S "write hello request" |
| 2764 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2766 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2767 | "$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] | 2768 | "$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] | 2769 | 0 \ |
| 2770 | -c "client hello, adding renegotiation extension" \ |
| 2771 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2772 | -s "found renegotiation extension" \ |
| 2773 | -s "server hello, secure renegotiation extension" \ |
| 2774 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2775 | -c "=> renegotiate" \ |
| 2776 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2777 | -S "write hello request" |
| 2778 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2780 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2781 | "$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] | 2782 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2783 | 0 \ |
| 2784 | -c "client hello, adding renegotiation extension" \ |
| 2785 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2786 | -s "found renegotiation extension" \ |
| 2787 | -s "server hello, secure renegotiation extension" \ |
| 2788 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2789 | -c "=> renegotiate" \ |
| 2790 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2791 | -s "write hello request" |
| 2792 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2793 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2794 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2795 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2797 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2798 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2799 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2800 | 0 \ |
| 2801 | -c "client hello, adding renegotiation extension" \ |
| 2802 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2803 | -s "found renegotiation extension" \ |
| 2804 | -s "server hello, secure renegotiation extension" \ |
| 2805 | -c "found renegotiation extension" \ |
| 2806 | -c "=> renegotiate" \ |
| 2807 | -s "=> renegotiate" \ |
| 2808 | -S "write hello request" \ |
| 2809 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2810 | |
| 2811 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2812 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2813 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2814 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2815 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2816 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2817 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2818 | 0 \ |
| 2819 | -c "client hello, adding renegotiation extension" \ |
| 2820 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2821 | -s "found renegotiation extension" \ |
| 2822 | -s "server hello, secure renegotiation extension" \ |
| 2823 | -c "found renegotiation extension" \ |
| 2824 | -c "=> renegotiate" \ |
| 2825 | -s "=> renegotiate" \ |
| 2826 | -s "write hello request" \ |
| 2827 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2828 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2829 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2830 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2831 | "$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] | 2832 | "$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] | 2833 | 0 \ |
| 2834 | -c "client hello, adding renegotiation extension" \ |
| 2835 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2836 | -s "found renegotiation extension" \ |
| 2837 | -s "server hello, secure renegotiation extension" \ |
| 2838 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2839 | -c "=> renegotiate" \ |
| 2840 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2841 | -s "write hello request" |
| 2842 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2843 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2844 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2845 | "$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] | 2846 | "$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] | 2847 | 1 \ |
| 2848 | -c "client hello, adding renegotiation extension" \ |
| 2849 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2850 | -S "found renegotiation extension" \ |
| 2851 | -s "server hello, secure renegotiation extension" \ |
| 2852 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2853 | -c "=> renegotiate" \ |
| 2854 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2855 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2856 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2857 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2858 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2859 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2860 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2861 | "$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] | 2862 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2863 | 0 \ |
| 2864 | -C "client hello, adding renegotiation extension" \ |
| 2865 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2866 | -S "found renegotiation extension" \ |
| 2867 | -s "server hello, secure renegotiation extension" \ |
| 2868 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2869 | -C "=> renegotiate" \ |
| 2870 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2871 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2872 | -S "SSL - An unexpected message was received from our peer" \ |
| 2873 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2874 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2875 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2876 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2877 | "$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] | 2878 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2879 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2880 | 0 \ |
| 2881 | -C "client hello, adding renegotiation extension" \ |
| 2882 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2883 | -S "found renegotiation extension" \ |
| 2884 | -s "server hello, secure renegotiation extension" \ |
| 2885 | -c "found renegotiation extension" \ |
| 2886 | -C "=> renegotiate" \ |
| 2887 | -S "=> renegotiate" \ |
| 2888 | -s "write hello request" \ |
| 2889 | -S "SSL - An unexpected message was received from our peer" \ |
| 2890 | -S "failed" |
| 2891 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2892 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2893 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2894 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2895 | "$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] | 2896 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2897 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2898 | 0 \ |
| 2899 | -C "client hello, adding renegotiation extension" \ |
| 2900 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2901 | -S "found renegotiation extension" \ |
| 2902 | -s "server hello, secure renegotiation extension" \ |
| 2903 | -c "found renegotiation extension" \ |
| 2904 | -C "=> renegotiate" \ |
| 2905 | -S "=> renegotiate" \ |
| 2906 | -s "write hello request" \ |
| 2907 | -S "SSL - An unexpected message was received from our peer" \ |
| 2908 | -S "failed" |
| 2909 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2910 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2911 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2912 | "$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] | 2913 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2914 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2915 | 0 \ |
| 2916 | -C "client hello, adding renegotiation extension" \ |
| 2917 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2918 | -S "found renegotiation extension" \ |
| 2919 | -s "server hello, secure renegotiation extension" \ |
| 2920 | -c "found renegotiation extension" \ |
| 2921 | -C "=> renegotiate" \ |
| 2922 | -S "=> renegotiate" \ |
| 2923 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2924 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2925 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2926 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2927 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2928 | "$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] | 2929 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2931 | 0 \ |
| 2932 | -c "client hello, adding renegotiation extension" \ |
| 2933 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2934 | -s "found renegotiation extension" \ |
| 2935 | -s "server hello, secure renegotiation extension" \ |
| 2936 | -c "found renegotiation extension" \ |
| 2937 | -c "=> renegotiate" \ |
| 2938 | -s "=> renegotiate" \ |
| 2939 | -s "write hello request" \ |
| 2940 | -S "SSL - An unexpected message was received from our peer" \ |
| 2941 | -S "failed" |
| 2942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2944 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2945 | "$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] | 2946 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2947 | 0 \ |
| 2948 | -C "client hello, adding renegotiation extension" \ |
| 2949 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2950 | -S "found renegotiation extension" \ |
| 2951 | -s "server hello, secure renegotiation extension" \ |
| 2952 | -c "found renegotiation extension" \ |
| 2953 | -S "record counter limit reached: renegotiate" \ |
| 2954 | -C "=> renegotiate" \ |
| 2955 | -S "=> renegotiate" \ |
| 2956 | -S "write hello request" \ |
| 2957 | -S "SSL - An unexpected message was received from our peer" \ |
| 2958 | -S "failed" |
| 2959 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2960 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2961 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2962 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2963 | "$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] | 2964 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2965 | 0 \ |
| 2966 | -c "client hello, adding renegotiation extension" \ |
| 2967 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2968 | -s "found renegotiation extension" \ |
| 2969 | -s "server hello, secure renegotiation extension" \ |
| 2970 | -c "found renegotiation extension" \ |
| 2971 | -s "record counter limit reached: renegotiate" \ |
| 2972 | -c "=> renegotiate" \ |
| 2973 | -s "=> renegotiate" \ |
| 2974 | -s "write hello request" \ |
| 2975 | -S "SSL - An unexpected message was received from our peer" \ |
| 2976 | -S "failed" |
| 2977 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2978 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2979 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2980 | "$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] | 2981 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2982 | 0 \ |
| 2983 | -c "client hello, adding renegotiation extension" \ |
| 2984 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2985 | -s "found renegotiation extension" \ |
| 2986 | -s "server hello, secure renegotiation extension" \ |
| 2987 | -c "found renegotiation extension" \ |
| 2988 | -s "record counter limit reached: renegotiate" \ |
| 2989 | -c "=> renegotiate" \ |
| 2990 | -s "=> renegotiate" \ |
| 2991 | -s "write hello request" \ |
| 2992 | -S "SSL - An unexpected message was received from our peer" \ |
| 2993 | -S "failed" |
| 2994 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2995 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2996 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2997 | "$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] | 2998 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2999 | 0 \ |
| 3000 | -C "client hello, adding renegotiation extension" \ |
| 3001 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3002 | -S "found renegotiation extension" \ |
| 3003 | -s "server hello, secure renegotiation extension" \ |
| 3004 | -c "found renegotiation extension" \ |
| 3005 | -S "record counter limit reached: renegotiate" \ |
| 3006 | -C "=> renegotiate" \ |
| 3007 | -S "=> renegotiate" \ |
| 3008 | -S "write hello request" \ |
| 3009 | -S "SSL - An unexpected message was received from our peer" \ |
| 3010 | -S "failed" |
| 3011 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3012 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3013 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3014 | "$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] | 3015 | "$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] | 3016 | 0 \ |
| 3017 | -c "client hello, adding renegotiation extension" \ |
| 3018 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3019 | -s "found renegotiation extension" \ |
| 3020 | -s "server hello, secure renegotiation extension" \ |
| 3021 | -c "found renegotiation extension" \ |
| 3022 | -c "=> renegotiate" \ |
| 3023 | -s "=> renegotiate" \ |
| 3024 | -S "write hello request" |
| 3025 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3027 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3028 | "$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] | 3029 | "$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] | 3030 | 0 \ |
| 3031 | -c "client hello, adding renegotiation extension" \ |
| 3032 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3033 | -s "found renegotiation extension" \ |
| 3034 | -s "server hello, secure renegotiation extension" \ |
| 3035 | -c "found renegotiation extension" \ |
| 3036 | -c "=> renegotiate" \ |
| 3037 | -s "=> renegotiate" \ |
| 3038 | -s "write hello request" |
| 3039 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3041 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3042 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3043 | "$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] | 3044 | 0 \ |
| 3045 | -c "client hello, adding renegotiation extension" \ |
| 3046 | -c "found renegotiation extension" \ |
| 3047 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3048 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3049 | -C "error" \ |
| 3050 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3051 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3052 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3054 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3055 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3056 | "$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] | 3057 | 0 \ |
| 3058 | -c "client hello, adding renegotiation extension" \ |
| 3059 | -c "found renegotiation extension" \ |
| 3060 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3061 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3062 | -C "error" \ |
| 3063 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3064 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3065 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3066 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3067 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3068 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3069 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3070 | 1 \ |
| 3071 | -c "client hello, adding renegotiation extension" \ |
| 3072 | -C "found renegotiation extension" \ |
| 3073 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3074 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3075 | -c "error" \ |
| 3076 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3077 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3078 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3080 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3081 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3082 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3083 | allow_legacy=0" \ |
| 3084 | 1 \ |
| 3085 | -c "client hello, adding renegotiation extension" \ |
| 3086 | -C "found renegotiation extension" \ |
| 3087 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3088 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3089 | -c "error" \ |
| 3090 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3091 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3092 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3093 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3094 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3095 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3096 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3097 | allow_legacy=1" \ |
| 3098 | 0 \ |
| 3099 | -c "client hello, adding renegotiation extension" \ |
| 3100 | -C "found renegotiation extension" \ |
| 3101 | -c "=> renegotiate" \ |
| 3102 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3103 | -C "error" \ |
| 3104 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3105 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3106 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3107 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3108 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3109 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3110 | 0 \ |
| 3111 | -c "client hello, adding renegotiation extension" \ |
| 3112 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3113 | -s "found renegotiation extension" \ |
| 3114 | -s "server hello, secure renegotiation extension" \ |
| 3115 | -c "found renegotiation extension" \ |
| 3116 | -c "=> renegotiate" \ |
| 3117 | -s "=> renegotiate" \ |
| 3118 | -S "write hello request" |
| 3119 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3120 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3121 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3122 | "$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] | 3123 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3124 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3125 | 0 \ |
| 3126 | -c "client hello, adding renegotiation extension" \ |
| 3127 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3128 | -s "found renegotiation extension" \ |
| 3129 | -s "server hello, secure renegotiation extension" \ |
| 3130 | -c "found renegotiation extension" \ |
| 3131 | -c "=> renegotiate" \ |
| 3132 | -s "=> renegotiate" \ |
| 3133 | -s "write hello request" |
| 3134 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3135 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3136 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3137 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3138 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3139 | 0 \ |
| 3140 | -c "client hello, adding renegotiation extension" \ |
| 3141 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3142 | -s "found renegotiation extension" \ |
| 3143 | -s "server hello, secure renegotiation extension" \ |
| 3144 | -s "record counter limit reached: renegotiate" \ |
| 3145 | -c "=> renegotiate" \ |
| 3146 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3147 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3148 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3149 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3151 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3152 | "$G_SRV -u --mtu 4096" \ |
| 3153 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3154 | 0 \ |
| 3155 | -c "client hello, adding renegotiation extension" \ |
| 3156 | -c "found renegotiation extension" \ |
| 3157 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3158 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3159 | -C "error" \ |
| 3160 | -s "Extra-header:" |
| 3161 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3162 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3163 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3164 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3165 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3166 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3167 | "$P_CLI debug_level=3" \ |
| 3168 | 0 \ |
| 3169 | -c "found renegotiation extension" \ |
| 3170 | -C "error" \ |
| 3171 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3172 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3173 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3174 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3175 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3176 | "$P_CLI debug_level=3" \ |
| 3177 | 0 \ |
| 3178 | -C "found renegotiation extension" \ |
| 3179 | -C "error" \ |
| 3180 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3181 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3182 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3183 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3184 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3185 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3186 | 1 \ |
| 3187 | -C "found renegotiation extension" \ |
| 3188 | -c "error" \ |
| 3189 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3190 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3191 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3192 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3193 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3194 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3195 | 0 \ |
| 3196 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3197 | -s "server hello, secure renegotiation extension" |
| 3198 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3199 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3200 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3201 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3202 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3203 | 0 \ |
| 3204 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3205 | -S "server hello, secure renegotiation extension" |
| 3206 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3207 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3208 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3209 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3210 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3211 | 1 \ |
| 3212 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3213 | -S "server hello, secure renegotiation extension" |
| 3214 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3215 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3216 | |
| 3217 | requires_gnutls |
| 3218 | run_test "DER format: no trailing bytes" \ |
| 3219 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3220 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3221 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3222 | 0 \ |
| 3223 | -c "Handshake was completed" \ |
| 3224 | |
| 3225 | requires_gnutls |
| 3226 | run_test "DER format: with a trailing zero byte" \ |
| 3227 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3228 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3229 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3230 | 0 \ |
| 3231 | -c "Handshake was completed" \ |
| 3232 | |
| 3233 | requires_gnutls |
| 3234 | run_test "DER format: with a trailing random byte" \ |
| 3235 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3236 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3237 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3238 | 0 \ |
| 3239 | -c "Handshake was completed" \ |
| 3240 | |
| 3241 | requires_gnutls |
| 3242 | run_test "DER format: with 2 trailing random bytes" \ |
| 3243 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3244 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3245 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3246 | 0 \ |
| 3247 | -c "Handshake was completed" \ |
| 3248 | |
| 3249 | requires_gnutls |
| 3250 | run_test "DER format: with 4 trailing random bytes" \ |
| 3251 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3252 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3253 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3254 | 0 \ |
| 3255 | -c "Handshake was completed" \ |
| 3256 | |
| 3257 | requires_gnutls |
| 3258 | run_test "DER format: with 8 trailing random bytes" \ |
| 3259 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3260 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3261 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3262 | 0 \ |
| 3263 | -c "Handshake was completed" \ |
| 3264 | |
| 3265 | requires_gnutls |
| 3266 | run_test "DER format: with 9 trailing random bytes" \ |
| 3267 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3268 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3269 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3270 | 0 \ |
| 3271 | -c "Handshake was completed" \ |
| 3272 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3273 | # Tests for auth_mode |
| 3274 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3275 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3276 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3277 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3278 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3279 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3280 | 1 \ |
| 3281 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3282 | -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] | 3283 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3284 | -c "X509 - Certificate verification failed" |
| 3285 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3286 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3287 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3288 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3289 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3290 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3291 | 0 \ |
| 3292 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3293 | -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] | 3294 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3295 | -C "X509 - Certificate verification failed" |
| 3296 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3297 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3298 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3299 | "$P_SRV" \ |
| 3300 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3301 | 0 \ |
| 3302 | -c "x509_verify_cert() returned" \ |
| 3303 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3304 | -c "! Certificate verification flags"\ |
| 3305 | -C "! mbedtls_ssl_handshake returned" \ |
| 3306 | -C "X509 - Certificate verification failed" \ |
| 3307 | -C "SSL - No CA Chain is set, but required to operate" |
| 3308 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3309 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3310 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3311 | "$P_SRV" \ |
| 3312 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3313 | 1 \ |
| 3314 | -c "x509_verify_cert() returned" \ |
| 3315 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3316 | -c "! Certificate verification flags"\ |
| 3317 | -c "! mbedtls_ssl_handshake returned" \ |
| 3318 | -c "SSL - No CA Chain is set, but required to operate" |
| 3319 | |
| 3320 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3321 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3322 | # the client informs the server about the supported curves - it does, though, in the |
| 3323 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3324 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3325 | # different means to have the server ignoring the client's supported curve list. |
| 3326 | |
| 3327 | requires_config_enabled MBEDTLS_ECP_C |
| 3328 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3329 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3330 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3331 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3332 | 1 \ |
| 3333 | -c "bad certificate (EC key curve)"\ |
| 3334 | -c "! Certificate verification flags"\ |
| 3335 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3336 | |
| 3337 | requires_config_enabled MBEDTLS_ECP_C |
| 3338 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3339 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3340 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3341 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3342 | 1 \ |
| 3343 | -c "bad certificate (EC key curve)"\ |
| 3344 | -c "! Certificate verification flags"\ |
| 3345 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3346 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3347 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3348 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3349 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3350 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3351 | 0 \ |
| 3352 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3353 | -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] | 3354 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3355 | -C "X509 - Certificate verification failed" |
| 3356 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3357 | run_test "Authentication: client SHA256, server required" \ |
| 3358 | "$P_SRV auth_mode=required" \ |
| 3359 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3360 | key_file=data_files/server6.key \ |
| 3361 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3362 | 0 \ |
| 3363 | -c "Supported Signature Algorithm found: 4," \ |
| 3364 | -c "Supported Signature Algorithm found: 5," |
| 3365 | |
| 3366 | run_test "Authentication: client SHA384, server required" \ |
| 3367 | "$P_SRV auth_mode=required" \ |
| 3368 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3369 | key_file=data_files/server6.key \ |
| 3370 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3371 | 0 \ |
| 3372 | -c "Supported Signature Algorithm found: 4," \ |
| 3373 | -c "Supported Signature Algorithm found: 5," |
| 3374 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3376 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3377 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3378 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3379 | key_file=data_files/server5.key" \ |
| 3380 | 1 \ |
| 3381 | -S "skip write certificate request" \ |
| 3382 | -C "skip parse certificate request" \ |
| 3383 | -c "got a certificate request" \ |
| 3384 | -c "got no certificate to send" \ |
| 3385 | -S "x509_verify_cert() returned" \ |
| 3386 | -s "client has no certificate" \ |
| 3387 | -s "! mbedtls_ssl_handshake returned" \ |
| 3388 | -c "! mbedtls_ssl_handshake returned" \ |
| 3389 | -s "No client certification received from the client, but required by the authentication mode" |
| 3390 | |
| 3391 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3392 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3393 | "$P_CLI debug_level=3 crt_file=none \ |
| 3394 | key_file=data_files/server5.key" \ |
| 3395 | 1 \ |
| 3396 | -S "skip write certificate request" \ |
| 3397 | -C "skip parse certificate request" \ |
| 3398 | -c "got a certificate request" \ |
| 3399 | -c "= write certificate$" \ |
| 3400 | -C "skip write certificate$" \ |
| 3401 | -S "x509_verify_cert() returned" \ |
| 3402 | -s "client has no certificate" \ |
| 3403 | -s "! mbedtls_ssl_handshake returned" \ |
| 3404 | -c "! mbedtls_ssl_handshake returned" \ |
| 3405 | -s "No client certification received from the client, but required by the authentication mode" |
| 3406 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3407 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3408 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3409 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3410 | "$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] | 3411 | key_file=data_files/server5.key" \ |
| 3412 | 1 \ |
| 3413 | -S "skip write certificate request" \ |
| 3414 | -C "skip parse certificate request" \ |
| 3415 | -c "got a certificate request" \ |
| 3416 | -C "skip write certificate" \ |
| 3417 | -C "skip write certificate verify" \ |
| 3418 | -S "skip parse certificate verify" \ |
| 3419 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3420 | -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] | 3421 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3422 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3423 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3424 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3425 | # We don't check that the client receives the alert because it might |
| 3426 | # detect that its write end of the connection is closed and abort |
| 3427 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3428 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3429 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3430 | run_test "Authentication: client cert not trusted, server required" \ |
| 3431 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3432 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3433 | key_file=data_files/server5.key" \ |
| 3434 | 1 \ |
| 3435 | -S "skip write certificate request" \ |
| 3436 | -C "skip parse certificate request" \ |
| 3437 | -c "got a certificate request" \ |
| 3438 | -C "skip write certificate" \ |
| 3439 | -C "skip write certificate verify" \ |
| 3440 | -S "skip parse certificate verify" \ |
| 3441 | -s "x509_verify_cert() returned" \ |
| 3442 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3443 | -s "! mbedtls_ssl_handshake returned" \ |
| 3444 | -c "! mbedtls_ssl_handshake returned" \ |
| 3445 | -s "X509 - Certificate verification failed" |
| 3446 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3447 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3448 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3449 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3450 | "$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] | 3451 | key_file=data_files/server5.key" \ |
| 3452 | 0 \ |
| 3453 | -S "skip write certificate request" \ |
| 3454 | -C "skip parse certificate request" \ |
| 3455 | -c "got a certificate request" \ |
| 3456 | -C "skip write certificate" \ |
| 3457 | -C "skip write certificate verify" \ |
| 3458 | -S "skip parse certificate verify" \ |
| 3459 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3460 | -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] | 3461 | -S "! mbedtls_ssl_handshake returned" \ |
| 3462 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3463 | -S "X509 - Certificate verification failed" |
| 3464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3465 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3466 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3467 | "$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] | 3468 | key_file=data_files/server5.key" \ |
| 3469 | 0 \ |
| 3470 | -s "skip write certificate request" \ |
| 3471 | -C "skip parse certificate request" \ |
| 3472 | -c "got no certificate request" \ |
| 3473 | -c "skip write certificate" \ |
| 3474 | -c "skip write certificate verify" \ |
| 3475 | -s "skip parse certificate verify" \ |
| 3476 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3477 | -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] | 3478 | -S "! mbedtls_ssl_handshake returned" \ |
| 3479 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3480 | -S "X509 - Certificate verification failed" |
| 3481 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3482 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3483 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3484 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3485 | "$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] | 3486 | 0 \ |
| 3487 | -S "skip write certificate request" \ |
| 3488 | -C "skip parse certificate request" \ |
| 3489 | -c "got a certificate request" \ |
| 3490 | -C "skip write certificate$" \ |
| 3491 | -C "got no certificate to send" \ |
| 3492 | -S "SSLv3 client has no certificate" \ |
| 3493 | -c "skip write certificate verify" \ |
| 3494 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3495 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3496 | -S "! mbedtls_ssl_handshake returned" \ |
| 3497 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3498 | -S "X509 - Certificate verification failed" |
| 3499 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3500 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3501 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3502 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3503 | "$O_CLI" \ |
| 3504 | 0 \ |
| 3505 | -S "skip write certificate request" \ |
| 3506 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3507 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3508 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3509 | -S "X509 - Certificate verification failed" |
| 3510 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3511 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3512 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3513 | "$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] | 3514 | 0 \ |
| 3515 | -C "skip parse certificate request" \ |
| 3516 | -c "got a certificate request" \ |
| 3517 | -C "skip write certificate$" \ |
| 3518 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3519 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3520 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3521 | run_test "Authentication: client no cert, openssl server required" \ |
| 3522 | "$O_SRV -Verify 10" \ |
| 3523 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3524 | 1 \ |
| 3525 | -C "skip parse certificate request" \ |
| 3526 | -c "got a certificate request" \ |
| 3527 | -C "skip write certificate$" \ |
| 3528 | -c "skip write certificate verify" \ |
| 3529 | -c "! mbedtls_ssl_handshake returned" |
| 3530 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Hanno Becker | b2c6383 | 2019-06-17 08:35:16 +0100 | [diff] [blame] | 3532 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3533 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3534 | "$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] | 3535 | "$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] | 3536 | 0 \ |
| 3537 | -S "skip write certificate request" \ |
| 3538 | -C "skip parse certificate request" \ |
| 3539 | -c "got a certificate request" \ |
| 3540 | -C "skip write certificate$" \ |
| 3541 | -c "skip write certificate verify" \ |
| 3542 | -c "got no certificate to send" \ |
| 3543 | -s "SSLv3 client has no certificate" \ |
| 3544 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3545 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3546 | -S "! mbedtls_ssl_handshake returned" \ |
| 3547 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3548 | -S "X509 - Certificate verification failed" |
| 3549 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3550 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3551 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3552 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3553 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3554 | 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] | 3555 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3556 | 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] | 3557 | 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] | 3558 | 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] | 3559 | printf "test value of ${MAX_IM_CA}. \n" |
| 3560 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3561 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3562 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3563 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3564 | |
| 3565 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3566 | fi |
| 3567 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3568 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3569 | run_test "Authentication: server max_int chain, client default" \ |
| 3570 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3571 | key_file=data_files/dir-maxpath/09.key" \ |
| 3572 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3573 | 0 \ |
| 3574 | -C "X509 - A fatal error occured" |
| 3575 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3576 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3577 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3578 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3579 | key_file=data_files/dir-maxpath/10.key" \ |
| 3580 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3581 | 1 \ |
| 3582 | -c "X509 - A fatal error occured" |
| 3583 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3584 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3585 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3586 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3587 | key_file=data_files/dir-maxpath/10.key" \ |
| 3588 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3589 | auth_mode=optional" \ |
| 3590 | 1 \ |
| 3591 | -c "X509 - A fatal error occured" |
| 3592 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3593 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3594 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3595 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3596 | key_file=data_files/dir-maxpath/10.key" \ |
| 3597 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3598 | auth_mode=none" \ |
| 3599 | 0 \ |
| 3600 | -C "X509 - A fatal error occured" |
| 3601 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3602 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3603 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3604 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3605 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3606 | key_file=data_files/dir-maxpath/10.key" \ |
| 3607 | 0 \ |
| 3608 | -S "X509 - A fatal error occured" |
| 3609 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3610 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3611 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3612 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3613 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3614 | key_file=data_files/dir-maxpath/10.key" \ |
| 3615 | 1 \ |
| 3616 | -s "X509 - A fatal error occured" |
| 3617 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3618 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3619 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3620 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3621 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3622 | key_file=data_files/dir-maxpath/10.key" \ |
| 3623 | 1 \ |
| 3624 | -s "X509 - A fatal error occured" |
| 3625 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3626 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3627 | run_test "Authentication: client max_int chain, server required" \ |
| 3628 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3629 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3630 | key_file=data_files/dir-maxpath/09.key" \ |
| 3631 | 0 \ |
| 3632 | -S "X509 - A fatal error occured" |
| 3633 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3634 | # Tests for CA list in CertificateRequest messages |
| 3635 | |
| 3636 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3637 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3638 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3639 | key_file=data_files/server6.key" \ |
| 3640 | 0 \ |
| 3641 | -s "requested DN" |
| 3642 | |
| 3643 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3644 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3645 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3646 | key_file=data_files/server6.key" \ |
| 3647 | 0 \ |
| 3648 | -S "requested DN" |
| 3649 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3650 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3651 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3652 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3653 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3654 | key_file=data_files/server5.key" \ |
| 3655 | 1 \ |
| 3656 | -S "requested DN" \ |
| 3657 | -s "x509_verify_cert() returned" \ |
| 3658 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3659 | -s "! mbedtls_ssl_handshake returned" \ |
| 3660 | -c "! mbedtls_ssl_handshake returned" \ |
| 3661 | -s "X509 - Certificate verification failed" |
| 3662 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3663 | # Tests for certificate selection based on SHA verson |
| 3664 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3665 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3666 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3667 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3668 | key_file=data_files/server5.key \ |
| 3669 | crt_file2=data_files/server5-sha1.crt \ |
| 3670 | key_file2=data_files/server5.key" \ |
| 3671 | "$P_CLI force_version=tls1_2" \ |
| 3672 | 0 \ |
| 3673 | -c "signed using.*ECDSA with SHA256" \ |
| 3674 | -C "signed using.*ECDSA with SHA1" |
| 3675 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3676 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3677 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3678 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3679 | key_file=data_files/server5.key \ |
| 3680 | crt_file2=data_files/server5-sha1.crt \ |
| 3681 | key_file2=data_files/server5.key" \ |
| 3682 | "$P_CLI force_version=tls1_1" \ |
| 3683 | 0 \ |
| 3684 | -C "signed using.*ECDSA with SHA256" \ |
| 3685 | -c "signed using.*ECDSA with SHA1" |
| 3686 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3687 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3688 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3689 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3690 | key_file=data_files/server5.key \ |
| 3691 | crt_file2=data_files/server5-sha1.crt \ |
| 3692 | key_file2=data_files/server5.key" \ |
| 3693 | "$P_CLI force_version=tls1" \ |
| 3694 | 0 \ |
| 3695 | -C "signed using.*ECDSA with SHA256" \ |
| 3696 | -c "signed using.*ECDSA with SHA1" |
| 3697 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3698 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3699 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3700 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3701 | key_file=data_files/server5.key \ |
| 3702 | crt_file2=data_files/server6.crt \ |
| 3703 | key_file2=data_files/server6.key" \ |
| 3704 | "$P_CLI force_version=tls1_1" \ |
| 3705 | 0 \ |
| 3706 | -c "serial number.*09" \ |
| 3707 | -c "signed using.*ECDSA with SHA256" \ |
| 3708 | -C "signed using.*ECDSA with SHA1" |
| 3709 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3710 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3711 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3712 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3713 | key_file=data_files/server6.key \ |
| 3714 | crt_file2=data_files/server5.crt \ |
| 3715 | key_file2=data_files/server5.key" \ |
| 3716 | "$P_CLI force_version=tls1_1" \ |
| 3717 | 0 \ |
| 3718 | -c "serial number.*0A" \ |
| 3719 | -c "signed using.*ECDSA with SHA256" \ |
| 3720 | -C "signed using.*ECDSA with SHA1" |
| 3721 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3722 | # tests for SNI |
| 3723 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3724 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3725 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3726 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3727 | 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] | 3728 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3729 | 0 \ |
| 3730 | -S "parse ServerName extension" \ |
| 3731 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3732 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3733 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3734 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3735 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3736 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3737 | 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] | 3738 | 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] | 3739 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3740 | 0 \ |
| 3741 | -s "parse ServerName extension" \ |
| 3742 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3743 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3744 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3745 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3746 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3747 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3748 | 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] | 3749 | 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] | 3750 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3751 | 0 \ |
| 3752 | -s "parse ServerName extension" \ |
| 3753 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3754 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3756 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3757 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3758 | 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] | 3759 | 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] | 3760 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3761 | 1 \ |
| 3762 | -s "parse ServerName extension" \ |
| 3763 | -s "ssl_sni_wrapper() returned" \ |
| 3764 | -s "mbedtls_ssl_handshake returned" \ |
| 3765 | -c "mbedtls_ssl_handshake returned" \ |
| 3766 | -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] | 3767 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3768 | run_test "SNI: client auth no override: optional" \ |
| 3769 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3770 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3771 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3772 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3773 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3774 | -S "skip write certificate request" \ |
| 3775 | -C "skip parse certificate request" \ |
| 3776 | -c "got a certificate request" \ |
| 3777 | -C "skip write certificate" \ |
| 3778 | -C "skip write certificate verify" \ |
| 3779 | -S "skip parse certificate verify" |
| 3780 | |
| 3781 | run_test "SNI: client auth override: none -> optional" \ |
| 3782 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3783 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3784 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3785 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3786 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3787 | -S "skip write certificate request" \ |
| 3788 | -C "skip parse certificate request" \ |
| 3789 | -c "got a certificate request" \ |
| 3790 | -C "skip write certificate" \ |
| 3791 | -C "skip write certificate verify" \ |
| 3792 | -S "skip parse certificate verify" |
| 3793 | |
| 3794 | run_test "SNI: client auth override: optional -> none" \ |
| 3795 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3796 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3797 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3798 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3799 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3800 | -s "skip write certificate request" \ |
| 3801 | -C "skip parse certificate request" \ |
| 3802 | -c "got no certificate request" \ |
| 3803 | -c "skip write certificate" \ |
| 3804 | -c "skip write certificate verify" \ |
| 3805 | -s "skip parse certificate verify" |
| 3806 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3807 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3808 | run_test "SNI: CA no override" \ |
| 3809 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3810 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3811 | ca_file=data_files/test-ca.crt \ |
| 3812 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3813 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3814 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3815 | 1 \ |
| 3816 | -S "skip write certificate request" \ |
| 3817 | -C "skip parse certificate request" \ |
| 3818 | -c "got a certificate request" \ |
| 3819 | -C "skip write certificate" \ |
| 3820 | -C "skip write certificate verify" \ |
| 3821 | -S "skip parse certificate verify" \ |
| 3822 | -s "x509_verify_cert() returned" \ |
| 3823 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3824 | -S "The certificate has been revoked (is on a CRL)" |
| 3825 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3826 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3827 | run_test "SNI: CA override" \ |
| 3828 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3829 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3830 | ca_file=data_files/test-ca.crt \ |
| 3831 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3832 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3833 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3834 | 0 \ |
| 3835 | -S "skip write certificate request" \ |
| 3836 | -C "skip parse certificate request" \ |
| 3837 | -c "got a certificate request" \ |
| 3838 | -C "skip write certificate" \ |
| 3839 | -C "skip write certificate verify" \ |
| 3840 | -S "skip parse certificate verify" \ |
| 3841 | -S "x509_verify_cert() returned" \ |
| 3842 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3843 | -S "The certificate has been revoked (is on a CRL)" |
| 3844 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3845 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3846 | run_test "SNI: CA override with CRL" \ |
| 3847 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3848 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3849 | ca_file=data_files/test-ca.crt \ |
| 3850 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3851 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3852 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3853 | 1 \ |
| 3854 | -S "skip write certificate request" \ |
| 3855 | -C "skip parse certificate request" \ |
| 3856 | -c "got a certificate request" \ |
| 3857 | -C "skip write certificate" \ |
| 3858 | -C "skip write certificate verify" \ |
| 3859 | -S "skip parse certificate verify" \ |
| 3860 | -s "x509_verify_cert() returned" \ |
| 3861 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3862 | -s "The certificate has been revoked (is on a CRL)" |
| 3863 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3864 | # Tests for SNI and DTLS |
| 3865 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3866 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3867 | run_test "SNI: DTLS, no SNI callback" \ |
| 3868 | "$P_SRV debug_level=3 dtls=1 \ |
| 3869 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3870 | "$P_CLI server_name=localhost dtls=1" \ |
| 3871 | 0 \ |
| 3872 | -S "parse ServerName extension" \ |
| 3873 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3874 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3875 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3876 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3877 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3878 | "$P_SRV debug_level=3 dtls=1 \ |
| 3879 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3880 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3881 | "$P_CLI server_name=localhost dtls=1" \ |
| 3882 | 0 \ |
| 3883 | -s "parse ServerName extension" \ |
| 3884 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3885 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3886 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3887 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3888 | run_test "SNI: DTLS, matching cert 2" \ |
| 3889 | "$P_SRV debug_level=3 dtls=1 \ |
| 3890 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3891 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3892 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3893 | 0 \ |
| 3894 | -s "parse ServerName extension" \ |
| 3895 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3896 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3897 | |
| 3898 | run_test "SNI: DTLS, no matching cert" \ |
| 3899 | "$P_SRV debug_level=3 dtls=1 \ |
| 3900 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3901 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3902 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3903 | 1 \ |
| 3904 | -s "parse ServerName extension" \ |
| 3905 | -s "ssl_sni_wrapper() returned" \ |
| 3906 | -s "mbedtls_ssl_handshake returned" \ |
| 3907 | -c "mbedtls_ssl_handshake returned" \ |
| 3908 | -c "SSL - A fatal alert message was received from our peer" |
| 3909 | |
| 3910 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3911 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3912 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3913 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3914 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3915 | 0 \ |
| 3916 | -S "skip write certificate request" \ |
| 3917 | -C "skip parse certificate request" \ |
| 3918 | -c "got a certificate request" \ |
| 3919 | -C "skip write certificate" \ |
| 3920 | -C "skip write certificate verify" \ |
| 3921 | -S "skip parse certificate verify" |
| 3922 | |
| 3923 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3924 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3925 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3926 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3927 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3928 | 0 \ |
| 3929 | -S "skip write certificate request" \ |
| 3930 | -C "skip parse certificate request" \ |
| 3931 | -c "got a certificate request" \ |
| 3932 | -C "skip write certificate" \ |
| 3933 | -C "skip write certificate verify" \ |
| 3934 | -S "skip parse certificate verify" |
| 3935 | |
| 3936 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3937 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3938 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3939 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3940 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3941 | 0 \ |
| 3942 | -s "skip write certificate request" \ |
| 3943 | -C "skip parse certificate request" \ |
| 3944 | -c "got no certificate request" \ |
| 3945 | -c "skip write certificate" \ |
| 3946 | -c "skip write certificate verify" \ |
| 3947 | -s "skip parse certificate verify" |
| 3948 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3949 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3950 | run_test "SNI: DTLS, CA no override" \ |
| 3951 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3952 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3953 | ca_file=data_files/test-ca.crt \ |
| 3954 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3955 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3956 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3957 | 1 \ |
| 3958 | -S "skip write certificate request" \ |
| 3959 | -C "skip parse certificate request" \ |
| 3960 | -c "got a certificate request" \ |
| 3961 | -C "skip write certificate" \ |
| 3962 | -C "skip write certificate verify" \ |
| 3963 | -S "skip parse certificate verify" \ |
| 3964 | -s "x509_verify_cert() returned" \ |
| 3965 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3966 | -S "The certificate has been revoked (is on a CRL)" |
| 3967 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3968 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3969 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3970 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3971 | ca_file=data_files/test-ca.crt \ |
| 3972 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3973 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3974 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3975 | 0 \ |
| 3976 | -S "skip write certificate request" \ |
| 3977 | -C "skip parse certificate request" \ |
| 3978 | -c "got a certificate request" \ |
| 3979 | -C "skip write certificate" \ |
| 3980 | -C "skip write certificate verify" \ |
| 3981 | -S "skip parse certificate verify" \ |
| 3982 | -S "x509_verify_cert() returned" \ |
| 3983 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3984 | -S "The certificate has been revoked (is on a CRL)" |
| 3985 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 3986 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3987 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3988 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3989 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3990 | ca_file=data_files/test-ca.crt \ |
| 3991 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3992 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3993 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3994 | 1 \ |
| 3995 | -S "skip write certificate request" \ |
| 3996 | -C "skip parse certificate request" \ |
| 3997 | -c "got a certificate request" \ |
| 3998 | -C "skip write certificate" \ |
| 3999 | -C "skip write certificate verify" \ |
| 4000 | -S "skip parse certificate verify" \ |
| 4001 | -s "x509_verify_cert() returned" \ |
| 4002 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4003 | -s "The certificate has been revoked (is on a CRL)" |
| 4004 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4005 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4006 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4007 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4008 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4009 | "$P_CLI nbio=2 tickets=0" \ |
| 4010 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4011 | -S "mbedtls_ssl_handshake returned" \ |
| 4012 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4013 | -c "Read from server: .* bytes read" |
| 4014 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4015 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4016 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4017 | "$P_CLI nbio=2 tickets=0" \ |
| 4018 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4019 | -S "mbedtls_ssl_handshake returned" \ |
| 4020 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4021 | -c "Read from server: .* bytes read" |
| 4022 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4023 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4024 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4025 | "$P_CLI nbio=2 tickets=1" \ |
| 4026 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4027 | -S "mbedtls_ssl_handshake returned" \ |
| 4028 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4029 | -c "Read from server: .* bytes read" |
| 4030 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4031 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4032 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4033 | "$P_CLI nbio=2 tickets=1" \ |
| 4034 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4035 | -S "mbedtls_ssl_handshake returned" \ |
| 4036 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4037 | -c "Read from server: .* bytes read" |
| 4038 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4039 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4040 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4041 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4042 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4043 | -S "mbedtls_ssl_handshake returned" \ |
| 4044 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4045 | -c "Read from server: .* bytes read" |
| 4046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4047 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4048 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4049 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4050 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4051 | -S "mbedtls_ssl_handshake returned" \ |
| 4052 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4053 | -c "Read from server: .* bytes read" |
| 4054 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4055 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4056 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4057 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4058 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4059 | -S "mbedtls_ssl_handshake returned" \ |
| 4060 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4061 | -c "Read from server: .* bytes read" |
| 4062 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4063 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4064 | |
| 4065 | run_test "Event-driven I/O: basic handshake" \ |
| 4066 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4067 | "$P_CLI event=1 tickets=0" \ |
| 4068 | 0 \ |
| 4069 | -S "mbedtls_ssl_handshake returned" \ |
| 4070 | -C "mbedtls_ssl_handshake returned" \ |
| 4071 | -c "Read from server: .* bytes read" |
| 4072 | |
| 4073 | run_test "Event-driven I/O: client auth" \ |
| 4074 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4075 | "$P_CLI event=1 tickets=0" \ |
| 4076 | 0 \ |
| 4077 | -S "mbedtls_ssl_handshake returned" \ |
| 4078 | -C "mbedtls_ssl_handshake returned" \ |
| 4079 | -c "Read from server: .* bytes read" |
| 4080 | |
| 4081 | run_test "Event-driven I/O: ticket" \ |
| 4082 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4083 | "$P_CLI event=1 tickets=1" \ |
| 4084 | 0 \ |
| 4085 | -S "mbedtls_ssl_handshake returned" \ |
| 4086 | -C "mbedtls_ssl_handshake returned" \ |
| 4087 | -c "Read from server: .* bytes read" |
| 4088 | |
| 4089 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4090 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4091 | "$P_CLI event=1 tickets=1" \ |
| 4092 | 0 \ |
| 4093 | -S "mbedtls_ssl_handshake returned" \ |
| 4094 | -C "mbedtls_ssl_handshake returned" \ |
| 4095 | -c "Read from server: .* bytes read" |
| 4096 | |
| 4097 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4098 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4099 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4100 | 0 \ |
| 4101 | -S "mbedtls_ssl_handshake returned" \ |
| 4102 | -C "mbedtls_ssl_handshake returned" \ |
| 4103 | -c "Read from server: .* bytes read" |
| 4104 | |
| 4105 | run_test "Event-driven I/O: ticket + resume" \ |
| 4106 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4107 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4108 | 0 \ |
| 4109 | -S "mbedtls_ssl_handshake returned" \ |
| 4110 | -C "mbedtls_ssl_handshake returned" \ |
| 4111 | -c "Read from server: .* bytes read" |
| 4112 | |
| 4113 | run_test "Event-driven I/O: session-id resume" \ |
| 4114 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4115 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4116 | 0 \ |
| 4117 | -S "mbedtls_ssl_handshake returned" \ |
| 4118 | -C "mbedtls_ssl_handshake returned" \ |
| 4119 | -c "Read from server: .* bytes read" |
| 4120 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4121 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4122 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4123 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4124 | 0 \ |
| 4125 | -c "Read from server: .* bytes read" |
| 4126 | |
| 4127 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4128 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4129 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4130 | 0 \ |
| 4131 | -c "Read from server: .* bytes read" |
| 4132 | |
| 4133 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4134 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4135 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4136 | 0 \ |
| 4137 | -c "Read from server: .* bytes read" |
| 4138 | |
| 4139 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4140 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4141 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4142 | 0 \ |
| 4143 | -c "Read from server: .* bytes read" |
| 4144 | |
| 4145 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4146 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4147 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4148 | 0 \ |
| 4149 | -c "Read from server: .* bytes read" |
| 4150 | |
| 4151 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4152 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4153 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4154 | 0 \ |
| 4155 | -c "Read from server: .* bytes read" |
| 4156 | |
| 4157 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4158 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4159 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4160 | 0 \ |
| 4161 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4162 | |
| 4163 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4164 | # During session resumption, the client will send its ApplicationData record |
| 4165 | # within the same datagram as the Finished messages. In this situation, the |
| 4166 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4167 | # because the ApplicationData request has already been queued internally. |
| 4168 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4169 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4170 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4171 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4172 | 0 \ |
| 4173 | -c "Read from server: .* bytes read" |
| 4174 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4175 | # Tests for version negotiation |
| 4176 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4177 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4178 | "$P_SRV" \ |
| 4179 | "$P_CLI" \ |
| 4180 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4181 | -S "mbedtls_ssl_handshake returned" \ |
| 4182 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4183 | -s "Protocol is TLSv1.2" \ |
| 4184 | -c "Protocol is TLSv1.2" |
| 4185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4186 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4187 | "$P_SRV" \ |
| 4188 | "$P_CLI max_version=tls1_1" \ |
| 4189 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4190 | -S "mbedtls_ssl_handshake returned" \ |
| 4191 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4192 | -s "Protocol is TLSv1.1" \ |
| 4193 | -c "Protocol is TLSv1.1" |
| 4194 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4195 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4196 | "$P_SRV max_version=tls1_1" \ |
| 4197 | "$P_CLI" \ |
| 4198 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4199 | -S "mbedtls_ssl_handshake returned" \ |
| 4200 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4201 | -s "Protocol is TLSv1.1" \ |
| 4202 | -c "Protocol is TLSv1.1" |
| 4203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4204 | 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] | 4205 | "$P_SRV max_version=tls1_1" \ |
| 4206 | "$P_CLI max_version=tls1_1" \ |
| 4207 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4208 | -S "mbedtls_ssl_handshake returned" \ |
| 4209 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4210 | -s "Protocol is TLSv1.1" \ |
| 4211 | -c "Protocol is TLSv1.1" |
| 4212 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4213 | 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] | 4214 | "$P_SRV min_version=tls1_1" \ |
| 4215 | "$P_CLI max_version=tls1_1" \ |
| 4216 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4217 | -S "mbedtls_ssl_handshake returned" \ |
| 4218 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4219 | -s "Protocol is TLSv1.1" \ |
| 4220 | -c "Protocol is TLSv1.1" |
| 4221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4222 | 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] | 4223 | "$P_SRV max_version=tls1_1" \ |
| 4224 | "$P_CLI min_version=tls1_1" \ |
| 4225 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4226 | -S "mbedtls_ssl_handshake returned" \ |
| 4227 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4228 | -s "Protocol is TLSv1.1" \ |
| 4229 | -c "Protocol is TLSv1.1" |
| 4230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4231 | 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] | 4232 | "$P_SRV max_version=tls1_1" \ |
| 4233 | "$P_CLI min_version=tls1_2" \ |
| 4234 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4235 | -s "mbedtls_ssl_handshake returned" \ |
| 4236 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4237 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4238 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4239 | 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] | 4240 | "$P_SRV min_version=tls1_2" \ |
| 4241 | "$P_CLI max_version=tls1_1" \ |
| 4242 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4243 | -s "mbedtls_ssl_handshake returned" \ |
| 4244 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4245 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4246 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4247 | # Tests for ALPN extension |
| 4248 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4249 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4250 | "$P_SRV debug_level=3" \ |
| 4251 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4252 | 0 \ |
| 4253 | -C "client hello, adding alpn extension" \ |
| 4254 | -S "found alpn extension" \ |
| 4255 | -C "got an alert message, type: \\[2:120]" \ |
| 4256 | -S "server hello, adding alpn extension" \ |
| 4257 | -C "found alpn extension " \ |
| 4258 | -C "Application Layer Protocol is" \ |
| 4259 | -S "Application Layer Protocol is" |
| 4260 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4261 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4262 | "$P_SRV debug_level=3" \ |
| 4263 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4264 | 0 \ |
| 4265 | -c "client hello, adding alpn extension" \ |
| 4266 | -s "found alpn extension" \ |
| 4267 | -C "got an alert message, type: \\[2:120]" \ |
| 4268 | -S "server hello, adding alpn extension" \ |
| 4269 | -C "found alpn extension " \ |
| 4270 | -c "Application Layer Protocol is (none)" \ |
| 4271 | -S "Application Layer Protocol is" |
| 4272 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4273 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4274 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4275 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4276 | 0 \ |
| 4277 | -C "client hello, adding alpn extension" \ |
| 4278 | -S "found alpn extension" \ |
| 4279 | -C "got an alert message, type: \\[2:120]" \ |
| 4280 | -S "server hello, adding alpn extension" \ |
| 4281 | -C "found alpn extension " \ |
| 4282 | -C "Application Layer Protocol is" \ |
| 4283 | -s "Application Layer Protocol is (none)" |
| 4284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4285 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4286 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4287 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4288 | 0 \ |
| 4289 | -c "client hello, adding alpn extension" \ |
| 4290 | -s "found alpn extension" \ |
| 4291 | -C "got an alert message, type: \\[2:120]" \ |
| 4292 | -s "server hello, adding alpn extension" \ |
| 4293 | -c "found alpn extension" \ |
| 4294 | -c "Application Layer Protocol is abc" \ |
| 4295 | -s "Application Layer Protocol is abc" |
| 4296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4297 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4298 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4299 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4300 | 0 \ |
| 4301 | -c "client hello, adding alpn extension" \ |
| 4302 | -s "found alpn extension" \ |
| 4303 | -C "got an alert message, type: \\[2:120]" \ |
| 4304 | -s "server hello, adding alpn extension" \ |
| 4305 | -c "found alpn extension" \ |
| 4306 | -c "Application Layer Protocol is abc" \ |
| 4307 | -s "Application Layer Protocol is abc" |
| 4308 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4309 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4310 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4311 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4312 | 0 \ |
| 4313 | -c "client hello, adding alpn extension" \ |
| 4314 | -s "found alpn extension" \ |
| 4315 | -C "got an alert message, type: \\[2:120]" \ |
| 4316 | -s "server hello, adding alpn extension" \ |
| 4317 | -c "found alpn extension" \ |
| 4318 | -c "Application Layer Protocol is 1234" \ |
| 4319 | -s "Application Layer Protocol is 1234" |
| 4320 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4321 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4322 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4323 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4324 | 1 \ |
| 4325 | -c "client hello, adding alpn extension" \ |
| 4326 | -s "found alpn extension" \ |
| 4327 | -c "got an alert message, type: \\[2:120]" \ |
| 4328 | -S "server hello, adding alpn extension" \ |
| 4329 | -C "found alpn extension" \ |
| 4330 | -C "Application Layer Protocol is 1234" \ |
| 4331 | -S "Application Layer Protocol is 1234" |
| 4332 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4333 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4334 | # Tests for keyUsage in leaf certificates, part 1: |
| 4335 | # server-side certificate/suite selection |
| 4336 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4337 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4338 | "$P_SRV key_file=data_files/server2.key \ |
| 4339 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4340 | "$P_CLI" \ |
| 4341 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4342 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4343 | |
| 4344 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4345 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4346 | "$P_SRV key_file=data_files/server2.key \ |
| 4347 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4348 | "$P_CLI" \ |
| 4349 | 0 \ |
| 4350 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4351 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4352 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4353 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4354 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4355 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4356 | 1 \ |
| 4357 | -C "Ciphersuite is " |
| 4358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4359 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4360 | "$P_SRV key_file=data_files/server5.key \ |
| 4361 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4362 | "$P_CLI" \ |
| 4363 | 0 \ |
| 4364 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4365 | |
| 4366 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4367 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4368 | "$P_SRV key_file=data_files/server5.key \ |
| 4369 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4370 | "$P_CLI" \ |
| 4371 | 0 \ |
| 4372 | -c "Ciphersuite is TLS-ECDH-" |
| 4373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4374 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4375 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4376 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4377 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4378 | 1 \ |
| 4379 | -C "Ciphersuite is " |
| 4380 | |
| 4381 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4382 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4384 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4385 | "$O_SRV -key data_files/server2.key \ |
| 4386 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4387 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4388 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4389 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4390 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4391 | -C "Processing of the Certificate handshake message failed" \ |
| 4392 | -c "Ciphersuite is TLS-" |
| 4393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4394 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4395 | "$O_SRV -key data_files/server2.key \ |
| 4396 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4397 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4398 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4399 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4400 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4401 | -C "Processing of the Certificate handshake message failed" \ |
| 4402 | -c "Ciphersuite is TLS-" |
| 4403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4404 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4405 | "$O_SRV -key data_files/server2.key \ |
| 4406 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4407 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4408 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4409 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4410 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4411 | -C "Processing of the Certificate handshake message failed" \ |
| 4412 | -c "Ciphersuite is TLS-" |
| 4413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4414 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4415 | "$O_SRV -key data_files/server2.key \ |
| 4416 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4417 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4418 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4419 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4420 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4421 | -c "Processing of the Certificate handshake message failed" \ |
| 4422 | -C "Ciphersuite is TLS-" |
| 4423 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4424 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4425 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4426 | "$O_SRV -key data_files/server2.key \ |
| 4427 | -cert data_files/server2.ku-ke.crt" \ |
| 4428 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4429 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4430 | 0 \ |
| 4431 | -c "bad certificate (usage extensions)" \ |
| 4432 | -C "Processing of the Certificate handshake message failed" \ |
| 4433 | -c "Ciphersuite is TLS-" \ |
| 4434 | -c "! Usage does not match the keyUsage extension" |
| 4435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4436 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4437 | "$O_SRV -key data_files/server2.key \ |
| 4438 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4439 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4440 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4441 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4442 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4443 | -C "Processing of the Certificate handshake message failed" \ |
| 4444 | -c "Ciphersuite is TLS-" |
| 4445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4446 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4447 | "$O_SRV -key data_files/server2.key \ |
| 4448 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4449 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4450 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4451 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4452 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4453 | -c "Processing of the Certificate handshake message failed" \ |
| 4454 | -C "Ciphersuite is TLS-" |
| 4455 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 4456 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4457 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4458 | "$O_SRV -key data_files/server2.key \ |
| 4459 | -cert data_files/server2.ku-ds.crt" \ |
| 4460 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4461 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4462 | 0 \ |
| 4463 | -c "bad certificate (usage extensions)" \ |
| 4464 | -C "Processing of the Certificate handshake message failed" \ |
| 4465 | -c "Ciphersuite is TLS-" \ |
| 4466 | -c "! Usage does not match the keyUsage extension" |
| 4467 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4468 | # Tests for keyUsage in leaf certificates, part 3: |
| 4469 | # server-side checking of client cert |
| 4470 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4471 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4472 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4473 | "$O_CLI -key data_files/server2.key \ |
| 4474 | -cert data_files/server2.ku-ds.crt" \ |
| 4475 | 0 \ |
| 4476 | -S "bad certificate (usage extensions)" \ |
| 4477 | -S "Processing of the Certificate handshake message failed" |
| 4478 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4479 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4480 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4481 | "$O_CLI -key data_files/server2.key \ |
| 4482 | -cert data_files/server2.ku-ke.crt" \ |
| 4483 | 0 \ |
| 4484 | -s "bad certificate (usage extensions)" \ |
| 4485 | -S "Processing of the Certificate handshake message failed" |
| 4486 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4487 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4488 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4489 | "$O_CLI -key data_files/server2.key \ |
| 4490 | -cert data_files/server2.ku-ke.crt" \ |
| 4491 | 1 \ |
| 4492 | -s "bad certificate (usage extensions)" \ |
| 4493 | -s "Processing of the Certificate handshake message failed" |
| 4494 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4495 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4496 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4497 | "$O_CLI -key data_files/server5.key \ |
| 4498 | -cert data_files/server5.ku-ds.crt" \ |
| 4499 | 0 \ |
| 4500 | -S "bad certificate (usage extensions)" \ |
| 4501 | -S "Processing of the Certificate handshake message failed" |
| 4502 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4503 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4504 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4505 | "$O_CLI -key data_files/server5.key \ |
| 4506 | -cert data_files/server5.ku-ka.crt" \ |
| 4507 | 0 \ |
| 4508 | -s "bad certificate (usage extensions)" \ |
| 4509 | -S "Processing of the Certificate handshake message failed" |
| 4510 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4511 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4513 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4514 | "$P_SRV key_file=data_files/server5.key \ |
| 4515 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4516 | "$P_CLI" \ |
| 4517 | 0 |
| 4518 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4519 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4520 | "$P_SRV key_file=data_files/server5.key \ |
| 4521 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4522 | "$P_CLI" \ |
| 4523 | 0 |
| 4524 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4525 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4526 | "$P_SRV key_file=data_files/server5.key \ |
| 4527 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4528 | "$P_CLI" \ |
| 4529 | 0 |
| 4530 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4531 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4532 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4533 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4534 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4535 | 1 |
| 4536 | |
| 4537 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4538 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4539 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4540 | "$O_SRV -key data_files/server5.key \ |
| 4541 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4542 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4543 | 0 \ |
| 4544 | -C "bad certificate (usage extensions)" \ |
| 4545 | -C "Processing of the Certificate handshake message failed" \ |
| 4546 | -c "Ciphersuite is TLS-" |
| 4547 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4548 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4549 | "$O_SRV -key data_files/server5.key \ |
| 4550 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4551 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4552 | 0 \ |
| 4553 | -C "bad certificate (usage extensions)" \ |
| 4554 | -C "Processing of the Certificate handshake message failed" \ |
| 4555 | -c "Ciphersuite is TLS-" |
| 4556 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4557 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4558 | "$O_SRV -key data_files/server5.key \ |
| 4559 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4560 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4561 | 0 \ |
| 4562 | -C "bad certificate (usage extensions)" \ |
| 4563 | -C "Processing of the Certificate handshake message failed" \ |
| 4564 | -c "Ciphersuite is TLS-" |
| 4565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4566 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4567 | "$O_SRV -key data_files/server5.key \ |
| 4568 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4569 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4570 | 1 \ |
| 4571 | -c "bad certificate (usage extensions)" \ |
| 4572 | -c "Processing of the Certificate handshake message failed" \ |
| 4573 | -C "Ciphersuite is TLS-" |
| 4574 | |
| 4575 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4576 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4577 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4578 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4579 | "$O_CLI -key data_files/server5.key \ |
| 4580 | -cert data_files/server5.eku-cli.crt" \ |
| 4581 | 0 \ |
| 4582 | -S "bad certificate (usage extensions)" \ |
| 4583 | -S "Processing of the Certificate handshake message failed" |
| 4584 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4585 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4586 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4587 | "$O_CLI -key data_files/server5.key \ |
| 4588 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4589 | 0 \ |
| 4590 | -S "bad certificate (usage extensions)" \ |
| 4591 | -S "Processing of the Certificate handshake message failed" |
| 4592 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4593 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4594 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4595 | "$O_CLI -key data_files/server5.key \ |
| 4596 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4597 | 0 \ |
| 4598 | -S "bad certificate (usage extensions)" \ |
| 4599 | -S "Processing of the Certificate handshake message failed" |
| 4600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4601 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4602 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4603 | "$O_CLI -key data_files/server5.key \ |
| 4604 | -cert data_files/server5.eku-cs.crt" \ |
| 4605 | 0 \ |
| 4606 | -s "bad certificate (usage extensions)" \ |
| 4607 | -S "Processing of the Certificate handshake message failed" |
| 4608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4609 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4610 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4611 | "$O_CLI -key data_files/server5.key \ |
| 4612 | -cert data_files/server5.eku-cs.crt" \ |
| 4613 | 1 \ |
| 4614 | -s "bad certificate (usage extensions)" \ |
| 4615 | -s "Processing of the Certificate handshake message failed" |
| 4616 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4617 | # Tests for DHM parameters loading |
| 4618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4619 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4620 | "$P_SRV" \ |
| 4621 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4622 | debug_level=3" \ |
| 4623 | 0 \ |
| 4624 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 4625 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4626 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4627 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4628 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4629 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4630 | debug_level=3" \ |
| 4631 | 0 \ |
| 4632 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4633 | -c "value of 'DHM: G ' (2 bits)" |
| 4634 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4635 | # Tests for DHM client-side size checking |
| 4636 | |
| 4637 | run_test "DHM size: server default, client default, OK" \ |
| 4638 | "$P_SRV" \ |
| 4639 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4640 | debug_level=1" \ |
| 4641 | 0 \ |
| 4642 | -C "DHM prime too short:" |
| 4643 | |
| 4644 | run_test "DHM size: server default, client 2048, OK" \ |
| 4645 | "$P_SRV" \ |
| 4646 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4647 | debug_level=1 dhmlen=2048" \ |
| 4648 | 0 \ |
| 4649 | -C "DHM prime too short:" |
| 4650 | |
| 4651 | run_test "DHM size: server 1024, client default, OK" \ |
| 4652 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4653 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4654 | debug_level=1" \ |
| 4655 | 0 \ |
| 4656 | -C "DHM prime too short:" |
| 4657 | |
| 4658 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4659 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4660 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4661 | debug_level=1" \ |
| 4662 | 1 \ |
| 4663 | -c "DHM prime too short:" |
| 4664 | |
| 4665 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4666 | "$P_SRV" \ |
| 4667 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4668 | debug_level=1 dhmlen=2049" \ |
| 4669 | 1 \ |
| 4670 | -c "DHM prime too short:" |
| 4671 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4672 | # Tests for PSK callback |
| 4673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4674 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4675 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4676 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4677 | psk_identity=foo psk=abc123" \ |
| 4678 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4679 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4680 | -S "SSL - Unknown identity received" \ |
| 4681 | -S "SSL - Verification of the message MAC failed" |
| 4682 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4683 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4684 | "$P_SRV" \ |
| 4685 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4686 | psk_identity=foo psk=abc123" \ |
| 4687 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4688 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4689 | -S "SSL - Unknown identity received" \ |
| 4690 | -S "SSL - Verification of the message MAC failed" |
| 4691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4692 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4693 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4694 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4695 | psk_identity=foo psk=abc123" \ |
| 4696 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4697 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4698 | -s "SSL - Unknown identity received" \ |
| 4699 | -S "SSL - Verification of the message MAC failed" |
| 4700 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4701 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4702 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4703 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4704 | psk_identity=abc psk=dead" \ |
| 4705 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4706 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4707 | -S "SSL - Unknown identity received" \ |
| 4708 | -S "SSL - Verification of the message MAC failed" |
| 4709 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4710 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4711 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4712 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4713 | psk_identity=def psk=beef" \ |
| 4714 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4715 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4716 | -S "SSL - Unknown identity received" \ |
| 4717 | -S "SSL - Verification of the message MAC failed" |
| 4718 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4719 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4720 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4721 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4722 | psk_identity=ghi psk=beef" \ |
| 4723 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4724 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4725 | -s "SSL - Unknown identity received" \ |
| 4726 | -S "SSL - Verification of the message MAC failed" |
| 4727 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4728 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4729 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4730 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4731 | psk_identity=abc psk=beef" \ |
| 4732 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4733 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4734 | -S "SSL - Unknown identity received" \ |
| 4735 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4736 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4737 | # Tests for EC J-PAKE |
| 4738 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4740 | run_test "ECJPAKE: client not configured" \ |
| 4741 | "$P_SRV debug_level=3" \ |
| 4742 | "$P_CLI debug_level=3" \ |
| 4743 | 0 \ |
| 4744 | -C "add ciphersuite: c0ff" \ |
| 4745 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4746 | -S "found ecjpake kkpp extension" \ |
| 4747 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4748 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4749 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4750 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4751 | -S "None of the common ciphersuites is usable" |
| 4752 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4753 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4754 | run_test "ECJPAKE: server not configured" \ |
| 4755 | "$P_SRV debug_level=3" \ |
| 4756 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4757 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4758 | 1 \ |
| 4759 | -c "add ciphersuite: c0ff" \ |
| 4760 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4761 | -s "found ecjpake kkpp extension" \ |
| 4762 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4763 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4764 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4765 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4766 | -s "None of the common ciphersuites is usable" |
| 4767 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4768 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4769 | run_test "ECJPAKE: working, TLS" \ |
| 4770 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4771 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4772 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4773 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4774 | -c "add ciphersuite: c0ff" \ |
| 4775 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4776 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4777 | -s "found ecjpake kkpp extension" \ |
| 4778 | -S "skip ecjpake kkpp extension" \ |
| 4779 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4780 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4781 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4782 | -S "None of the common ciphersuites is usable" \ |
| 4783 | -S "SSL - Verification of the message MAC failed" |
| 4784 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4785 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4786 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4787 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4788 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4789 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4790 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4791 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4792 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4793 | -s "SSL - Verification of the message MAC failed" |
| 4794 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4795 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4796 | run_test "ECJPAKE: working, DTLS" \ |
| 4797 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4798 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4799 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4800 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4801 | -c "re-using cached ecjpake parameters" \ |
| 4802 | -S "SSL - Verification of the message MAC failed" |
| 4803 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4804 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4805 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4806 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4807 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4808 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4809 | 0 \ |
| 4810 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4811 | -S "SSL - Verification of the message MAC failed" |
| 4812 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4813 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4814 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4815 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4816 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4817 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4818 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4819 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4820 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4821 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4822 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4823 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4824 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4825 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4826 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4827 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4828 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4829 | 0 |
| 4830 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4831 | # Tests for ciphersuites per version |
| 4832 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4833 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4834 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4835 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4836 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4837 | "$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] | 4838 | "$P_CLI force_version=ssl3" \ |
| 4839 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4840 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4841 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4842 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4843 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4844 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4845 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4846 | "$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] | 4847 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4848 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4849 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4850 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4852 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4853 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4854 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4855 | "$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] | 4856 | "$P_CLI force_version=tls1_1" \ |
| 4857 | 0 \ |
| 4858 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4859 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4861 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4862 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4863 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4864 | "$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] | 4865 | "$P_CLI force_version=tls1_2" \ |
| 4866 | 0 \ |
| 4867 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4868 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4869 | # Test for ClientHello without extensions |
| 4870 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4871 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4872 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | b76e765 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 4873 | "$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] | 4874 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4875 | 0 \ |
| 4876 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4877 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4878 | requires_gnutls |
| 4879 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 4880 | "$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] | 4881 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4882 | 0 \ |
| 4883 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4884 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4885 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4886 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4887 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4888 | "$P_SRV" \ |
| 4889 | "$P_CLI request_size=100" \ |
| 4890 | 0 \ |
| 4891 | -s "Read from client: 100 bytes read$" |
| 4892 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4893 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4894 | "$P_SRV" \ |
| 4895 | "$P_CLI request_size=500" \ |
| 4896 | 0 \ |
| 4897 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4898 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4899 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4900 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4901 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4902 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4903 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4904 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4906 | 0 \ |
| 4907 | -s "Read from client: 1 bytes read" |
| 4908 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4909 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4910 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4911 | "$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] | 4912 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4913 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4914 | 0 \ |
| 4915 | -s "Read from client: 1 bytes read" |
| 4916 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4917 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4918 | "$P_SRV" \ |
| 4919 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4920 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4921 | 0 \ |
| 4922 | -s "Read from client: 1 bytes read" |
| 4923 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4924 | 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] | 4925 | "$P_SRV" \ |
| 4926 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4927 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4928 | 0 \ |
| 4929 | -s "Read from client: 1 bytes read" |
| 4930 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4931 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4932 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4933 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4934 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4935 | 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] | 4936 | 0 \ |
| 4937 | -s "Read from client: 1 bytes read" |
| 4938 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4940 | 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] | 4941 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4942 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4943 | 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] | 4944 | 0 \ |
| 4945 | -s "Read from client: 1 bytes read" |
| 4946 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4947 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4948 | "$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] | 4949 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4951 | 0 \ |
| 4952 | -s "Read from client: 1 bytes read" |
| 4953 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4954 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4955 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4956 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4958 | 0 \ |
| 4959 | -s "Read from client: 1 bytes read" |
| 4960 | |
| 4961 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4962 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4963 | "$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] | 4964 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4965 | 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] | 4966 | 0 \ |
| 4967 | -s "Read from client: 1 bytes read" |
| 4968 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4969 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4970 | 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] | 4971 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4972 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4973 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4974 | 0 \ |
| 4975 | -s "Read from client: 1 bytes read" |
| 4976 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4977 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4978 | "$P_SRV" \ |
| 4979 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4980 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4981 | 0 \ |
| 4982 | -s "Read from client: 1 bytes read" |
| 4983 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4984 | 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] | 4985 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4986 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4987 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4988 | 0 \ |
| 4989 | -s "Read from client: 1 bytes read" |
| 4990 | |
| 4991 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4992 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4993 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4994 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4995 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4996 | 0 \ |
| 4997 | -s "Read from client: 1 bytes read" |
| 4998 | |
| 4999 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5000 | 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] | 5001 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5002 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5003 | 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] | 5004 | 0 \ |
| 5005 | -s "Read from client: 1 bytes read" |
| 5006 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5007 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5008 | "$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] | 5009 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5010 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5011 | 0 \ |
| 5012 | -s "Read from client: 1 bytes read" |
| 5013 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5014 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5015 | "$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] | 5016 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5017 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5018 | 0 \ |
| 5019 | -s "Read from client: 1 bytes read" |
| 5020 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5022 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5023 | "$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] | 5024 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5025 | 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] | 5026 | 0 \ |
| 5027 | -s "Read from client: 1 bytes read" |
| 5028 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5029 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5030 | 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] | 5031 | "$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] | 5032 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5033 | 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] | 5034 | 0 \ |
| 5035 | -s "Read from client: 1 bytes read" |
| 5036 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5037 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5038 | "$P_SRV" \ |
| 5039 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5040 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5041 | 0 \ |
| 5042 | -s "Read from client: 1 bytes read" |
| 5043 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5044 | 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] | 5045 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5046 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5047 | 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] | 5048 | 0 \ |
| 5049 | -s "Read from client: 1 bytes read" |
| 5050 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5051 | 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] | 5052 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5053 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5054 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5055 | 0 \ |
| 5056 | -s "Read from client: 1 bytes read" |
| 5057 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5059 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5060 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5061 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5062 | 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] | 5063 | 0 \ |
| 5064 | -s "Read from client: 1 bytes read" |
| 5065 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5066 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5067 | 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] | 5068 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5069 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5070 | 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] | 5071 | 0 \ |
| 5072 | -s "Read from client: 1 bytes read" |
| 5073 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5074 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5075 | "$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] | 5076 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5077 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5078 | 0 \ |
| 5079 | -s "Read from client: 1 bytes read" |
| 5080 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5081 | 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] | 5082 | "$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] | 5083 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5084 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5085 | 0 \ |
| 5086 | -s "Read from client: 1 bytes read" |
| 5087 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5088 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5089 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5090 | "$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] | 5091 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5092 | 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] | 5093 | 0 \ |
| 5094 | -s "Read from client: 1 bytes read" |
| 5095 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5096 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5097 | 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] | 5098 | "$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] | 5099 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5100 | 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] | 5101 | 0 \ |
| 5102 | -s "Read from client: 1 bytes read" |
| 5103 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5104 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5105 | "$P_SRV" \ |
| 5106 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5108 | 0 \ |
| 5109 | -s "Read from client: 1 bytes read" |
| 5110 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5111 | 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] | 5112 | "$P_SRV" \ |
| 5113 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5115 | 0 \ |
| 5116 | -s "Read from client: 1 bytes read" |
| 5117 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5118 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5119 | |
| 5120 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5121 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5122 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5123 | "$P_CLI dtls=1 request_size=1 \ |
| 5124 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5125 | 0 \ |
| 5126 | -s "Read from client: 1 bytes read" |
| 5127 | |
| 5128 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5129 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5130 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5131 | "$P_CLI dtls=1 request_size=1 \ |
| 5132 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5133 | 0 \ |
| 5134 | -s "Read from client: 1 bytes read" |
| 5135 | |
| 5136 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5137 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5138 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5139 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5140 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5141 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5142 | 0 \ |
| 5143 | -s "Read from client: 1 bytes read" |
| 5144 | |
| 5145 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5146 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5147 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5148 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5149 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5150 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5151 | 0 \ |
| 5152 | -s "Read from client: 1 bytes read" |
| 5153 | |
| 5154 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5155 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5156 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5157 | "$P_CLI dtls=1 request_size=1 \ |
| 5158 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5159 | 0 \ |
| 5160 | -s "Read from client: 1 bytes read" |
| 5161 | |
| 5162 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5163 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5164 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5165 | "$P_CLI dtls=1 request_size=1 \ |
| 5166 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5167 | 0 \ |
| 5168 | -s "Read from client: 1 bytes read" |
| 5169 | |
| 5170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5171 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5172 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5173 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5174 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5175 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5176 | 0 \ |
| 5177 | -s "Read from client: 1 bytes read" |
| 5178 | |
| 5179 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5180 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5181 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5182 | "$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] | 5183 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5184 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5185 | 0 \ |
| 5186 | -s "Read from client: 1 bytes read" |
| 5187 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5188 | # Tests for small server packets |
| 5189 | |
| 5190 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5191 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5192 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5193 | "$P_CLI force_version=ssl3 \ |
| 5194 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5195 | 0 \ |
| 5196 | -c "Read from server: 1 bytes read" |
| 5197 | |
| 5198 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5199 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5200 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5201 | "$P_CLI force_version=ssl3 \ |
| 5202 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5203 | 0 \ |
| 5204 | -c "Read from server: 1 bytes read" |
| 5205 | |
| 5206 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5207 | "$P_SRV response_size=1" \ |
| 5208 | "$P_CLI force_version=tls1 \ |
| 5209 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5210 | 0 \ |
| 5211 | -c "Read from server: 1 bytes read" |
| 5212 | |
| 5213 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5214 | "$P_SRV response_size=1" \ |
| 5215 | "$P_CLI force_version=tls1 etm=0 \ |
| 5216 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5217 | 0 \ |
| 5218 | -c "Read from server: 1 bytes read" |
| 5219 | |
| 5220 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5221 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5222 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5223 | "$P_CLI force_version=tls1 \ |
| 5224 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5225 | 0 \ |
| 5226 | -c "Read from server: 1 bytes read" |
| 5227 | |
| 5228 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5229 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5230 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5231 | "$P_CLI force_version=tls1 \ |
| 5232 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5233 | 0 \ |
| 5234 | -c "Read from server: 1 bytes read" |
| 5235 | |
| 5236 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5237 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5238 | "$P_CLI force_version=tls1 \ |
| 5239 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5240 | 0 \ |
| 5241 | -c "Read from server: 1 bytes read" |
| 5242 | |
| 5243 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5244 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5245 | "$P_CLI force_version=tls1 \ |
| 5246 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5247 | 0 \ |
| 5248 | -c "Read from server: 1 bytes read" |
| 5249 | |
| 5250 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5251 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5252 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5253 | "$P_CLI force_version=tls1 \ |
| 5254 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5255 | 0 \ |
| 5256 | -c "Read from server: 1 bytes read" |
| 5257 | |
| 5258 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5259 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5260 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5261 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5262 | trunc_hmac=1 etm=0" \ |
| 5263 | 0 \ |
| 5264 | -c "Read from server: 1 bytes read" |
| 5265 | |
| 5266 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5267 | "$P_SRV response_size=1" \ |
| 5268 | "$P_CLI force_version=tls1_1 \ |
| 5269 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5270 | 0 \ |
| 5271 | -c "Read from server: 1 bytes read" |
| 5272 | |
| 5273 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5274 | "$P_SRV response_size=1" \ |
| 5275 | "$P_CLI force_version=tls1_1 \ |
| 5276 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5277 | 0 \ |
| 5278 | -c "Read from server: 1 bytes read" |
| 5279 | |
| 5280 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5281 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5282 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5283 | "$P_CLI force_version=tls1_1 \ |
| 5284 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5285 | 0 \ |
| 5286 | -c "Read from server: 1 bytes read" |
| 5287 | |
| 5288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5289 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5290 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5291 | "$P_CLI force_version=tls1_1 \ |
| 5292 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5293 | 0 \ |
| 5294 | -c "Read from server: 1 bytes read" |
| 5295 | |
| 5296 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5297 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5298 | "$P_CLI force_version=tls1_1 \ |
| 5299 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5300 | 0 \ |
| 5301 | -c "Read from server: 1 bytes read" |
| 5302 | |
| 5303 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5304 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5305 | "$P_CLI force_version=tls1_1 \ |
| 5306 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5307 | 0 \ |
| 5308 | -c "Read from server: 1 bytes read" |
| 5309 | |
| 5310 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5311 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5312 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5313 | "$P_CLI force_version=tls1_1 \ |
| 5314 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5315 | 0 \ |
| 5316 | -c "Read from server: 1 bytes read" |
| 5317 | |
| 5318 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5319 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5320 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5321 | "$P_CLI force_version=tls1_1 \ |
| 5322 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5323 | 0 \ |
| 5324 | -c "Read from server: 1 bytes read" |
| 5325 | |
| 5326 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5327 | "$P_SRV response_size=1" \ |
| 5328 | "$P_CLI force_version=tls1_2 \ |
| 5329 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5330 | 0 \ |
| 5331 | -c "Read from server: 1 bytes read" |
| 5332 | |
| 5333 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5334 | "$P_SRV response_size=1" \ |
| 5335 | "$P_CLI force_version=tls1_2 \ |
| 5336 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5337 | 0 \ |
| 5338 | -c "Read from server: 1 bytes read" |
| 5339 | |
| 5340 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5341 | "$P_SRV response_size=1" \ |
| 5342 | "$P_CLI force_version=tls1_2 \ |
| 5343 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5344 | 0 \ |
| 5345 | -c "Read from server: 1 bytes read" |
| 5346 | |
| 5347 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5348 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5349 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5350 | "$P_CLI force_version=tls1_2 \ |
| 5351 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5352 | 0 \ |
| 5353 | -c "Read from server: 1 bytes read" |
| 5354 | |
| 5355 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5356 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5357 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5358 | "$P_CLI force_version=tls1_2 \ |
| 5359 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5360 | 0 \ |
| 5361 | -c "Read from server: 1 bytes read" |
| 5362 | |
| 5363 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5364 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5365 | "$P_CLI force_version=tls1_2 \ |
| 5366 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5367 | 0 \ |
| 5368 | -c "Read from server: 1 bytes read" |
| 5369 | |
| 5370 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5371 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5372 | "$P_CLI force_version=tls1_2 \ |
| 5373 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5374 | 0 \ |
| 5375 | -c "Read from server: 1 bytes read" |
| 5376 | |
| 5377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5378 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5379 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5380 | "$P_CLI force_version=tls1_2 \ |
| 5381 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5382 | 0 \ |
| 5383 | -c "Read from server: 1 bytes read" |
| 5384 | |
| 5385 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5386 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5387 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5388 | "$P_CLI force_version=tls1_2 \ |
| 5389 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5390 | 0 \ |
| 5391 | -c "Read from server: 1 bytes read" |
| 5392 | |
| 5393 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5394 | "$P_SRV response_size=1" \ |
| 5395 | "$P_CLI force_version=tls1_2 \ |
| 5396 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5397 | 0 \ |
| 5398 | -c "Read from server: 1 bytes read" |
| 5399 | |
| 5400 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5401 | "$P_SRV response_size=1" \ |
| 5402 | "$P_CLI force_version=tls1_2 \ |
| 5403 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5404 | 0 \ |
| 5405 | -c "Read from server: 1 bytes read" |
| 5406 | |
| 5407 | # Tests for small server packets in DTLS |
| 5408 | |
| 5409 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5410 | run_test "Small server packet DTLS 1.0" \ |
| 5411 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5412 | "$P_CLI dtls=1 \ |
| 5413 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5414 | 0 \ |
| 5415 | -c "Read from server: 1 bytes read" |
| 5416 | |
| 5417 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5418 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 5419 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 5420 | "$P_CLI dtls=1 \ |
| 5421 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5422 | 0 \ |
| 5423 | -c "Read from server: 1 bytes read" |
| 5424 | |
| 5425 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5426 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5427 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 5428 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 5429 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 5430 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5431 | 0 \ |
| 5432 | -c "Read from server: 1 bytes read" |
| 5433 | |
| 5434 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5435 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5436 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 5437 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 5438 | "$P_CLI dtls=1 \ |
| 5439 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5440 | 0 \ |
| 5441 | -c "Read from server: 1 bytes read" |
| 5442 | |
| 5443 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5444 | run_test "Small server packet DTLS 1.2" \ |
| 5445 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5446 | "$P_CLI dtls=1 \ |
| 5447 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5448 | 0 \ |
| 5449 | -c "Read from server: 1 bytes read" |
| 5450 | |
| 5451 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5452 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5453 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5454 | "$P_CLI dtls=1 \ |
| 5455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5456 | 0 \ |
| 5457 | -c "Read from server: 1 bytes read" |
| 5458 | |
| 5459 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5460 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5461 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 5462 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 5463 | "$P_CLI dtls=1 \ |
| 5464 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5465 | 0 \ |
| 5466 | -c "Read from server: 1 bytes read" |
| 5467 | |
| 5468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5469 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5470 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 5471 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 5472 | "$P_CLI dtls=1 \ |
| 5473 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5474 | 0 \ |
| 5475 | -c "Read from server: 1 bytes read" |
| 5476 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 5477 | # A test for extensions in SSLv3 |
| 5478 | |
| 5479 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5480 | run_test "SSLv3 with extensions, server side" \ |
| 5481 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 5482 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 5483 | 0 \ |
| 5484 | -S "dumping 'client hello extensions'" \ |
| 5485 | -S "server hello, total extension length:" |
| 5486 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5487 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5488 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5489 | # How many fragments do we expect to write $1 bytes? |
| 5490 | fragments_for_write() { |
| 5491 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5492 | } |
| 5493 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5494 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5495 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5496 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5497 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5498 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5499 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5500 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5501 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5502 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5503 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5504 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5505 | "$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] | 5506 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 5507 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5508 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5509 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5510 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5511 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5512 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5513 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5514 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5515 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5516 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5517 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5518 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5519 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5520 | 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] | 5521 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5522 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 5523 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5524 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5525 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5526 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5528 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5529 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5530 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5531 | 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] | 5532 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5533 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5534 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5535 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5536 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5537 | 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] | 5538 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5539 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5540 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5541 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5542 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5543 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5544 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5545 | "$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] | 5546 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5547 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5548 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5549 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5550 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5551 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5552 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5553 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5554 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5555 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5556 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5557 | |
| 5558 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5559 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5560 | "$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] | 5561 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5562 | 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] | 5563 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5564 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5565 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5566 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5567 | 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] | 5568 | "$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] | 5569 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5570 | 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] | 5571 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5572 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5573 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5574 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5575 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5576 | "$P_SRV" \ |
| 5577 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5578 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5579 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5580 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5581 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5582 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5583 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5584 | "$P_SRV" \ |
| 5585 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 5586 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5587 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5588 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5589 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5590 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5591 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5592 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5593 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5594 | 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] | 5595 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5596 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5597 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5598 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5599 | 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] | 5600 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5601 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5602 | 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] | 5603 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5604 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5605 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5606 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5607 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5608 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5609 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5610 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5611 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5612 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5613 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5614 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5615 | "$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] | 5616 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5617 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5618 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5619 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5620 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5621 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5622 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5623 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5624 | "$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] | 5625 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5626 | 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] | 5627 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5628 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5629 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5631 | 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] | 5632 | "$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] | 5633 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5634 | 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] | 5635 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5636 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5637 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5638 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5639 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5640 | "$P_SRV" \ |
| 5641 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5642 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5643 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5644 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5645 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5646 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5647 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5648 | "$P_SRV" \ |
| 5649 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5650 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5651 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5652 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5653 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5654 | 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] | 5655 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5656 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5657 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5658 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5659 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5660 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5661 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5662 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5663 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5664 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5665 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5666 | 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] | 5667 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5668 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5669 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5670 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5671 | 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] | 5672 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5673 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5674 | 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] | 5675 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5676 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5678 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5679 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5680 | "$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] | 5681 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5682 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5683 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5684 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5685 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5686 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5687 | 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] | 5688 | "$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] | 5689 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5690 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5691 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5692 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5693 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5695 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5696 | "$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] | 5697 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5698 | 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] | 5699 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5700 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5701 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5702 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5703 | 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] | 5704 | "$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] | 5705 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5706 | 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] | 5707 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5708 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5709 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5710 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5711 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5712 | "$P_SRV" \ |
| 5713 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5715 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5716 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5718 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5719 | 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] | 5720 | "$P_SRV" \ |
| 5721 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5722 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5723 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5724 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5725 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5726 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5727 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5728 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5729 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5730 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5731 | "$P_CLI force_version=ssl3 \ |
| 5732 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5733 | 0 \ |
| 5734 | -c "Read from server: 16384 bytes read" |
| 5735 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5736 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5737 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5738 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5739 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5740 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5741 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5742 | 0 \ |
| 5743 | -c "Read from server: 1 bytes read"\ |
| 5744 | -c "16383 bytes read"\ |
| 5745 | -C "Read from server: 16384 bytes read" |
| 5746 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5747 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5748 | "$P_SRV response_size=16384" \ |
| 5749 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5750 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5751 | 0 \ |
| 5752 | -c "Read from server: 1 bytes read"\ |
| 5753 | -c "16383 bytes read"\ |
| 5754 | -C "Read from server: 16384 bytes read" |
| 5755 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5756 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5757 | "$P_SRV response_size=16384" \ |
| 5758 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5759 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5760 | 0 \ |
| 5761 | -c "Read from server: 1 bytes read"\ |
| 5762 | -c "16383 bytes read"\ |
| 5763 | -C "Read from server: 16384 bytes read" |
| 5764 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5765 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5766 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5767 | "$P_SRV response_size=16384" \ |
| 5768 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5770 | trunc_hmac=1" \ |
| 5771 | 0 \ |
| 5772 | -c "Read from server: 1 bytes read"\ |
| 5773 | -c "16383 bytes read"\ |
| 5774 | -C "Read from server: 16384 bytes read" |
| 5775 | |
| 5776 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5777 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5778 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5779 | "$P_CLI force_version=tls1 \ |
| 5780 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5781 | trunc_hmac=1" \ |
| 5782 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5783 | -s "16384 bytes written in 1 fragments" \ |
| 5784 | -c "Read from server: 16384 bytes read" |
| 5785 | |
| 5786 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5787 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5788 | "$P_CLI force_version=tls1 \ |
| 5789 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5790 | 0 \ |
| 5791 | -s "16384 bytes written in 1 fragments" \ |
| 5792 | -c "Read from server: 16384 bytes read" |
| 5793 | |
| 5794 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5795 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5796 | "$P_CLI force_version=tls1 \ |
| 5797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5798 | 0 \ |
| 5799 | -s "16384 bytes written in 1 fragments" \ |
| 5800 | -c "Read from server: 16384 bytes read" |
| 5801 | |
| 5802 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5803 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5804 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5805 | "$P_CLI force_version=tls1 \ |
| 5806 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5807 | 0 \ |
| 5808 | -s "16384 bytes written in 1 fragments" \ |
| 5809 | -c "Read from server: 16384 bytes read" |
| 5810 | |
| 5811 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5812 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5813 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5814 | "$P_CLI force_version=tls1 \ |
| 5815 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5816 | 0 \ |
| 5817 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5818 | -c "Read from server: 16384 bytes read" |
| 5819 | |
| 5820 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5821 | "$P_SRV response_size=16384" \ |
| 5822 | "$P_CLI force_version=tls1_1 \ |
| 5823 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5824 | 0 \ |
| 5825 | -c "Read from server: 16384 bytes read" |
| 5826 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5827 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5828 | "$P_SRV response_size=16384" \ |
| 5829 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5830 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5831 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5832 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5833 | -c "Read from server: 16384 bytes read" |
| 5834 | |
| 5835 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5836 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5837 | "$P_SRV response_size=16384" \ |
| 5838 | "$P_CLI force_version=tls1_1 \ |
| 5839 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5840 | trunc_hmac=1" \ |
| 5841 | 0 \ |
| 5842 | -c "Read from server: 16384 bytes read" |
| 5843 | |
| 5844 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5845 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5846 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5847 | "$P_CLI force_version=tls1_1 \ |
| 5848 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5849 | 0 \ |
| 5850 | -s "16384 bytes written in 1 fragments" \ |
| 5851 | -c "Read from server: 16384 bytes read" |
| 5852 | |
| 5853 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5854 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5855 | "$P_CLI force_version=tls1_1 \ |
| 5856 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5857 | 0 \ |
| 5858 | -c "Read from server: 16384 bytes read" |
| 5859 | |
| 5860 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5861 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5862 | "$P_CLI force_version=tls1_1 \ |
| 5863 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5864 | 0 \ |
| 5865 | -s "16384 bytes written in 1 fragments" \ |
| 5866 | -c "Read from server: 16384 bytes read" |
| 5867 | |
| 5868 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5869 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5870 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5871 | "$P_CLI force_version=tls1_1 \ |
| 5872 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5873 | trunc_hmac=1" \ |
| 5874 | 0 \ |
| 5875 | -c "Read from server: 16384 bytes read" |
| 5876 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5877 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5878 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5879 | "$P_CLI force_version=tls1_1 \ |
| 5880 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5881 | 0 \ |
| 5882 | -s "16384 bytes written in 1 fragments" \ |
| 5883 | -c "Read from server: 16384 bytes read" |
| 5884 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5885 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5886 | "$P_SRV response_size=16384" \ |
| 5887 | "$P_CLI force_version=tls1_2 \ |
| 5888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5889 | 0 \ |
| 5890 | -c "Read from server: 16384 bytes read" |
| 5891 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5892 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5893 | "$P_SRV response_size=16384" \ |
| 5894 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5895 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5896 | 0 \ |
| 5897 | -s "16384 bytes written in 1 fragments" \ |
| 5898 | -c "Read from server: 16384 bytes read" |
| 5899 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5900 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5901 | "$P_SRV response_size=16384" \ |
| 5902 | "$P_CLI force_version=tls1_2 \ |
| 5903 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5904 | 0 \ |
| 5905 | -c "Read from server: 16384 bytes read" |
| 5906 | |
| 5907 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5908 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5909 | "$P_SRV response_size=16384" \ |
| 5910 | "$P_CLI force_version=tls1_2 \ |
| 5911 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5912 | trunc_hmac=1" \ |
| 5913 | 0 \ |
| 5914 | -c "Read from server: 16384 bytes read" |
| 5915 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5916 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5917 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5918 | "$P_CLI force_version=tls1_2 \ |
| 5919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5920 | 0 \ |
| 5921 | -s "16384 bytes written in 1 fragments" \ |
| 5922 | -c "Read from server: 16384 bytes read" |
| 5923 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5924 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5925 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5926 | "$P_CLI force_version=tls1_2 \ |
| 5927 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5928 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5929 | -s "16384 bytes written in 1 fragments" \ |
| 5930 | -c "Read from server: 16384 bytes read" |
| 5931 | |
| 5932 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5933 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5934 | "$P_CLI force_version=tls1_2 \ |
| 5935 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5936 | 0 \ |
| 5937 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5938 | -c "Read from server: 16384 bytes read" |
| 5939 | |
| 5940 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5941 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5942 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5943 | "$P_CLI force_version=tls1_2 \ |
| 5944 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5945 | trunc_hmac=1" \ |
| 5946 | 0 \ |
| 5947 | -c "Read from server: 16384 bytes read" |
| 5948 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5949 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5950 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5951 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5952 | "$P_CLI force_version=tls1_2 \ |
| 5953 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5954 | 0 \ |
| 5955 | -s "16384 bytes written in 1 fragments" \ |
| 5956 | -c "Read from server: 16384 bytes read" |
| 5957 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5958 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5959 | "$P_SRV response_size=16384" \ |
| 5960 | "$P_CLI force_version=tls1_2 \ |
| 5961 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5962 | 0 \ |
| 5963 | -c "Read from server: 16384 bytes read" |
| 5964 | |
| 5965 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5966 | "$P_SRV response_size=16384" \ |
| 5967 | "$P_CLI force_version=tls1_2 \ |
| 5968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5969 | 0 \ |
| 5970 | -c "Read from server: 16384 bytes read" |
| 5971 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5972 | # Tests for restartable ECC |
| 5973 | |
| 5974 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5975 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5976 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5977 | "$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] | 5978 | 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] | 5979 | debug_level=1" \ |
| 5980 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5981 | -C "x509_verify_cert.*4b00" \ |
| 5982 | -C "mbedtls_pk_verify.*4b00" \ |
| 5983 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5984 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5985 | |
| 5986 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5987 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5988 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5989 | "$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] | 5990 | 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] | 5991 | debug_level=1 ec_max_ops=0" \ |
| 5992 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5993 | -C "x509_verify_cert.*4b00" \ |
| 5994 | -C "mbedtls_pk_verify.*4b00" \ |
| 5995 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5996 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5997 | |
| 5998 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5999 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6000 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6001 | "$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] | 6002 | 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] | 6003 | debug_level=1 ec_max_ops=65535" \ |
| 6004 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6005 | -C "x509_verify_cert.*4b00" \ |
| 6006 | -C "mbedtls_pk_verify.*4b00" \ |
| 6007 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6008 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6009 | |
| 6010 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6011 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6012 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6013 | "$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] | 6014 | 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] | 6015 | debug_level=1 ec_max_ops=1000" \ |
| 6016 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6017 | -c "x509_verify_cert.*4b00" \ |
| 6018 | -c "mbedtls_pk_verify.*4b00" \ |
| 6019 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6020 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6021 | |
| 6022 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6023 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6024 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6025 | "$P_SRV auth_mode=required \ |
| 6026 | crt_file=data_files/server5-badsign.crt \ |
| 6027 | key_file=data_files/server5.key" \ |
| 6028 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6029 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6030 | debug_level=1 ec_max_ops=1000" \ |
| 6031 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6032 | -c "x509_verify_cert.*4b00" \ |
| 6033 | -C "mbedtls_pk_verify.*4b00" \ |
| 6034 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6035 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6036 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6037 | -c "! mbedtls_ssl_handshake returned" \ |
| 6038 | -c "X509 - Certificate verification failed" |
| 6039 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6040 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6041 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6042 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6043 | "$P_SRV auth_mode=required \ |
| 6044 | crt_file=data_files/server5-badsign.crt \ |
| 6045 | key_file=data_files/server5.key" \ |
| 6046 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6047 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6048 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6049 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6050 | -c "x509_verify_cert.*4b00" \ |
| 6051 | -c "mbedtls_pk_verify.*4b00" \ |
| 6052 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6053 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6054 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6055 | -C "! mbedtls_ssl_handshake returned" \ |
| 6056 | -C "X509 - Certificate verification failed" |
| 6057 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6058 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6060 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6061 | "$P_SRV auth_mode=required \ |
| 6062 | crt_file=data_files/server5-badsign.crt \ |
| 6063 | key_file=data_files/server5.key" \ |
| 6064 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6065 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6066 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6067 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6068 | -C "x509_verify_cert.*4b00" \ |
| 6069 | -c "mbedtls_pk_verify.*4b00" \ |
| 6070 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6071 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6072 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6073 | -C "! mbedtls_ssl_handshake returned" \ |
| 6074 | -C "X509 - Certificate verification failed" |
| 6075 | |
| 6076 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6077 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6078 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6079 | "$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] | 6080 | 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] | 6081 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6082 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6083 | -c "x509_verify_cert.*4b00" \ |
| 6084 | -c "mbedtls_pk_verify.*4b00" \ |
| 6085 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6086 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6087 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6088 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6089 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6090 | "$P_SRV" \ |
| 6091 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6092 | debug_level=1 ec_max_ops=1000" \ |
| 6093 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6094 | -c "x509_verify_cert.*4b00" \ |
| 6095 | -c "mbedtls_pk_verify.*4b00" \ |
| 6096 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6097 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6098 | |
| 6099 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6100 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6101 | "$P_SRV psk=abc123" \ |
| 6102 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6103 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6104 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6105 | -C "x509_verify_cert.*4b00" \ |
| 6106 | -C "mbedtls_pk_verify.*4b00" \ |
| 6107 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6108 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6109 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6110 | # Tests of asynchronous private key support in SSL |
| 6111 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6112 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6113 | run_test "SSL async private: sign, delay=0" \ |
| 6114 | "$P_SRV \ |
| 6115 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6116 | "$P_CLI" \ |
| 6117 | 0 \ |
| 6118 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6119 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6120 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6121 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6122 | run_test "SSL async private: sign, delay=1" \ |
| 6123 | "$P_SRV \ |
| 6124 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6125 | "$P_CLI" \ |
| 6126 | 0 \ |
| 6127 | -s "Async sign callback: using key slot " \ |
| 6128 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6129 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6130 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6131 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6132 | run_test "SSL async private: sign, delay=2" \ |
| 6133 | "$P_SRV \ |
| 6134 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6135 | "$P_CLI" \ |
| 6136 | 0 \ |
| 6137 | -s "Async sign callback: using key slot " \ |
| 6138 | -U "Async sign callback: using key slot " \ |
| 6139 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6140 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6141 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6142 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6143 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6144 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6145 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6146 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6147 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6148 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6149 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6150 | "$P_CLI force_version=tls1_1" \ |
| 6151 | 0 \ |
| 6152 | -s "Async sign callback: using key slot " \ |
| 6153 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6154 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | b2c6383 | 2019-06-17 08:35:16 +0100 | [diff] [blame] | 6156 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6157 | run_test "SSL async private: sign, SNI" \ |
| 6158 | "$P_SRV debug_level=3 \ |
| 6159 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6160 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6161 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6162 | "$P_CLI server_name=polarssl.example" \ |
| 6163 | 0 \ |
| 6164 | -s "Async sign callback: using key slot " \ |
| 6165 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6166 | -s "parse ServerName extension" \ |
| 6167 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6168 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6169 | |
| 6170 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6171 | run_test "SSL async private: decrypt, delay=0" \ |
| 6172 | "$P_SRV \ |
| 6173 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6174 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6175 | 0 \ |
| 6176 | -s "Async decrypt callback: using key slot " \ |
| 6177 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6178 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6179 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6180 | run_test "SSL async private: decrypt, delay=1" \ |
| 6181 | "$P_SRV \ |
| 6182 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6183 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6184 | 0 \ |
| 6185 | -s "Async decrypt callback: using key slot " \ |
| 6186 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6187 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6188 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6189 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6190 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6191 | "$P_SRV psk=abc123 \ |
| 6192 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6193 | "$P_CLI psk=abc123 \ |
| 6194 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6195 | 0 \ |
| 6196 | -s "Async decrypt callback: using key slot " \ |
| 6197 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6198 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6200 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6201 | "$P_SRV psk=abc123 \ |
| 6202 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6203 | "$P_CLI psk=abc123 \ |
| 6204 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6205 | 0 \ |
| 6206 | -s "Async decrypt callback: using key slot " \ |
| 6207 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6208 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6209 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6210 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6211 | run_test "SSL async private: sign callback not present" \ |
| 6212 | "$P_SRV \ |
| 6213 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6214 | "$P_CLI; [ \$? -eq 1 ] && |
| 6215 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6216 | 0 \ |
| 6217 | -S "Async sign callback" \ |
| 6218 | -s "! mbedtls_ssl_handshake returned" \ |
| 6219 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6220 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6221 | -s "Successful connection" |
| 6222 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6223 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6224 | run_test "SSL async private: decrypt callback not present" \ |
| 6225 | "$P_SRV debug_level=1 \ |
| 6226 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6227 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6228 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6229 | 0 \ |
| 6230 | -S "Async decrypt callback" \ |
| 6231 | -s "! mbedtls_ssl_handshake returned" \ |
| 6232 | -s "got no RSA private key" \ |
| 6233 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6234 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6235 | |
| 6236 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6237 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6238 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6239 | "$P_SRV \ |
| 6240 | async_operations=s async_private_delay1=1 \ |
| 6241 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6242 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6243 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6244 | 0 \ |
| 6245 | -s "Async sign callback: using key slot 0," \ |
| 6246 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6247 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6248 | |
| 6249 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6250 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6251 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6252 | "$P_SRV \ |
| 6253 | async_operations=s async_private_delay2=1 \ |
| 6254 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6255 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6256 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6257 | 0 \ |
| 6258 | -s "Async sign callback: using key slot 0," \ |
| 6259 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6260 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6261 | |
| 6262 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6263 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6264 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6265 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6266 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6267 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6268 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6269 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6270 | 0 \ |
| 6271 | -s "Async sign callback: using key slot 1," \ |
| 6272 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6273 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6274 | |
| 6275 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6277 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6278 | "$P_SRV \ |
| 6279 | async_operations=s async_private_delay1=1 \ |
| 6280 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6281 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6282 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6283 | 0 \ |
| 6284 | -s "Async sign callback: no key matches this certificate." |
| 6285 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6286 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6287 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6288 | "$P_SRV \ |
| 6289 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6290 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6291 | "$P_CLI" \ |
| 6292 | 1 \ |
| 6293 | -s "Async sign callback: injected error" \ |
| 6294 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6295 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6296 | -s "! mbedtls_ssl_handshake returned" |
| 6297 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6298 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6299 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6300 | "$P_SRV \ |
| 6301 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6302 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6303 | "$P_CLI" \ |
| 6304 | 1 \ |
| 6305 | -s "Async sign callback: using key slot " \ |
| 6306 | -S "Async resume" \ |
| 6307 | -s "Async cancel" |
| 6308 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6309 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6310 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6311 | "$P_SRV \ |
| 6312 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6313 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6314 | "$P_CLI" \ |
| 6315 | 1 \ |
| 6316 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6317 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6318 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6319 | -s "! mbedtls_ssl_handshake returned" |
| 6320 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6321 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6322 | run_test "SSL async private: decrypt, error in start" \ |
| 6323 | "$P_SRV \ |
| 6324 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6325 | async_private_error=1" \ |
| 6326 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6327 | 1 \ |
| 6328 | -s "Async decrypt callback: injected error" \ |
| 6329 | -S "Async resume" \ |
| 6330 | -S "Async cancel" \ |
| 6331 | -s "! mbedtls_ssl_handshake returned" |
| 6332 | |
| 6333 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6334 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6335 | "$P_SRV \ |
| 6336 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6337 | async_private_error=2" \ |
| 6338 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6339 | 1 \ |
| 6340 | -s "Async decrypt callback: using key slot " \ |
| 6341 | -S "Async resume" \ |
| 6342 | -s "Async cancel" |
| 6343 | |
| 6344 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6345 | run_test "SSL async private: decrypt, error in resume" \ |
| 6346 | "$P_SRV \ |
| 6347 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6348 | async_private_error=3" \ |
| 6349 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6350 | 1 \ |
| 6351 | -s "Async decrypt callback: using key slot " \ |
| 6352 | -s "Async resume callback: decrypt done but injected error" \ |
| 6353 | -S "Async cancel" \ |
| 6354 | -s "! mbedtls_ssl_handshake returned" |
| 6355 | |
| 6356 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6357 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6358 | "$P_SRV \ |
| 6359 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6360 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6361 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6362 | 0 \ |
| 6363 | -s "Async cancel" \ |
| 6364 | -s "! mbedtls_ssl_handshake returned" \ |
| 6365 | -s "Async resume" \ |
| 6366 | -s "Successful connection" |
| 6367 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6368 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6369 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6370 | "$P_SRV \ |
| 6371 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6372 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6373 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6374 | 0 \ |
| 6375 | -s "! mbedtls_ssl_handshake returned" \ |
| 6376 | -s "Async resume" \ |
| 6377 | -s "Successful connection" |
| 6378 | |
| 6379 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6380 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6381 | 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] | 6382 | "$P_SRV \ |
| 6383 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6384 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6385 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6386 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6387 | [ \$? -eq 1 ] && |
| 6388 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6389 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6390 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6391 | -S "Async resume" \ |
| 6392 | -s "Async cancel" \ |
| 6393 | -s "! mbedtls_ssl_handshake returned" \ |
| 6394 | -s "Async sign callback: no key matches this certificate." \ |
| 6395 | -s "Successful connection" |
| 6396 | |
| 6397 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6398 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6399 | 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] | 6400 | "$P_SRV \ |
| 6401 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6402 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6403 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6404 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6405 | [ \$? -eq 1 ] && |
| 6406 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6407 | 0 \ |
| 6408 | -s "Async resume" \ |
| 6409 | -s "! mbedtls_ssl_handshake returned" \ |
| 6410 | -s "Async sign callback: no key matches this certificate." \ |
| 6411 | -s "Successful connection" |
| 6412 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6414 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6415 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6416 | "$P_SRV \ |
| 6417 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6418 | exchanges=2 renegotiation=1" \ |
| 6419 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6420 | 0 \ |
| 6421 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6422 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6423 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6426 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 6427 | "$P_SRV \ |
| 6428 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6429 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6430 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6431 | 0 \ |
| 6432 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6433 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6434 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6435 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6436 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6437 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 6438 | "$P_SRV \ |
| 6439 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6440 | exchanges=2 renegotiation=1" \ |
| 6441 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6442 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6443 | 0 \ |
| 6444 | -s "Async decrypt callback: using key slot " \ |
| 6445 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6446 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6449 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 6450 | "$P_SRV \ |
| 6451 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6452 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6453 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6454 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6455 | 0 \ |
| 6456 | -s "Async decrypt callback: using key slot " \ |
| 6457 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6458 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6459 | # Tests for ECC extensions (rfc 4492) |
| 6460 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6461 | requires_config_enabled MBEDTLS_AES_C |
| 6462 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6463 | requires_config_enabled MBEDTLS_SHA256_C |
| 6464 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6465 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6466 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6467 | "$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] | 6468 | 0 \ |
| 6469 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6470 | -C "client hello, adding supported_point_formats extension" \ |
| 6471 | -S "found supported elliptic curves extension" \ |
| 6472 | -S "found supported point formats extension" |
| 6473 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6474 | requires_config_enabled MBEDTLS_AES_C |
| 6475 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6476 | requires_config_enabled MBEDTLS_SHA256_C |
| 6477 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6478 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6479 | "$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] | 6480 | "$P_CLI debug_level=3" \ |
| 6481 | 0 \ |
| 6482 | -C "found supported_point_formats extension" \ |
| 6483 | -S "server hello, supported_point_formats extension" |
| 6484 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6485 | requires_config_enabled MBEDTLS_AES_C |
| 6486 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6487 | requires_config_enabled MBEDTLS_SHA256_C |
| 6488 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6489 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6490 | "$P_SRV debug_level=3" \ |
| 6491 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6492 | 0 \ |
| 6493 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6494 | -c "client hello, adding supported_point_formats extension" \ |
| 6495 | -s "found supported elliptic curves extension" \ |
| 6496 | -s "found supported point formats extension" |
| 6497 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6498 | requires_config_enabled MBEDTLS_AES_C |
| 6499 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6500 | requires_config_enabled MBEDTLS_SHA256_C |
| 6501 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6502 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6503 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6504 | "$P_CLI debug_level=3" \ |
| 6505 | 0 \ |
| 6506 | -c "found supported_point_formats extension" \ |
| 6507 | -s "server hello, supported_point_formats extension" |
| 6508 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6509 | # Tests for DTLS HelloVerifyRequest |
| 6510 | |
| 6511 | run_test "DTLS cookie: enabled" \ |
| 6512 | "$P_SRV dtls=1 debug_level=2" \ |
| 6513 | "$P_CLI dtls=1 debug_level=2" \ |
| 6514 | 0 \ |
| 6515 | -s "cookie verification failed" \ |
| 6516 | -s "cookie verification passed" \ |
| 6517 | -S "cookie verification skipped" \ |
| 6518 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6519 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6520 | -S "SSL - The requested feature is not available" |
| 6521 | |
| 6522 | run_test "DTLS cookie: disabled" \ |
| 6523 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6524 | "$P_CLI dtls=1 debug_level=2" \ |
| 6525 | 0 \ |
| 6526 | -S "cookie verification failed" \ |
| 6527 | -S "cookie verification passed" \ |
| 6528 | -s "cookie verification skipped" \ |
| 6529 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6530 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6531 | -S "SSL - The requested feature is not available" |
| 6532 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6533 | run_test "DTLS cookie: default (failing)" \ |
| 6534 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6535 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6536 | 1 \ |
| 6537 | -s "cookie verification failed" \ |
| 6538 | -S "cookie verification passed" \ |
| 6539 | -S "cookie verification skipped" \ |
| 6540 | -C "received hello verify request" \ |
| 6541 | -S "hello verification requested" \ |
| 6542 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6543 | |
| 6544 | requires_ipv6 |
| 6545 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6546 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6547 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6548 | 0 \ |
| 6549 | -s "cookie verification failed" \ |
| 6550 | -s "cookie verification passed" \ |
| 6551 | -S "cookie verification skipped" \ |
| 6552 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6553 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6554 | -S "SSL - The requested feature is not available" |
| 6555 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6556 | run_test "DTLS cookie: enabled, nbio" \ |
| 6557 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6558 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6559 | 0 \ |
| 6560 | -s "cookie verification failed" \ |
| 6561 | -s "cookie verification passed" \ |
| 6562 | -S "cookie verification skipped" \ |
| 6563 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6564 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6565 | -S "SSL - The requested feature is not available" |
| 6566 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6567 | # Tests for client reconnecting from the same port with DTLS |
| 6568 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6569 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6570 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6571 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6572 | "$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] | 6573 | 0 \ |
| 6574 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6575 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6576 | -S "Client initiated reconnection from same port" |
| 6577 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6578 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6579 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6580 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6581 | "$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] | 6582 | 0 \ |
| 6583 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6584 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6585 | -s "Client initiated reconnection from same port" |
| 6586 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6587 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6588 | 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] | 6589 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6590 | "$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] | 6591 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6592 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6593 | -s "Client initiated reconnection from same port" |
| 6594 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6595 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6596 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6597 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6598 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6599 | 0 \ |
| 6600 | -S "The operation timed out" \ |
| 6601 | -s "Client initiated reconnection from same port" |
| 6602 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6603 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6604 | "$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] | 6605 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6606 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6607 | -s "The operation timed out" \ |
| 6608 | -S "Client initiated reconnection from same port" |
| 6609 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6610 | # Tests for various cases of client authentication with DTLS |
| 6611 | # (focused on handshake flows and message parsing) |
| 6612 | |
| 6613 | run_test "DTLS client auth: required" \ |
| 6614 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6615 | "$P_CLI dtls=1" \ |
| 6616 | 0 \ |
| 6617 | -s "Verifying peer X.509 certificate... ok" |
| 6618 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6619 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6620 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6621 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6622 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6623 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6624 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6625 | |
Hanno Becker | 4a156fc | 2019-06-14 17:07:06 +0100 | [diff] [blame] | 6626 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6627 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6628 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6629 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6630 | 0 \ |
| 6631 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6632 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6633 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6634 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6635 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6636 | "$P_CLI dtls=1 psk=abc124" \ |
| 6637 | 1 \ |
| 6638 | -s "SSL - Verification of the message MAC failed" \ |
| 6639 | -c "SSL - A fatal alert message was received from our peer" |
| 6640 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6641 | # Tests for receiving fragmented handshake messages with DTLS |
| 6642 | |
| 6643 | requires_gnutls |
| 6644 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6645 | "$G_SRV -u --mtu 2048 -a" \ |
| 6646 | "$P_CLI dtls=1 debug_level=2" \ |
| 6647 | 0 \ |
| 6648 | -C "found fragmented DTLS handshake message" \ |
| 6649 | -C "error" |
| 6650 | |
| 6651 | requires_gnutls |
| 6652 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6653 | "$G_SRV -u --mtu 512" \ |
| 6654 | "$P_CLI dtls=1 debug_level=2" \ |
| 6655 | 0 \ |
| 6656 | -c "found fragmented DTLS handshake message" \ |
| 6657 | -C "error" |
| 6658 | |
| 6659 | requires_gnutls |
| 6660 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6661 | "$G_SRV -u --mtu 128" \ |
| 6662 | "$P_CLI dtls=1 debug_level=2" \ |
| 6663 | 0 \ |
| 6664 | -c "found fragmented DTLS handshake message" \ |
| 6665 | -C "error" |
| 6666 | |
| 6667 | requires_gnutls |
| 6668 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6669 | "$G_SRV -u --mtu 128" \ |
| 6670 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6671 | 0 \ |
| 6672 | -c "found fragmented DTLS handshake message" \ |
| 6673 | -C "error" |
| 6674 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6675 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6677 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6678 | "$G_SRV -u --mtu 256" \ |
| 6679 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6680 | 0 \ |
| 6681 | -c "found fragmented DTLS handshake message" \ |
| 6682 | -c "client hello, adding renegotiation extension" \ |
| 6683 | -c "found renegotiation extension" \ |
| 6684 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6685 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6686 | -C "error" \ |
| 6687 | -s "Extra-header:" |
| 6688 | |
| 6689 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6690 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6691 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6692 | "$G_SRV -u --mtu 256" \ |
| 6693 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6694 | 0 \ |
| 6695 | -c "found fragmented DTLS handshake message" \ |
| 6696 | -c "client hello, adding renegotiation extension" \ |
| 6697 | -c "found renegotiation extension" \ |
| 6698 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6699 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6700 | -C "error" \ |
| 6701 | -s "Extra-header:" |
| 6702 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6703 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6704 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6705 | "$P_CLI dtls=1 debug_level=2" \ |
| 6706 | 0 \ |
| 6707 | -C "found fragmented DTLS handshake message" \ |
| 6708 | -C "error" |
| 6709 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6710 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6711 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6712 | "$P_CLI dtls=1 debug_level=2" \ |
| 6713 | 0 \ |
| 6714 | -c "found fragmented DTLS handshake message" \ |
| 6715 | -C "error" |
| 6716 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6717 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6718 | "$O_SRV -dtls1 -mtu 256" \ |
| 6719 | "$P_CLI dtls=1 debug_level=2" \ |
| 6720 | 0 \ |
| 6721 | -c "found fragmented DTLS handshake message" \ |
| 6722 | -C "error" |
| 6723 | |
| 6724 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6725 | "$O_SRV -dtls1 -mtu 256" \ |
| 6726 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6727 | 0 \ |
| 6728 | -c "found fragmented DTLS handshake message" \ |
| 6729 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6730 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6731 | # Tests for sending fragmented handshake messages with DTLS |
| 6732 | # |
| 6733 | # Use client auth when we need the client to send large messages, |
| 6734 | # and use large cert chains on both sides too (the long chains we have all use |
| 6735 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6736 | # Sizes reached (UDP payload): |
| 6737 | # - 2037B for server certificate |
| 6738 | # - 1542B for client certificate |
| 6739 | # - 1013B for newsessionticket |
| 6740 | # - all others below 512B |
| 6741 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6742 | |
| 6743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6744 | requires_config_enabled MBEDTLS_RSA_C |
| 6745 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6746 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6747 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6748 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6749 | crt_file=data_files/server7_int-ca.crt \ |
| 6750 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6751 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6752 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6753 | "$P_CLI dtls=1 debug_level=2 \ |
| 6754 | crt_file=data_files/server8_int-ca2.crt \ |
| 6755 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6756 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6757 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6758 | 0 \ |
| 6759 | -S "found fragmented DTLS handshake message" \ |
| 6760 | -C "found fragmented DTLS handshake message" \ |
| 6761 | -C "error" |
| 6762 | |
| 6763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6764 | requires_config_enabled MBEDTLS_RSA_C |
| 6765 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6766 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6767 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6768 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6769 | crt_file=data_files/server7_int-ca.crt \ |
| 6770 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6771 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6772 | max_frag_len=1024" \ |
| 6773 | "$P_CLI dtls=1 debug_level=2 \ |
| 6774 | crt_file=data_files/server8_int-ca2.crt \ |
| 6775 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6776 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6777 | max_frag_len=2048" \ |
| 6778 | 0 \ |
| 6779 | -S "found fragmented DTLS handshake message" \ |
| 6780 | -c "found fragmented DTLS handshake message" \ |
| 6781 | -C "error" |
| 6782 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6783 | # With the MFL extension, the server has no way of forcing |
| 6784 | # the client to not exceed a certain MTU; hence, the following |
| 6785 | # test can't be replicated with an MTU proxy such as the one |
| 6786 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6787 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6788 | requires_config_enabled MBEDTLS_RSA_C |
| 6789 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6790 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6791 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6792 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6793 | crt_file=data_files/server7_int-ca.crt \ |
| 6794 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6795 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6796 | max_frag_len=512" \ |
| 6797 | "$P_CLI dtls=1 debug_level=2 \ |
| 6798 | crt_file=data_files/server8_int-ca2.crt \ |
| 6799 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6800 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6801 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6802 | 0 \ |
| 6803 | -S "found fragmented DTLS handshake message" \ |
| 6804 | -c "found fragmented DTLS handshake message" \ |
| 6805 | -C "error" |
| 6806 | |
| 6807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6808 | requires_config_enabled MBEDTLS_RSA_C |
| 6809 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6810 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6811 | 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] | 6812 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6813 | crt_file=data_files/server7_int-ca.crt \ |
| 6814 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6815 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6816 | max_frag_len=2048" \ |
| 6817 | "$P_CLI dtls=1 debug_level=2 \ |
| 6818 | crt_file=data_files/server8_int-ca2.crt \ |
| 6819 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6820 | hs_timeout=2500-60000 \ |
| 6821 | max_frag_len=1024" \ |
| 6822 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6823 | -S "found fragmented DTLS handshake message" \ |
| 6824 | -c "found fragmented DTLS handshake message" \ |
| 6825 | -C "error" |
| 6826 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6827 | # While not required by the standard defining the MFL extension |
| 6828 | # (according to which it only applies to records, not to datagrams), |
| 6829 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6830 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6831 | # to the peer. |
| 6832 | # The next test checks that no datagrams significantly larger than the |
| 6833 | # negotiated MFL are sent. |
| 6834 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6835 | requires_config_enabled MBEDTLS_RSA_C |
| 6836 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6837 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6838 | 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] | 6839 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6840 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6841 | crt_file=data_files/server7_int-ca.crt \ |
| 6842 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6844 | max_frag_len=2048" \ |
| 6845 | "$P_CLI dtls=1 debug_level=2 \ |
| 6846 | crt_file=data_files/server8_int-ca2.crt \ |
| 6847 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6848 | hs_timeout=2500-60000 \ |
| 6849 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6850 | 0 \ |
| 6851 | -S "found fragmented DTLS handshake message" \ |
| 6852 | -c "found fragmented DTLS handshake message" \ |
| 6853 | -C "error" |
| 6854 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6855 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6856 | requires_config_enabled MBEDTLS_RSA_C |
| 6857 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6858 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6859 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6860 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6861 | crt_file=data_files/server7_int-ca.crt \ |
| 6862 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6863 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6864 | max_frag_len=2048" \ |
| 6865 | "$P_CLI dtls=1 debug_level=2 \ |
| 6866 | crt_file=data_files/server8_int-ca2.crt \ |
| 6867 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6868 | hs_timeout=2500-60000 \ |
| 6869 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6870 | 0 \ |
| 6871 | -s "found fragmented DTLS handshake message" \ |
| 6872 | -c "found fragmented DTLS handshake message" \ |
| 6873 | -C "error" |
| 6874 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6875 | # While not required by the standard defining the MFL extension |
| 6876 | # (according to which it only applies to records, not to datagrams), |
| 6877 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6878 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6879 | # to the peer. |
| 6880 | # The next test checks that no datagrams significantly larger than the |
| 6881 | # negotiated MFL are sent. |
| 6882 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6883 | requires_config_enabled MBEDTLS_RSA_C |
| 6884 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6885 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6886 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6887 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6888 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6889 | crt_file=data_files/server7_int-ca.crt \ |
| 6890 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6891 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6892 | max_frag_len=2048" \ |
| 6893 | "$P_CLI dtls=1 debug_level=2 \ |
| 6894 | crt_file=data_files/server8_int-ca2.crt \ |
| 6895 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6896 | hs_timeout=2500-60000 \ |
| 6897 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6898 | 0 \ |
| 6899 | -s "found fragmented DTLS handshake message" \ |
| 6900 | -c "found fragmented DTLS handshake message" \ |
| 6901 | -C "error" |
| 6902 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6903 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6904 | requires_config_enabled MBEDTLS_RSA_C |
| 6905 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6906 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6907 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6908 | crt_file=data_files/server7_int-ca.crt \ |
| 6909 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6910 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6911 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6912 | "$P_CLI dtls=1 debug_level=2 \ |
| 6913 | crt_file=data_files/server8_int-ca2.crt \ |
| 6914 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6915 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6916 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6917 | 0 \ |
| 6918 | -S "found fragmented DTLS handshake message" \ |
| 6919 | -C "found fragmented DTLS handshake message" \ |
| 6920 | -C "error" |
| 6921 | |
| 6922 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6923 | requires_config_enabled MBEDTLS_RSA_C |
| 6924 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6925 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6926 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6927 | crt_file=data_files/server7_int-ca.crt \ |
| 6928 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6929 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6930 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6931 | "$P_CLI dtls=1 debug_level=2 \ |
| 6932 | crt_file=data_files/server8_int-ca2.crt \ |
| 6933 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6934 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6935 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6936 | 0 \ |
| 6937 | -s "found fragmented DTLS handshake message" \ |
| 6938 | -C "found fragmented DTLS handshake message" \ |
| 6939 | -C "error" |
| 6940 | |
| 6941 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6942 | requires_config_enabled MBEDTLS_RSA_C |
| 6943 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6944 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6945 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6946 | crt_file=data_files/server7_int-ca.crt \ |
| 6947 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6948 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6949 | mtu=512" \ |
| 6950 | "$P_CLI dtls=1 debug_level=2 \ |
| 6951 | crt_file=data_files/server8_int-ca2.crt \ |
| 6952 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6953 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6954 | mtu=2048" \ |
| 6955 | 0 \ |
| 6956 | -S "found fragmented DTLS handshake message" \ |
| 6957 | -c "found fragmented DTLS handshake message" \ |
| 6958 | -C "error" |
| 6959 | |
| 6960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6961 | requires_config_enabled MBEDTLS_RSA_C |
| 6962 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6963 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6964 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6965 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6966 | crt_file=data_files/server7_int-ca.crt \ |
| 6967 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6968 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6969 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6970 | "$P_CLI dtls=1 debug_level=2 \ |
| 6971 | crt_file=data_files/server8_int-ca2.crt \ |
| 6972 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6973 | hs_timeout=2500-60000 \ |
| 6974 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6975 | 0 \ |
| 6976 | -s "found fragmented DTLS handshake message" \ |
| 6977 | -c "found fragmented DTLS handshake message" \ |
| 6978 | -C "error" |
| 6979 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6980 | # 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] | 6981 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6982 | requires_config_enabled MBEDTLS_RSA_C |
| 6983 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6984 | requires_config_enabled MBEDTLS_SHA256_C |
| 6985 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6986 | requires_config_enabled MBEDTLS_AES_C |
| 6987 | requires_config_enabled MBEDTLS_GCM_C |
| 6988 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6989 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6990 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6991 | crt_file=data_files/server7_int-ca.crt \ |
| 6992 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6993 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6994 | mtu=512" \ |
| 6995 | "$P_CLI dtls=1 debug_level=2 \ |
| 6996 | crt_file=data_files/server8_int-ca2.crt \ |
| 6997 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6998 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6999 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7000 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7001 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7002 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7003 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7004 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7005 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7006 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7007 | # 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] | 7008 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7009 | # retransmissions, but in some cases (like both the server and client using |
| 7010 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7011 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7012 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7014 | requires_config_enabled MBEDTLS_RSA_C |
| 7015 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7017 | requires_config_enabled MBEDTLS_AES_C |
| 7018 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7019 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7020 | -p "$P_PXY mtu=508" \ |
| 7021 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7022 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7023 | key_file=data_files/server7.key \ |
| 7024 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7025 | "$P_CLI dtls=1 debug_level=2 \ |
| 7026 | crt_file=data_files/server8_int-ca2.crt \ |
| 7027 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7028 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7029 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7030 | 0 \ |
| 7031 | -s "found fragmented DTLS handshake message" \ |
| 7032 | -c "found fragmented DTLS handshake message" \ |
| 7033 | -C "error" |
| 7034 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7035 | # 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] | 7036 | only_with_valgrind |
| 7037 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7038 | requires_config_enabled MBEDTLS_RSA_C |
| 7039 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7041 | requires_config_enabled MBEDTLS_AES_C |
| 7042 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7043 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7044 | -p "$P_PXY mtu=508" \ |
| 7045 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7046 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7047 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7048 | hs_timeout=250-10000" \ |
| 7049 | "$P_CLI dtls=1 debug_level=2 \ |
| 7050 | crt_file=data_files/server8_int-ca2.crt \ |
| 7051 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7052 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7053 | hs_timeout=250-10000" \ |
| 7054 | 0 \ |
| 7055 | -s "found fragmented DTLS handshake message" \ |
| 7056 | -c "found fragmented DTLS handshake message" \ |
| 7057 | -C "error" |
| 7058 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7059 | # 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] | 7060 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7061 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7062 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7063 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7064 | requires_config_enabled MBEDTLS_RSA_C |
| 7065 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7066 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7067 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7068 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7069 | crt_file=data_files/server7_int-ca.crt \ |
| 7070 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7071 | hs_timeout=10000-60000 \ |
| 7072 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7073 | "$P_CLI dtls=1 debug_level=2 \ |
| 7074 | crt_file=data_files/server8_int-ca2.crt \ |
| 7075 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7076 | hs_timeout=10000-60000 \ |
| 7077 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7078 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7079 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7080 | -s "found fragmented DTLS handshake message" \ |
| 7081 | -c "found fragmented DTLS handshake message" \ |
| 7082 | -C "error" |
| 7083 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7084 | # 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] | 7085 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7086 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7087 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7088 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7089 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7090 | requires_config_enabled MBEDTLS_RSA_C |
| 7091 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7092 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7093 | requires_config_enabled MBEDTLS_AES_C |
| 7094 | requires_config_enabled MBEDTLS_GCM_C |
| 7095 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7096 | -p "$P_PXY mtu=512" \ |
| 7097 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7098 | crt_file=data_files/server7_int-ca.crt \ |
| 7099 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7100 | hs_timeout=10000-60000 \ |
| 7101 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7102 | "$P_CLI dtls=1 debug_level=2 \ |
| 7103 | crt_file=data_files/server8_int-ca2.crt \ |
| 7104 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7105 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7106 | hs_timeout=10000-60000 \ |
| 7107 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7108 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7109 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7110 | -s "found fragmented DTLS handshake message" \ |
| 7111 | -c "found fragmented DTLS handshake message" \ |
| 7112 | -C "error" |
| 7113 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7114 | not_with_valgrind # spurious autoreduction due to timeout |
| 7115 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7116 | requires_config_enabled MBEDTLS_RSA_C |
| 7117 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7118 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7119 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7120 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7121 | crt_file=data_files/server7_int-ca.crt \ |
| 7122 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7123 | hs_timeout=10000-60000 \ |
| 7124 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7125 | "$P_CLI dtls=1 debug_level=2 \ |
| 7126 | crt_file=data_files/server8_int-ca2.crt \ |
| 7127 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7128 | hs_timeout=10000-60000 \ |
| 7129 | mtu=1024 nbio=2" \ |
| 7130 | 0 \ |
| 7131 | -S "autoreduction" \ |
| 7132 | -s "found fragmented DTLS handshake message" \ |
| 7133 | -c "found fragmented DTLS handshake message" \ |
| 7134 | -C "error" |
| 7135 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7136 | # 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] | 7137 | not_with_valgrind # spurious autoreduction due to timeout |
| 7138 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7139 | requires_config_enabled MBEDTLS_RSA_C |
| 7140 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7141 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7142 | requires_config_enabled MBEDTLS_AES_C |
| 7143 | requires_config_enabled MBEDTLS_GCM_C |
| 7144 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7145 | -p "$P_PXY mtu=512" \ |
| 7146 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7147 | crt_file=data_files/server7_int-ca.crt \ |
| 7148 | key_file=data_files/server7.key \ |
| 7149 | hs_timeout=10000-60000 \ |
| 7150 | mtu=512 nbio=2" \ |
| 7151 | "$P_CLI dtls=1 debug_level=2 \ |
| 7152 | crt_file=data_files/server8_int-ca2.crt \ |
| 7153 | key_file=data_files/server8.key \ |
| 7154 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7155 | hs_timeout=10000-60000 \ |
| 7156 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7157 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7158 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7159 | -s "found fragmented DTLS handshake message" \ |
| 7160 | -c "found fragmented DTLS handshake message" \ |
| 7161 | -C "error" |
| 7162 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7163 | # 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] | 7164 | # This ensures things still work after session_reset(). |
| 7165 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7166 | # Since we don't support reading fragmented ClientHello yet, |
| 7167 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7168 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7169 | # An autoreduction on the client-side might happen if the server is |
| 7170 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7171 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7172 | # resumed listening, which would result in a spurious autoreduction. |
| 7173 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7175 | requires_config_enabled MBEDTLS_RSA_C |
| 7176 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7177 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7178 | requires_config_enabled MBEDTLS_AES_C |
| 7179 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7180 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7181 | -p "$P_PXY mtu=1450" \ |
| 7182 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7183 | crt_file=data_files/server7_int-ca.crt \ |
| 7184 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7185 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7186 | mtu=1450" \ |
| 7187 | "$P_CLI dtls=1 debug_level=2 \ |
| 7188 | crt_file=data_files/server8_int-ca2.crt \ |
| 7189 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7190 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7191 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7192 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7193 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7194 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7195 | -s "found fragmented DTLS handshake message" \ |
| 7196 | -c "found fragmented DTLS handshake message" \ |
| 7197 | -C "error" |
| 7198 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7199 | # An autoreduction on the client-side might happen if the server is |
| 7200 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7201 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7203 | requires_config_enabled MBEDTLS_RSA_C |
| 7204 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7205 | requires_config_enabled MBEDTLS_SHA256_C |
| 7206 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7207 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7208 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7209 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7210 | -p "$P_PXY mtu=512" \ |
| 7211 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7212 | crt_file=data_files/server7_int-ca.crt \ |
| 7213 | key_file=data_files/server7.key \ |
| 7214 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7215 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7216 | mtu=512" \ |
| 7217 | "$P_CLI dtls=1 debug_level=2 \ |
| 7218 | crt_file=data_files/server8_int-ca2.crt \ |
| 7219 | key_file=data_files/server8.key \ |
| 7220 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7221 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7222 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7223 | mtu=512" \ |
| 7224 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7225 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7226 | -s "found fragmented DTLS handshake message" \ |
| 7227 | -c "found fragmented DTLS handshake message" \ |
| 7228 | -C "error" |
| 7229 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7230 | # An autoreduction on the client-side might happen if the server is |
| 7231 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7232 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7233 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7234 | requires_config_enabled MBEDTLS_RSA_C |
| 7235 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7236 | requires_config_enabled MBEDTLS_SHA256_C |
| 7237 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7238 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7239 | requires_config_enabled MBEDTLS_AES_C |
| 7240 | requires_config_enabled MBEDTLS_GCM_C |
| 7241 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7242 | -p "$P_PXY mtu=512" \ |
| 7243 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7244 | crt_file=data_files/server7_int-ca.crt \ |
| 7245 | key_file=data_files/server7.key \ |
| 7246 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7247 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7248 | mtu=512" \ |
| 7249 | "$P_CLI dtls=1 debug_level=2 \ |
| 7250 | crt_file=data_files/server8_int-ca2.crt \ |
| 7251 | key_file=data_files/server8.key \ |
| 7252 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7253 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7254 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7255 | mtu=512" \ |
| 7256 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7257 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7258 | -s "found fragmented DTLS handshake message" \ |
| 7259 | -c "found fragmented DTLS handshake message" \ |
| 7260 | -C "error" |
| 7261 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7262 | # An autoreduction on the client-side might happen if the server is |
| 7263 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7264 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7265 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7266 | requires_config_enabled MBEDTLS_RSA_C |
| 7267 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7268 | requires_config_enabled MBEDTLS_SHA256_C |
| 7269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7271 | requires_config_enabled MBEDTLS_AES_C |
| 7272 | requires_config_enabled MBEDTLS_CCM_C |
| 7273 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7274 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7275 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7276 | crt_file=data_files/server7_int-ca.crt \ |
| 7277 | key_file=data_files/server7.key \ |
| 7278 | exchanges=2 renegotiation=1 \ |
| 7279 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7280 | hs_timeout=10000-60000 \ |
| 7281 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7282 | "$P_CLI dtls=1 debug_level=2 \ |
| 7283 | crt_file=data_files/server8_int-ca2.crt \ |
| 7284 | key_file=data_files/server8.key \ |
| 7285 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7286 | hs_timeout=10000-60000 \ |
| 7287 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7288 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7289 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7290 | -s "found fragmented DTLS handshake message" \ |
| 7291 | -c "found fragmented DTLS handshake message" \ |
| 7292 | -C "error" |
| 7293 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7294 | # An autoreduction on the client-side might happen if the server is |
| 7295 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7296 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7297 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7298 | requires_config_enabled MBEDTLS_RSA_C |
| 7299 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7300 | requires_config_enabled MBEDTLS_SHA256_C |
| 7301 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7302 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7303 | requires_config_enabled MBEDTLS_AES_C |
| 7304 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7305 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7306 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7307 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7308 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7309 | crt_file=data_files/server7_int-ca.crt \ |
| 7310 | key_file=data_files/server7.key \ |
| 7311 | exchanges=2 renegotiation=1 \ |
| 7312 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7313 | hs_timeout=10000-60000 \ |
| 7314 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7315 | "$P_CLI dtls=1 debug_level=2 \ |
| 7316 | crt_file=data_files/server8_int-ca2.crt \ |
| 7317 | key_file=data_files/server8.key \ |
| 7318 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7319 | hs_timeout=10000-60000 \ |
| 7320 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7321 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7322 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7323 | -s "found fragmented DTLS handshake message" \ |
| 7324 | -c "found fragmented DTLS handshake message" \ |
| 7325 | -C "error" |
| 7326 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7327 | # An autoreduction on the client-side might happen if the server is |
| 7328 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7329 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7330 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7331 | requires_config_enabled MBEDTLS_RSA_C |
| 7332 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7333 | requires_config_enabled MBEDTLS_SHA256_C |
| 7334 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7335 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7336 | requires_config_enabled MBEDTLS_AES_C |
| 7337 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7338 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7339 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7340 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7341 | crt_file=data_files/server7_int-ca.crt \ |
| 7342 | key_file=data_files/server7.key \ |
| 7343 | exchanges=2 renegotiation=1 \ |
| 7344 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7345 | hs_timeout=10000-60000 \ |
| 7346 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7347 | "$P_CLI dtls=1 debug_level=2 \ |
| 7348 | crt_file=data_files/server8_int-ca2.crt \ |
| 7349 | key_file=data_files/server8.key \ |
| 7350 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7351 | hs_timeout=10000-60000 \ |
| 7352 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7353 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7354 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7355 | -s "found fragmented DTLS handshake message" \ |
| 7356 | -c "found fragmented DTLS handshake message" \ |
| 7357 | -C "error" |
| 7358 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7359 | # 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] | 7360 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7361 | requires_config_enabled MBEDTLS_RSA_C |
| 7362 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7364 | requires_config_enabled MBEDTLS_AES_C |
| 7365 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7366 | client_needs_more_time 2 |
| 7367 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7368 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7369 | "$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] | 7370 | crt_file=data_files/server7_int-ca.crt \ |
| 7371 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7372 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7373 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7374 | crt_file=data_files/server8_int-ca2.crt \ |
| 7375 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7376 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7377 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7378 | 0 \ |
| 7379 | -s "found fragmented DTLS handshake message" \ |
| 7380 | -c "found fragmented DTLS handshake message" \ |
| 7381 | -C "error" |
| 7382 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7383 | # 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] | 7384 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7385 | requires_config_enabled MBEDTLS_RSA_C |
| 7386 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7387 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7388 | requires_config_enabled MBEDTLS_AES_C |
| 7389 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7390 | client_needs_more_time 2 |
| 7391 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7392 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7393 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7394 | crt_file=data_files/server7_int-ca.crt \ |
| 7395 | key_file=data_files/server7.key \ |
| 7396 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7397 | "$P_CLI dtls=1 debug_level=2 \ |
| 7398 | crt_file=data_files/server8_int-ca2.crt \ |
| 7399 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7400 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7401 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7402 | 0 \ |
| 7403 | -s "found fragmented DTLS handshake message" \ |
| 7404 | -c "found fragmented DTLS handshake message" \ |
| 7405 | -C "error" |
| 7406 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7407 | # interop tests for DTLS fragmentating with reliable connection |
| 7408 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7409 | # here and below we just want to test that the we fragment in a way that |
| 7410 | # pleases other implementations, so we don't need the peer to fragment |
| 7411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7412 | requires_config_enabled MBEDTLS_RSA_C |
| 7413 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7415 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7416 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7417 | "$G_SRV -u" \ |
| 7418 | "$P_CLI dtls=1 debug_level=2 \ |
| 7419 | crt_file=data_files/server8_int-ca2.crt \ |
| 7420 | key_file=data_files/server8.key \ |
| 7421 | mtu=512 force_version=dtls1_2" \ |
| 7422 | 0 \ |
| 7423 | -c "fragmenting handshake message" \ |
| 7424 | -C "error" |
| 7425 | |
| 7426 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7427 | requires_config_enabled MBEDTLS_RSA_C |
| 7428 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7429 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7430 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7431 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7432 | "$G_SRV -u" \ |
| 7433 | "$P_CLI dtls=1 debug_level=2 \ |
| 7434 | crt_file=data_files/server8_int-ca2.crt \ |
| 7435 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7436 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7437 | 0 \ |
| 7438 | -c "fragmenting handshake message" \ |
| 7439 | -C "error" |
| 7440 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7441 | # We use --insecure for the GnuTLS client because it expects |
| 7442 | # the hostname / IP it connects to to be the name used in the |
| 7443 | # certificate obtained from the server. Here, however, it |
| 7444 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7445 | # as the server name in the certificate. This will make the |
| 7446 | # certifiate validation fail, but passing --insecure makes |
| 7447 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7448 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7449 | requires_config_enabled MBEDTLS_RSA_C |
| 7450 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7452 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7453 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7454 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7455 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7456 | crt_file=data_files/server7_int-ca.crt \ |
| 7457 | key_file=data_files/server7.key \ |
| 7458 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7459 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7460 | 0 \ |
| 7461 | -s "fragmenting handshake message" |
| 7462 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7463 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7464 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7465 | requires_config_enabled MBEDTLS_RSA_C |
| 7466 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7468 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7469 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7470 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7471 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7472 | crt_file=data_files/server7_int-ca.crt \ |
| 7473 | key_file=data_files/server7.key \ |
| 7474 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7475 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7476 | 0 \ |
| 7477 | -s "fragmenting handshake message" |
| 7478 | |
| 7479 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7480 | requires_config_enabled MBEDTLS_RSA_C |
| 7481 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7483 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7484 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7485 | "$P_CLI dtls=1 debug_level=2 \ |
| 7486 | crt_file=data_files/server8_int-ca2.crt \ |
| 7487 | key_file=data_files/server8.key \ |
| 7488 | mtu=512 force_version=dtls1_2" \ |
| 7489 | 0 \ |
| 7490 | -c "fragmenting handshake message" \ |
| 7491 | -C "error" |
| 7492 | |
| 7493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7494 | requires_config_enabled MBEDTLS_RSA_C |
| 7495 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7497 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 7498 | "$O_SRV -dtls1 -verify 10" \ |
| 7499 | "$P_CLI dtls=1 debug_level=2 \ |
| 7500 | crt_file=data_files/server8_int-ca2.crt \ |
| 7501 | key_file=data_files/server8.key \ |
| 7502 | mtu=512 force_version=dtls1" \ |
| 7503 | 0 \ |
| 7504 | -c "fragmenting handshake message" \ |
| 7505 | -C "error" |
| 7506 | |
| 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7508 | requires_config_enabled MBEDTLS_RSA_C |
| 7509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7511 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7512 | "$P_SRV dtls=1 debug_level=2 \ |
| 7513 | crt_file=data_files/server7_int-ca.crt \ |
| 7514 | key_file=data_files/server7.key \ |
| 7515 | mtu=512 force_version=dtls1_2" \ |
| 7516 | "$O_CLI -dtls1_2" \ |
| 7517 | 0 \ |
| 7518 | -s "fragmenting handshake message" |
| 7519 | |
| 7520 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7521 | requires_config_enabled MBEDTLS_RSA_C |
| 7522 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7523 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7524 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 7525 | "$P_SRV dtls=1 debug_level=2 \ |
| 7526 | crt_file=data_files/server7_int-ca.crt \ |
| 7527 | key_file=data_files/server7.key \ |
| 7528 | mtu=512 force_version=dtls1" \ |
| 7529 | "$O_CLI -dtls1" \ |
| 7530 | 0 \ |
| 7531 | -s "fragmenting handshake message" |
| 7532 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7533 | # interop tests for DTLS fragmentating with unreliable connection |
| 7534 | # |
| 7535 | # again we just want to test that the we fragment in a way that |
| 7536 | # pleases other implementations, so we don't need the peer to fragment |
| 7537 | requires_gnutls_next |
| 7538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7539 | requires_config_enabled MBEDTLS_RSA_C |
| 7540 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7541 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7542 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7543 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7544 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7545 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7546 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7547 | crt_file=data_files/server8_int-ca2.crt \ |
| 7548 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7549 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7550 | 0 \ |
| 7551 | -c "fragmenting handshake message" \ |
| 7552 | -C "error" |
| 7553 | |
| 7554 | requires_gnutls_next |
| 7555 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7556 | requires_config_enabled MBEDTLS_RSA_C |
| 7557 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7559 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7560 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 7561 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7562 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7563 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7564 | crt_file=data_files/server8_int-ca2.crt \ |
| 7565 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7566 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7567 | 0 \ |
| 7568 | -c "fragmenting handshake message" \ |
| 7569 | -C "error" |
| 7570 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7571 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7573 | requires_config_enabled MBEDTLS_RSA_C |
| 7574 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7575 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7576 | client_needs_more_time 4 |
| 7577 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7578 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7579 | "$P_SRV dtls=1 debug_level=2 \ |
| 7580 | crt_file=data_files/server7_int-ca.crt \ |
| 7581 | key_file=data_files/server7.key \ |
| 7582 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7583 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7584 | 0 \ |
| 7585 | -s "fragmenting handshake message" |
| 7586 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7587 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7588 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7589 | requires_config_enabled MBEDTLS_RSA_C |
| 7590 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7592 | client_needs_more_time 4 |
| 7593 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7594 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7595 | "$P_SRV dtls=1 debug_level=2 \ |
| 7596 | crt_file=data_files/server7_int-ca.crt \ |
| 7597 | key_file=data_files/server7.key \ |
| 7598 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7599 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7600 | 0 \ |
| 7601 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7602 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7603 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7604 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7605 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7606 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7607 | ## (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] | 7608 | skip_next_test |
| 7609 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7610 | requires_config_enabled MBEDTLS_RSA_C |
| 7611 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7613 | client_needs_more_time 4 |
| 7614 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7615 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7616 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7617 | "$P_CLI dtls=1 debug_level=2 \ |
| 7618 | crt_file=data_files/server8_int-ca2.crt \ |
| 7619 | key_file=data_files/server8.key \ |
| 7620 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7621 | 0 \ |
| 7622 | -c "fragmenting handshake message" \ |
| 7623 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7624 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7625 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7627 | requires_config_enabled MBEDTLS_RSA_C |
| 7628 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7630 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7631 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7632 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7633 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7634 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7635 | crt_file=data_files/server8_int-ca2.crt \ |
| 7636 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7637 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7638 | 0 \ |
| 7639 | -c "fragmenting handshake message" \ |
| 7640 | -C "error" |
| 7641 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7642 | skip_next_test |
| 7643 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7644 | requires_config_enabled MBEDTLS_RSA_C |
| 7645 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7646 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7647 | client_needs_more_time 4 |
| 7648 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7649 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7650 | "$P_SRV dtls=1 debug_level=2 \ |
| 7651 | crt_file=data_files/server7_int-ca.crt \ |
| 7652 | key_file=data_files/server7.key \ |
| 7653 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7654 | "$O_CLI -dtls1_2" \ |
| 7655 | 0 \ |
| 7656 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7657 | |
| 7658 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7659 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7660 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7661 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7662 | requires_config_enabled MBEDTLS_RSA_C |
| 7663 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7665 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7666 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7667 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7668 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7669 | crt_file=data_files/server7_int-ca.crt \ |
| 7670 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7671 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7672 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7673 | 0 \ |
| 7674 | -s "fragmenting handshake message" |
| 7675 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7676 | # Tests for specific things with "unreliable" UDP connection |
| 7677 | |
| 7678 | not_with_valgrind # spurious resend due to timeout |
| 7679 | run_test "DTLS proxy: reference" \ |
| 7680 | -p "$P_PXY" \ |
| 7681 | "$P_SRV dtls=1 debug_level=2" \ |
| 7682 | "$P_CLI dtls=1 debug_level=2" \ |
| 7683 | 0 \ |
| 7684 | -C "replayed record" \ |
| 7685 | -S "replayed record" \ |
| 7686 | -C "record from another epoch" \ |
| 7687 | -S "record from another epoch" \ |
| 7688 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7689 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7690 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7691 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7692 | -c "HTTP/1.0 200 OK" |
| 7693 | |
| 7694 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7695 | run_test "DTLS proxy: duplicate every packet" \ |
| 7696 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 7f376f4 | 2019-06-12 16:20:48 +0100 | [diff] [blame] | 7697 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7698 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7699 | 0 \ |
| 7700 | -c "replayed record" \ |
| 7701 | -s "replayed record" \ |
| 7702 | -c "record from another epoch" \ |
| 7703 | -s "record from another epoch" \ |
| 7704 | -S "resend" \ |
| 7705 | -s "Extra-header:" \ |
| 7706 | -c "HTTP/1.0 200 OK" |
| 7707 | |
| 7708 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7709 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7710 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7711 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7712 | 0 \ |
| 7713 | -c "replayed record" \ |
| 7714 | -S "replayed record" \ |
| 7715 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7716 | -s "record from another epoch" \ |
| 7717 | -c "resend" \ |
| 7718 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7719 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7720 | -c "HTTP/1.0 200 OK" |
| 7721 | |
| 7722 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7723 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7724 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7725 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7726 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7727 | -c "next record in same datagram" \ |
| 7728 | -s "next record in same datagram" |
| 7729 | |
| 7730 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7731 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7732 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7733 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7734 | 0 \ |
| 7735 | -c "next record in same datagram" \ |
| 7736 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7737 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7738 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7739 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7740 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7741 | "$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] | 7742 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7743 | -c "discarding invalid record (mac)" \ |
| 7744 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7745 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7746 | -c "HTTP/1.0 200 OK" \ |
| 7747 | -S "too many records with bad MAC" \ |
| 7748 | -S "Verification of the message MAC failed" |
| 7749 | |
| 7750 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7751 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7752 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7753 | "$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] | 7754 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7755 | -C "discarding invalid record (mac)" \ |
| 7756 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7757 | -S "Extra-header:" \ |
| 7758 | -C "HTTP/1.0 200 OK" \ |
| 7759 | -s "too many records with bad MAC" \ |
| 7760 | -s "Verification of the message MAC failed" |
| 7761 | |
| 7762 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7763 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7764 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7765 | "$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] | 7766 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7767 | -c "discarding invalid record (mac)" \ |
| 7768 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7769 | -s "Extra-header:" \ |
| 7770 | -c "HTTP/1.0 200 OK" \ |
| 7771 | -S "too many records with bad MAC" \ |
| 7772 | -S "Verification of the message MAC failed" |
| 7773 | |
| 7774 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7775 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7776 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7777 | "$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] | 7778 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7779 | -c "discarding invalid record (mac)" \ |
| 7780 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7781 | -s "Extra-header:" \ |
| 7782 | -c "HTTP/1.0 200 OK" \ |
| 7783 | -s "too many records with bad MAC" \ |
| 7784 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7785 | |
| 7786 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7787 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7788 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7789 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7790 | 0 \ |
| 7791 | -c "record from another epoch" \ |
| 7792 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7793 | -s "Extra-header:" \ |
| 7794 | -c "HTTP/1.0 200 OK" |
| 7795 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7796 | # Tests for reordering support with DTLS |
| 7797 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7798 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7799 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7800 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7801 | hs_timeout=2500-60000" \ |
| 7802 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7803 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7804 | 0 \ |
| 7805 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7806 | -c "Next handshake message has been buffered - load"\ |
| 7807 | -S "Buffering HS message" \ |
| 7808 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7809 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7810 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7811 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7812 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7813 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7814 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7815 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7816 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7817 | hs_timeout=2500-60000" \ |
| 7818 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7819 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7820 | 0 \ |
| 7821 | -c "Buffering HS message" \ |
| 7822 | -c "found fragmented DTLS handshake message"\ |
| 7823 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7824 | -c "Next handshake message has been buffered - load"\ |
| 7825 | -S "Buffering HS message" \ |
| 7826 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7827 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7828 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7829 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7830 | -S "Remember CCS message" |
| 7831 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7832 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7833 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7834 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7835 | # while keeping the ServerKeyExchange. |
| 7836 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7837 | 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] | 7838 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7839 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7840 | hs_timeout=2500-60000" \ |
| 7841 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7842 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7843 | 0 \ |
| 7844 | -c "Buffering HS message" \ |
| 7845 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7846 | -C "attempt to make space by freeing buffered messages" \ |
| 7847 | -S "Buffering HS message" \ |
| 7848 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7849 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7850 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7851 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7852 | -S "Remember CCS message" |
| 7853 | |
| 7854 | # The size constraints ensure that the delayed certificate message can't |
| 7855 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7856 | # when dropping it first. |
| 7857 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7858 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7859 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7860 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7861 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7862 | hs_timeout=2500-60000" \ |
| 7863 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7864 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7865 | 0 \ |
| 7866 | -c "Buffering HS message" \ |
| 7867 | -c "attempt to make space by freeing buffered future messages" \ |
| 7868 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7869 | -S "Buffering HS message" \ |
| 7870 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7871 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7872 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7873 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7874 | -S "Remember CCS message" |
| 7875 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7876 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7877 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7878 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7879 | hs_timeout=2500-60000" \ |
| 7880 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7881 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7882 | 0 \ |
| 7883 | -C "Buffering HS message" \ |
| 7884 | -C "Next handshake message has been buffered - load"\ |
| 7885 | -s "Buffering HS message" \ |
| 7886 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7887 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7888 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7889 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7890 | -S "Remember CCS message" |
| 7891 | |
| 7892 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7893 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7894 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7895 | hs_timeout=2500-60000" \ |
| 7896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7897 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7898 | 0 \ |
| 7899 | -C "Buffering HS message" \ |
| 7900 | -C "Next handshake message has been buffered - load"\ |
| 7901 | -S "Buffering HS message" \ |
| 7902 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7903 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7904 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7905 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7906 | -S "Remember CCS message" |
| 7907 | |
| 7908 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7909 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7910 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7911 | hs_timeout=2500-60000" \ |
| 7912 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7913 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7914 | 0 \ |
| 7915 | -C "Buffering HS message" \ |
| 7916 | -C "Next handshake message has been buffered - load"\ |
| 7917 | -S "Buffering HS message" \ |
| 7918 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7919 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7920 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7921 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7922 | -s "Remember CCS message" |
| 7923 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7924 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7925 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7926 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7927 | hs_timeout=2500-60000" \ |
| 7928 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7929 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7930 | 0 \ |
| 7931 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7932 | -s "Found buffered record from current epoch - load" \ |
| 7933 | -c "Buffer record from epoch 1" \ |
| 7934 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7935 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7936 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7937 | # from the server are delayed, so that the encrypted Finished message |
| 7938 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7939 | # in afterwards, the encrypted Finished message must be freed in order |
| 7940 | # to make space for the NewSessionTicket to be reassembled. |
| 7941 | # This works only in very particular circumstances: |
| 7942 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7943 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7944 | # the encrypted Finished message. |
| 7945 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7946 | # needs to be fragmented. |
| 7947 | # - All messages sent by the server must be small enough to be either sent |
| 7948 | # without fragmentation or be reassembled within the bounds of |
| 7949 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7950 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | f8c355a | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 7951 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 7952 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7953 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7954 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | f8c355a | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 7955 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7956 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7957 | 0 \ |
| 7958 | -s "Buffer record from epoch 1" \ |
| 7959 | -s "Found buffered record from current epoch - load" \ |
| 7960 | -c "Buffer record from epoch 1" \ |
| 7961 | -C "Found buffered record from current epoch - load" \ |
| 7962 | -c "Enough space available after freeing future epoch record" |
| 7963 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7964 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7965 | |
| 7966 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7967 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7968 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7969 | "$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] | 7970 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7971 | "$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] | 7972 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7973 | 0 \ |
| 7974 | -s "Extra-header:" \ |
| 7975 | -c "HTTP/1.0 200 OK" |
| 7976 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7977 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7978 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7979 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7980 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7981 | "$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] | 7982 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7983 | 0 \ |
| 7984 | -s "Extra-header:" \ |
| 7985 | -c "HTTP/1.0 200 OK" |
| 7986 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7987 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7988 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7989 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7990 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7991 | "$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] | 7992 | 0 \ |
| 7993 | -s "Extra-header:" \ |
| 7994 | -c "HTTP/1.0 200 OK" |
| 7995 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7996 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7997 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7998 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7999 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8000 | "$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] | 8001 | 0 \ |
| 8002 | -s "Extra-header:" \ |
| 8003 | -c "HTTP/1.0 200 OK" |
| 8004 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8005 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8006 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8007 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8008 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8009 | "$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] | 8010 | 0 \ |
| 8011 | -s "Extra-header:" \ |
| 8012 | -c "HTTP/1.0 200 OK" |
| 8013 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8014 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8015 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8016 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8017 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8018 | "$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] | 8019 | 0 \ |
| 8020 | -s "Extra-header:" \ |
| 8021 | -c "HTTP/1.0 200 OK" |
| 8022 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8023 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8024 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8025 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8026 | "$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] | 8027 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8028 | "$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] | 8029 | 0 \ |
| 8030 | -s "Extra-header:" \ |
| 8031 | -c "HTTP/1.0 200 OK" |
| 8032 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8033 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8034 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8035 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8036 | "$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] | 8037 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8038 | "$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] | 8039 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8040 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8041 | 0 \ |
| 8042 | -s "a session has been resumed" \ |
| 8043 | -c "a session has been resumed" \ |
| 8044 | -s "Extra-header:" \ |
| 8045 | -c "HTTP/1.0 200 OK" |
| 8046 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8047 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8048 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8049 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8050 | "$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] | 8051 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8052 | "$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] | 8053 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8054 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8055 | 0 \ |
| 8056 | -s "a session has been resumed" \ |
| 8057 | -c "a session has been resumed" \ |
| 8058 | -s "Extra-header:" \ |
| 8059 | -c "HTTP/1.0 200 OK" |
| 8060 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8061 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8062 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8063 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8064 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8065 | "$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] | 8066 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8067 | "$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] | 8068 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8069 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8070 | 0 \ |
| 8071 | -c "=> renegotiate" \ |
| 8072 | -s "=> renegotiate" \ |
| 8073 | -s "Extra-header:" \ |
| 8074 | -c "HTTP/1.0 200 OK" |
| 8075 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8076 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8077 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8078 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8079 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8080 | "$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] | 8081 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8082 | "$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] | 8083 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8084 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8085 | 0 \ |
| 8086 | -c "=> renegotiate" \ |
| 8087 | -s "=> renegotiate" \ |
| 8088 | -s "Extra-header:" \ |
| 8089 | -c "HTTP/1.0 200 OK" |
| 8090 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8091 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8092 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8093 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8094 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8095 | "$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] | 8096 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8097 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8098 | "$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] | 8099 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8100 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8101 | 0 \ |
| 8102 | -c "=> renegotiate" \ |
| 8103 | -s "=> renegotiate" \ |
| 8104 | -s "Extra-header:" \ |
| 8105 | -c "HTTP/1.0 200 OK" |
| 8106 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8107 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8108 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8109 | 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] | 8110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8111 | "$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] | 8112 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8113 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8114 | "$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] | 8115 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8116 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8117 | 0 \ |
| 8118 | -c "=> renegotiate" \ |
| 8119 | -s "=> renegotiate" \ |
| 8120 | -s "Extra-header:" \ |
| 8121 | -c "HTTP/1.0 200 OK" |
| 8122 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8123 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8124 | ## all versions installed on the CI machines), reported here: |
| 8125 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8126 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8127 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8128 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8129 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8130 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8131 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8132 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8133 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8134 | "$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] | 8135 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8136 | -c "HTTP/1.0 200 OK" |
| 8137 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8138 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8139 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8140 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8141 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8142 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8143 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8144 | "$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] | 8145 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8146 | -c "HTTP/1.0 200 OK" |
| 8147 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8148 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8149 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8150 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8151 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8152 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8153 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8154 | "$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] | 8155 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8156 | -c "HTTP/1.0 200 OK" |
| 8157 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8158 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8159 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8160 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8161 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8162 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8163 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8164 | "$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] | 8165 | 0 \ |
| 8166 | -s "Extra-header:" \ |
| 8167 | -c "Extra-header:" |
| 8168 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8169 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8170 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8171 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8172 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8173 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8174 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8175 | "$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] | 8176 | 0 \ |
| 8177 | -s "Extra-header:" \ |
| 8178 | -c "Extra-header:" |
| 8179 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8180 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8181 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8182 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8183 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8184 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 8185 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8186 | "$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] | 8187 | 0 \ |
| 8188 | -s "Extra-header:" \ |
| 8189 | -c "Extra-header:" |
| 8190 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8191 | # Final report |
| 8192 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8193 | echo "------------------------------------------------------------------------" |
| 8194 | |
| 8195 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8196 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8197 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8198 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8199 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8200 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8201 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8202 | |
| 8203 | exit $FAILS |