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 | |
Jaeden Amero | a258ccd | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 24 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 25 | # where it may output seemingly unlimited length error logs. |
| 26 | ulimit -f 20971520 |
| 27 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 28 | if cd $( dirname $0 ); then :; else |
| 29 | echo "cd $( dirname $0 ) failed" >&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 33 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 34 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 35 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 36 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 37 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 42 | 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] | 43 | 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] | 44 | 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] | 45 | 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] | 46 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 47 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 48 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 49 | |
| 50 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 51 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 52 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 53 | else |
| 54 | O_LEGACY_SRV=false |
| 55 | O_LEGACY_CLI=false |
| 56 | fi |
| 57 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 58 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 59 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 60 | else |
| 61 | G_NEXT_SRV=false |
| 62 | fi |
| 63 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 64 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 65 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 66 | else |
| 67 | G_NEXT_CLI=false |
| 68 | fi |
| 69 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 70 | TESTS=0 |
| 71 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 72 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 73 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 74 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 75 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 76 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 77 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 78 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 79 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 80 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 81 | RUN_TEST_NUMBER='' |
| 82 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 83 | PRESERVE_LOGS=0 |
| 84 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 85 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 86 | # port which is this plus 10000. Each port number may be independently |
| 87 | # overridden by a command line option. |
| 88 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 89 | PXY_PORT=$((SRV_PORT + 10000)) |
| 90 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 91 | print_usage() { |
| 92 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 93 | printf " -h|--help\tPrint this help.\n" |
| 94 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 95 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 96 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 97 | 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] | 98 | 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] | 99 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 100 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 101 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 102 | 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] | 103 | } |
| 104 | |
| 105 | get_options() { |
| 106 | while [ $# -gt 0 ]; do |
| 107 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 108 | -f|--filter) |
| 109 | shift; FILTER=$1 |
| 110 | ;; |
| 111 | -e|--exclude) |
| 112 | shift; EXCLUDE=$1 |
| 113 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | -m|--memcheck) |
| 115 | MEMCHECK=1 |
| 116 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 117 | -n|--number) |
| 118 | shift; RUN_TEST_NUMBER=$1 |
| 119 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 120 | -s|--show-numbers) |
| 121 | SHOW_TEST_NUMBER=1 |
| 122 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 123 | -p|--preserve-logs) |
| 124 | PRESERVE_LOGS=1 |
| 125 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 126 | --port) |
| 127 | shift; SRV_PORT=$1 |
| 128 | ;; |
| 129 | --proxy-port) |
| 130 | shift; PXY_PORT=$1 |
| 131 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 132 | --seed) |
| 133 | shift; SEED="$1" |
| 134 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 135 | -h|--help) |
| 136 | print_usage |
| 137 | exit 0 |
| 138 | ;; |
| 139 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 140 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 141 | print_usage |
| 142 | exit 1 |
| 143 | ;; |
| 144 | esac |
| 145 | shift |
| 146 | done |
| 147 | } |
| 148 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 149 | # Skip next test; use this macro to skip tests which are legitimate |
| 150 | # in theory and expected to be re-introduced at some point, but |
| 151 | # aren't expected to succeed at the moment due to problems outside |
| 152 | # our control (such as bugs in other TLS implementations). |
| 153 | skip_next_test() { |
| 154 | SKIP_NEXT="YES" |
| 155 | } |
| 156 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 157 | # skip next test if the flag is not enabled in config.h |
| 158 | requires_config_enabled() { |
| 159 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 160 | SKIP_NEXT="YES" |
| 161 | fi |
| 162 | } |
| 163 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 164 | # skip next test if the flag is enabled in config.h |
| 165 | requires_config_disabled() { |
| 166 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 167 | SKIP_NEXT="YES" |
| 168 | fi |
| 169 | } |
| 170 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 171 | get_config_value_or_default() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 172 | # This function uses the query_config command line option to query the |
| 173 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 174 | # program. The command will always return a success value if the |
| 175 | # configuration is defined and the value will be printed to stdout. |
| 176 | # |
| 177 | # Note that if the configuration is not defined or is defined to nothing, |
| 178 | # the output of this function will be an empty string. |
| 179 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | requires_config_value_at_least() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 183 | VAL="$( get_config_value_or_default "$1" )" |
| 184 | if [ -z "$VAL" ]; then |
| 185 | # Should never happen |
| 186 | echo "Mbed TLS configuration $1 is not defined" |
| 187 | exit 1 |
| 188 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 189 | SKIP_NEXT="YES" |
| 190 | fi |
| 191 | } |
| 192 | |
| 193 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 194 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 195 | if [ -z "$VAL" ]; then |
| 196 | # Should never happen |
| 197 | echo "Mbed TLS configuration $1 is not defined" |
| 198 | exit 1 |
| 199 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 200 | SKIP_NEXT="YES" |
| 201 | fi |
| 202 | } |
| 203 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 204 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 205 | requires_openssl_with_fallback_scsv() { |
| 206 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 207 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 208 | then |
| 209 | OPENSSL_HAS_FBSCSV="YES" |
| 210 | else |
| 211 | OPENSSL_HAS_FBSCSV="NO" |
| 212 | fi |
| 213 | fi |
| 214 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 215 | SKIP_NEXT="YES" |
| 216 | fi |
| 217 | } |
| 218 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 219 | # skip next test if GnuTLS isn't available |
| 220 | requires_gnutls() { |
| 221 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 222 | 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] | 223 | GNUTLS_AVAILABLE="YES" |
| 224 | else |
| 225 | GNUTLS_AVAILABLE="NO" |
| 226 | fi |
| 227 | fi |
| 228 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 229 | SKIP_NEXT="YES" |
| 230 | fi |
| 231 | } |
| 232 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 233 | # skip next test if GnuTLS-next isn't available |
| 234 | requires_gnutls_next() { |
| 235 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 236 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 237 | GNUTLS_NEXT_AVAILABLE="YES" |
| 238 | else |
| 239 | GNUTLS_NEXT_AVAILABLE="NO" |
| 240 | fi |
| 241 | fi |
| 242 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 243 | SKIP_NEXT="YES" |
| 244 | fi |
| 245 | } |
| 246 | |
| 247 | # skip next test if OpenSSL-legacy isn't available |
| 248 | requires_openssl_legacy() { |
| 249 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 250 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 251 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 252 | else |
| 253 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 254 | fi |
| 255 | fi |
| 256 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 257 | SKIP_NEXT="YES" |
| 258 | fi |
| 259 | } |
| 260 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 261 | # skip next test if IPv6 isn't available on this host |
| 262 | requires_ipv6() { |
| 263 | if [ -z "${HAS_IPV6:-}" ]; then |
| 264 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 265 | SRV_PID=$! |
| 266 | sleep 1 |
| 267 | kill $SRV_PID >/dev/null 2>&1 |
| 268 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 269 | HAS_IPV6="NO" |
| 270 | else |
| 271 | HAS_IPV6="YES" |
| 272 | fi |
| 273 | rm -r $SRV_OUT |
| 274 | fi |
| 275 | |
| 276 | if [ "$HAS_IPV6" = "NO" ]; then |
| 277 | SKIP_NEXT="YES" |
| 278 | fi |
| 279 | } |
| 280 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 281 | # skip next test if it's i686 or uname is not available |
| 282 | requires_not_i686() { |
| 283 | if [ -z "${IS_I686:-}" ]; then |
| 284 | IS_I686="YES" |
| 285 | if which "uname" >/dev/null 2>&1; then |
| 286 | if [ -z "$(uname -a | grep i686)" ]; then |
| 287 | IS_I686="NO" |
| 288 | fi |
| 289 | fi |
| 290 | fi |
| 291 | if [ "$IS_I686" = "YES" ]; then |
| 292 | SKIP_NEXT="YES" |
| 293 | fi |
| 294 | } |
| 295 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 296 | # Calculate the input & output maximum content lengths set in the config |
| 297 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 298 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 299 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 300 | |
| 301 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 302 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 303 | fi |
| 304 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 305 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 306 | fi |
| 307 | |
| 308 | # skip the next test if the SSL output buffer is less than 16KB |
| 309 | requires_full_size_output_buffer() { |
| 310 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 311 | SKIP_NEXT="YES" |
| 312 | fi |
| 313 | } |
| 314 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 315 | # skip the next test if valgrind is in use |
| 316 | not_with_valgrind() { |
| 317 | if [ "$MEMCHECK" -gt 0 ]; then |
| 318 | SKIP_NEXT="YES" |
| 319 | fi |
| 320 | } |
| 321 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 322 | # skip the next test if valgrind is NOT in use |
| 323 | only_with_valgrind() { |
| 324 | if [ "$MEMCHECK" -eq 0 ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 329 | # 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] | 330 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 331 | CLI_DELAY_FACTOR=$1 |
| 332 | } |
| 333 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 334 | # wait for the given seconds after the client finished in the next test |
| 335 | server_needs_more_time() { |
| 336 | SRV_DELAY_SECONDS=$1 |
| 337 | } |
| 338 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 339 | # print_name <name> |
| 340 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 341 | TESTS=$(( $TESTS + 1 )) |
| 342 | LINE="" |
| 343 | |
| 344 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 345 | LINE="$TESTS " |
| 346 | fi |
| 347 | |
| 348 | LINE="$LINE$1" |
| 349 | printf "$LINE " |
| 350 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 351 | for i in `seq 1 $LEN`; do printf '.'; done |
| 352 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 353 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | # fail <message> |
| 357 | fail() { |
| 358 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 359 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 360 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 361 | mv $SRV_OUT o-srv-${TESTS}.log |
| 362 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 363 | if [ -n "$PXY_CMD" ]; then |
| 364 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 365 | fi |
| 366 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 367 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 368 | 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] | 369 | echo " ! server output:" |
| 370 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 371 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 372 | echo " ! client output:" |
| 373 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 374 | if [ -n "$PXY_CMD" ]; then |
| 375 | echo " ! ========================================================" |
| 376 | echo " ! proxy output:" |
| 377 | cat o-pxy-${TESTS}.log |
| 378 | fi |
| 379 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 380 | fi |
| 381 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 382 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 383 | } |
| 384 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 385 | # is_polar <cmd_line> |
| 386 | is_polar() { |
| 387 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 388 | } |
| 389 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 390 | # openssl s_server doesn't have -www with DTLS |
| 391 | check_osrv_dtls() { |
| 392 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 393 | NEEDS_INPUT=1 |
| 394 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 395 | else |
| 396 | NEEDS_INPUT=0 |
| 397 | fi |
| 398 | } |
| 399 | |
| 400 | # provide input to commands that need it |
| 401 | provide_input() { |
| 402 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 403 | return |
| 404 | fi |
| 405 | |
| 406 | while true; do |
| 407 | echo "HTTP/1.0 200 OK" |
| 408 | sleep 1 |
| 409 | done |
| 410 | } |
| 411 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 412 | # has_mem_err <log_file_name> |
| 413 | has_mem_err() { |
| 414 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 415 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 416 | then |
| 417 | return 1 # false: does not have errors |
| 418 | else |
| 419 | return 0 # true: has errors |
| 420 | fi |
| 421 | } |
| 422 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 423 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 424 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 425 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 426 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 427 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 428 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 429 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 430 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 431 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 432 | # Make a tight loop, server normally takes less than 1s to start. |
| 433 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 434 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 435 | echo "$3 START TIMEOUT" |
| 436 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 437 | break |
| 438 | fi |
| 439 | # Linux and *BSD support decimal arguments to sleep. On other |
| 440 | # OSes this may be a tight loop. |
| 441 | sleep 0.1 2>/dev/null || true |
| 442 | done |
| 443 | } |
| 444 | else |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 445 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 446 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 447 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 448 | } |
| 449 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 450 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 451 | # Wait for server process $2 to be listening on port $1. |
| 452 | wait_server_start() { |
| 453 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 454 | } |
| 455 | |
| 456 | # Wait for proxy process $2 to be listening on port $1. |
| 457 | wait_proxy_start() { |
| 458 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 459 | } |
| 460 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 461 | # 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] | 462 | # 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] | 463 | # acceptable bounds |
| 464 | check_server_hello_time() { |
| 465 | # 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] | 466 | 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] | 467 | # Get the Unix timestamp for now |
| 468 | CUR_TIME=$(date +'%s') |
| 469 | THRESHOLD_IN_SECS=300 |
| 470 | |
| 471 | # Check if the ServerHello time was printed |
| 472 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 473 | return 1 |
| 474 | fi |
| 475 | |
| 476 | # Check the time in ServerHello is within acceptable bounds |
| 477 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 478 | # The time in ServerHello is at least 5 minutes before now |
| 479 | return 1 |
| 480 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 481 | # 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] | 482 | return 1 |
| 483 | else |
| 484 | return 0 |
| 485 | fi |
| 486 | } |
| 487 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 488 | # wait for client to terminate and set CLI_EXIT |
| 489 | # must be called right after starting the client |
| 490 | wait_client_done() { |
| 491 | CLI_PID=$! |
| 492 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 493 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 494 | CLI_DELAY_FACTOR=1 |
| 495 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 496 | ( 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] | 497 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 498 | |
| 499 | wait $CLI_PID |
| 500 | CLI_EXIT=$? |
| 501 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 502 | kill $DOG_PID >/dev/null 2>&1 |
| 503 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 504 | |
| 505 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 506 | |
| 507 | sleep $SRV_DELAY_SECONDS |
| 508 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 509 | } |
| 510 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 511 | # check if the given command uses dtls and sets global variable DTLS |
| 512 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 513 | 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] | 514 | DTLS=1 |
| 515 | else |
| 516 | DTLS=0 |
| 517 | fi |
| 518 | } |
| 519 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 520 | # 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] | 521 | # Options: -s pattern pattern that must be present in server output |
| 522 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 523 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 524 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 525 | # -S pattern pattern that must be absent in server output |
| 526 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 527 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 528 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 529 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 530 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 531 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 532 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 533 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 534 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 535 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 536 | return |
| 537 | fi |
| 538 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 539 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 540 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 541 | # Do we only run numbered tests? |
| 542 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 543 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 544 | else |
| 545 | SKIP_NEXT="YES" |
| 546 | fi |
| 547 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 548 | # should we skip? |
| 549 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 550 | SKIP_NEXT="NO" |
| 551 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 552 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 553 | return |
| 554 | fi |
| 555 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 556 | # does this test use a proxy? |
| 557 | if [ "X$1" = "X-p" ]; then |
| 558 | PXY_CMD="$2" |
| 559 | shift 2 |
| 560 | else |
| 561 | PXY_CMD="" |
| 562 | fi |
| 563 | |
| 564 | # get commands and client output |
| 565 | SRV_CMD="$1" |
| 566 | CLI_CMD="$2" |
| 567 | CLI_EXPECT="$3" |
| 568 | shift 3 |
| 569 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 570 | # Check if test uses files |
| 571 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 572 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 573 | requires_config_enabled MBEDTLS_FS_IO |
| 574 | fi |
| 575 | |
| 576 | # should we skip? |
| 577 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 578 | SKIP_NEXT="NO" |
| 579 | echo "SKIP" |
| 580 | SKIPS=$(( $SKIPS + 1 )) |
| 581 | return |
| 582 | fi |
| 583 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 584 | # fix client port |
| 585 | if [ -n "$PXY_CMD" ]; then |
| 586 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 587 | else |
| 588 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 589 | fi |
| 590 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 591 | # update DTLS variable |
| 592 | detect_dtls "$SRV_CMD" |
| 593 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 594 | # prepend valgrind to our commands if active |
| 595 | if [ "$MEMCHECK" -gt 0 ]; then |
| 596 | if is_polar "$SRV_CMD"; then |
| 597 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 598 | fi |
| 599 | if is_polar "$CLI_CMD"; then |
| 600 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 601 | fi |
| 602 | fi |
| 603 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 604 | TIMES_LEFT=2 |
| 605 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 606 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 607 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 608 | # run the commands |
| 609 | if [ -n "$PXY_CMD" ]; then |
| 610 | echo "$PXY_CMD" > $PXY_OUT |
| 611 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 612 | PXY_PID=$! |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 613 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 614 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 615 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 616 | check_osrv_dtls |
| 617 | echo "$SRV_CMD" > $SRV_OUT |
| 618 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 619 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 620 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 621 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 622 | echo "$CLI_CMD" > $CLI_OUT |
| 623 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 624 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 625 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 626 | sleep 0.05 |
| 627 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 628 | # terminate the server (and the proxy) |
| 629 | kill $SRV_PID |
| 630 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 631 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 632 | if [ -n "$PXY_CMD" ]; then |
| 633 | kill $PXY_PID >/dev/null 2>&1 |
| 634 | wait $PXY_PID |
| 635 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 636 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 637 | # retry only on timeouts |
| 638 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 639 | printf "RETRY " |
| 640 | else |
| 641 | TIMES_LEFT=0 |
| 642 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 643 | done |
| 644 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 645 | # 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] | 646 | # (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] | 647 | # expected client exit to incorrectly succeed in case of catastrophic |
| 648 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 649 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 650 | 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] | 651 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 652 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 653 | return |
| 654 | fi |
| 655 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 656 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 657 | 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] | 658 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 659 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 660 | return |
| 661 | fi |
| 662 | fi |
| 663 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 664 | # check server exit code |
| 665 | if [ $? != 0 ]; then |
| 666 | fail "server fail" |
| 667 | return |
| 668 | fi |
| 669 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 670 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 671 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 672 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 673 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 674 | 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] | 675 | return |
| 676 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 677 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 678 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 679 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 680 | # 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] | 681 | while [ $# -gt 0 ] |
| 682 | do |
| 683 | case $1 in |
| 684 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 685 | 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] | 686 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 687 | return |
| 688 | fi |
| 689 | ;; |
| 690 | |
| 691 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 692 | 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] | 693 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 694 | return |
| 695 | fi |
| 696 | ;; |
| 697 | |
| 698 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 699 | 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] | 700 | 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] | 701 | return |
| 702 | fi |
| 703 | ;; |
| 704 | |
| 705 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 706 | 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] | 707 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 708 | return |
| 709 | fi |
| 710 | ;; |
| 711 | |
| 712 | # The filtering in the following two options (-u and -U) do the following |
| 713 | # - ignore valgrind output |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 714 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 715 | # - keep one of each non-unique line |
| 716 | # - count how many lines remain |
| 717 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 718 | # if there were no duplicates. |
| 719 | "-U") |
| 720 | 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 |
| 721 | fail "lines following pattern '$2' must be unique in Server output" |
| 722 | return |
| 723 | fi |
| 724 | ;; |
| 725 | |
| 726 | "-u") |
| 727 | 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 |
| 728 | 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] | 729 | return |
| 730 | fi |
| 731 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 732 | "-F") |
| 733 | if ! $2 "$SRV_OUT"; then |
| 734 | fail "function call to '$2' failed on Server output" |
| 735 | return |
| 736 | fi |
| 737 | ;; |
| 738 | "-f") |
| 739 | if ! $2 "$CLI_OUT"; then |
| 740 | fail "function call to '$2' failed on Client output" |
| 741 | return |
| 742 | fi |
| 743 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 744 | |
| 745 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 746 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 747 | exit 1 |
| 748 | esac |
| 749 | shift 2 |
| 750 | done |
| 751 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 752 | # check valgrind's results |
| 753 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 754 | 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] | 755 | fail "Server has memory errors" |
| 756 | return |
| 757 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 758 | 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] | 759 | fail "Client has memory errors" |
| 760 | return |
| 761 | fi |
| 762 | fi |
| 763 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 764 | # if we're here, everything is ok |
| 765 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 766 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 767 | mv $SRV_OUT o-srv-${TESTS}.log |
| 768 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 769 | if [ -n "$PXY_CMD" ]; then |
| 770 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 771 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 772 | fi |
| 773 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 774 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 775 | } |
| 776 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 777 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 778 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 779 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 780 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 781 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 782 | 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] | 783 | exit 1 |
| 784 | } |
| 785 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 786 | # |
| 787 | # MAIN |
| 788 | # |
| 789 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 790 | get_options "$@" |
| 791 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 792 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 793 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 794 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 795 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 796 | if [ ! -x "$P_SRV_BIN" ]; then |
| 797 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 798 | exit 1 |
| 799 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 800 | if [ ! -x "$P_CLI_BIN" ]; then |
| 801 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 802 | exit 1 |
| 803 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 804 | if [ ! -x "$P_PXY_BIN" ]; then |
| 805 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 806 | exit 1 |
| 807 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 808 | if [ "$MEMCHECK" -gt 0 ]; then |
| 809 | if which valgrind >/dev/null 2>&1; then :; else |
| 810 | echo "Memcheck not possible. Valgrind not found" |
| 811 | exit 1 |
| 812 | fi |
| 813 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 814 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 815 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 816 | exit 1 |
| 817 | fi |
| 818 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 819 | # used by watchdog |
| 820 | MAIN_PID="$$" |
| 821 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 822 | # We use somewhat arbitrary delays for tests: |
| 823 | # - how long do we wait for the server to start (when lsof not available)? |
| 824 | # - how long do we allow for the client to finish? |
| 825 | # (not to check performance, just to avoid waiting indefinitely) |
| 826 | # Things are slower with valgrind, so give extra time here. |
| 827 | # |
| 828 | # Note: without lsof, there is a trade-off between the running time of this |
| 829 | # script and the risk of spurious errors because we didn't wait long enough. |
| 830 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 831 | # 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] | 832 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 833 | START_DELAY=6 |
| 834 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 835 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 836 | START_DELAY=2 |
| 837 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 838 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 839 | |
| 840 | # some particular tests need more time: |
| 841 | # - for the client, we multiply the usual watchdog limit by a factor |
| 842 | # - for the server, we sleep for a number of seconds after the client exits |
| 843 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 844 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 845 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 846 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 847 | # 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] | 848 | # +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] | 849 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 850 | 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] | 851 | 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] | 852 | 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] | 853 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 854 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 855 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 856 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 857 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 858 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 859 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 860 | fi |
| 861 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 862 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 863 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 864 | fi |
| 865 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 866 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 867 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 868 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 869 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 870 | # Allow SHA-1, because many of our test certificates use it |
| 871 | P_SRV="$P_SRV allow_sha1=1" |
| 872 | P_CLI="$P_CLI allow_sha1=1" |
| 873 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 874 | # Also pick a unique name for intermediate files |
| 875 | SRV_OUT="srv_out.$$" |
| 876 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 877 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 878 | SESSION="session.$$" |
| 879 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 880 | SKIP_NEXT="NO" |
| 881 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 882 | trap cleanup INT TERM HUP |
| 883 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 884 | # Basic test |
| 885 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 886 | # Checks that: |
| 887 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 888 | # - the expected (highest security) parameters are selected |
| 889 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 890 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 891 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 892 | "$P_CLI" \ |
| 893 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 894 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 895 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 896 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 897 | -s "ECDHE curve: secp521r1" \ |
| 898 | -S "error" \ |
| 899 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 900 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 901 | run_test "Default, DTLS" \ |
| 902 | "$P_SRV dtls=1" \ |
| 903 | "$P_CLI dtls=1" \ |
| 904 | 0 \ |
| 905 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 906 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 907 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 908 | # Test current time in ServerHello |
| 909 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 910 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 911 | "$P_SRV debug_level=3" \ |
| 912 | "$P_CLI debug_level=3" \ |
| 913 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 914 | -f "check_server_hello_time" \ |
| 915 | -F "check_server_hello_time" |
| 916 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 917 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 918 | run_test "Unique IV in GCM" \ |
| 919 | "$P_SRV exchanges=20 debug_level=4" \ |
| 920 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 921 | 0 \ |
| 922 | -u "IV used" \ |
| 923 | -U "IV used" |
| 924 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 925 | # Tests for rc4 option |
| 926 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 927 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 928 | run_test "RC4: server disabled, client enabled" \ |
| 929 | "$P_SRV" \ |
| 930 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 931 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 932 | -s "SSL - The server has no ciphersuites in common" |
| 933 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 934 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 935 | run_test "RC4: server half, client enabled" \ |
| 936 | "$P_SRV arc4=1" \ |
| 937 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 938 | 1 \ |
| 939 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 940 | |
| 941 | run_test "RC4: server enabled, client disabled" \ |
| 942 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 943 | "$P_CLI" \ |
| 944 | 1 \ |
| 945 | -s "SSL - The server has no ciphersuites in common" |
| 946 | |
| 947 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 948 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 949 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 950 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 951 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 952 | -S "SSL - The server has no ciphersuites in common" |
| 953 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 954 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 955 | |
| 956 | requires_gnutls |
| 957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 958 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 959 | "$G_SRV"\ |
| 960 | "$P_CLI force_version=tls1_1" \ |
| 961 | 0 |
| 962 | |
| 963 | requires_gnutls |
| 964 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 965 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 966 | "$G_SRV"\ |
| 967 | "$P_CLI force_version=tls1" \ |
| 968 | 0 |
| 969 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 970 | # Tests for SHA-1 support |
| 971 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 972 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 973 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 974 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 975 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 976 | 1 \ |
| 977 | -c "The certificate is signed with an unacceptable hash" |
| 978 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 979 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 980 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 981 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 982 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 983 | 0 |
| 984 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 985 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 986 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 987 | "$P_CLI allow_sha1=1" \ |
| 988 | 0 |
| 989 | |
| 990 | run_test "SHA-256 allowed by default in server certificate" \ |
| 991 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 992 | "$P_CLI allow_sha1=0" \ |
| 993 | 0 |
| 994 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 995 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 996 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 997 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 998 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 999 | 1 \ |
| 1000 | -s "The certificate is signed with an unacceptable hash" |
| 1001 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1002 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1003 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1004 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1005 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1006 | 0 |
| 1007 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1008 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1009 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1010 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1011 | 0 |
| 1012 | |
| 1013 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1014 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1015 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1016 | 0 |
| 1017 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1018 | # Tests for datagram packing |
| 1019 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1020 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1021 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1022 | 0 \ |
| 1023 | -c "next record in same datagram" \ |
| 1024 | -s "next record in same datagram" |
| 1025 | |
| 1026 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1027 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1028 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1029 | 0 \ |
| 1030 | -s "next record in same datagram" \ |
| 1031 | -C "next record in same datagram" |
| 1032 | |
| 1033 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1034 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1035 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1036 | 0 \ |
| 1037 | -S "next record in same datagram" \ |
| 1038 | -c "next record in same datagram" |
| 1039 | |
| 1040 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1041 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1042 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1043 | 0 \ |
| 1044 | -S "next record in same datagram" \ |
| 1045 | -C "next record in same datagram" |
| 1046 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1047 | # Tests for Truncated HMAC extension |
| 1048 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1049 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1050 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1051 | "$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] | 1052 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1053 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1054 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1055 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1056 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1057 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1058 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1059 | "$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] | 1060 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1061 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1062 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1063 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1064 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1065 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1066 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1067 | "$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] | 1068 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1069 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1070 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1071 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1072 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1073 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1074 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1075 | "$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] | 1076 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1077 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1078 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1079 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1080 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1081 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1082 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1083 | "$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] | 1084 | 0 \ |
| 1085 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1086 | -S "dumping 'expected mac' (10 bytes)" |
| 1087 | |
| 1088 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1089 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1090 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1091 | "$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] | 1092 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1093 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1094 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1095 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1096 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1097 | "$P_SRV dtls=1 debug_level=4" \ |
| 1098 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1099 | 0 \ |
| 1100 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1101 | -S "dumping 'expected mac' (10 bytes)" |
| 1102 | |
| 1103 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1104 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1105 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1106 | "$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] | 1107 | 0 \ |
| 1108 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1109 | -S "dumping 'expected mac' (10 bytes)" |
| 1110 | |
| 1111 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1112 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1113 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1114 | "$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] | 1115 | 0 \ |
| 1116 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1117 | -S "dumping 'expected mac' (10 bytes)" |
| 1118 | |
| 1119 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1120 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1121 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1122 | "$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] | 1123 | 0 \ |
| 1124 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1125 | -S "dumping 'expected mac' (10 bytes)" |
| 1126 | |
| 1127 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1128 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1129 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1130 | "$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] | 1131 | 0 \ |
| 1132 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1133 | -S "dumping 'expected mac' (10 bytes)" |
| 1134 | |
| 1135 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1136 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1137 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1138 | "$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] | 1139 | 0 \ |
| 1140 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1141 | -s "dumping 'expected mac' (10 bytes)" |
| 1142 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1143 | # Tests for Encrypt-then-MAC extension |
| 1144 | |
| 1145 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1146 | "$P_SRV debug_level=3 \ |
| 1147 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1148 | "$P_CLI debug_level=3" \ |
| 1149 | 0 \ |
| 1150 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1151 | -s "found encrypt then mac extension" \ |
| 1152 | -s "server hello, adding encrypt then mac extension" \ |
| 1153 | -c "found encrypt_then_mac extension" \ |
| 1154 | -c "using encrypt then mac" \ |
| 1155 | -s "using encrypt then mac" |
| 1156 | |
| 1157 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1158 | "$P_SRV debug_level=3 etm=0 \ |
| 1159 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1160 | "$P_CLI debug_level=3 etm=1" \ |
| 1161 | 0 \ |
| 1162 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1163 | -s "found encrypt then mac extension" \ |
| 1164 | -S "server hello, adding encrypt then mac extension" \ |
| 1165 | -C "found encrypt_then_mac extension" \ |
| 1166 | -C "using encrypt then mac" \ |
| 1167 | -S "using encrypt then mac" |
| 1168 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1169 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1170 | "$P_SRV debug_level=3 etm=1 \ |
| 1171 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1172 | "$P_CLI debug_level=3 etm=1" \ |
| 1173 | 0 \ |
| 1174 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1175 | -s "found encrypt then mac extension" \ |
| 1176 | -S "server hello, adding encrypt then mac extension" \ |
| 1177 | -C "found encrypt_then_mac extension" \ |
| 1178 | -C "using encrypt then mac" \ |
| 1179 | -S "using encrypt then mac" |
| 1180 | |
| 1181 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1182 | "$P_SRV debug_level=3 etm=1 \ |
| 1183 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1184 | "$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] | 1185 | 0 \ |
| 1186 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1187 | -s "found encrypt then mac extension" \ |
| 1188 | -S "server hello, adding encrypt then mac extension" \ |
| 1189 | -C "found encrypt_then_mac extension" \ |
| 1190 | -C "using encrypt then mac" \ |
| 1191 | -S "using encrypt then mac" |
| 1192 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1193 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1194 | "$P_SRV debug_level=3 etm=1 \ |
| 1195 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1196 | "$P_CLI debug_level=3 etm=0" \ |
| 1197 | 0 \ |
| 1198 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1199 | -S "found encrypt then mac extension" \ |
| 1200 | -S "server hello, adding encrypt then mac extension" \ |
| 1201 | -C "found encrypt_then_mac extension" \ |
| 1202 | -C "using encrypt then mac" \ |
| 1203 | -S "using encrypt then mac" |
| 1204 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1205 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1206 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1207 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1208 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1209 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1210 | 0 \ |
| 1211 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1212 | -S "found encrypt then mac extension" \ |
| 1213 | -S "server hello, adding encrypt then mac extension" \ |
| 1214 | -C "found encrypt_then_mac extension" \ |
| 1215 | -C "using encrypt then mac" \ |
| 1216 | -S "using encrypt then mac" |
| 1217 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1218 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1219 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1220 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1221 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1222 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1223 | 0 \ |
| 1224 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1225 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1226 | -S "server hello, adding encrypt then mac extension" \ |
| 1227 | -C "found encrypt_then_mac extension" \ |
| 1228 | -C "using encrypt then mac" \ |
| 1229 | -S "using encrypt then mac" |
| 1230 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1231 | # Tests for Extended Master Secret extension |
| 1232 | |
| 1233 | run_test "Extended Master Secret: default" \ |
| 1234 | "$P_SRV debug_level=3" \ |
| 1235 | "$P_CLI debug_level=3" \ |
| 1236 | 0 \ |
| 1237 | -c "client hello, adding extended_master_secret extension" \ |
| 1238 | -s "found extended master secret extension" \ |
| 1239 | -s "server hello, adding extended master secret extension" \ |
| 1240 | -c "found extended_master_secret extension" \ |
| 1241 | -c "using extended master secret" \ |
| 1242 | -s "using extended master secret" |
| 1243 | |
| 1244 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1245 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1246 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1247 | 0 \ |
| 1248 | -c "client hello, adding extended_master_secret extension" \ |
| 1249 | -s "found extended master secret extension" \ |
| 1250 | -S "server hello, adding extended master secret extension" \ |
| 1251 | -C "found extended_master_secret extension" \ |
| 1252 | -C "using extended master secret" \ |
| 1253 | -S "using extended master secret" |
| 1254 | |
| 1255 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1256 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1257 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1258 | 0 \ |
| 1259 | -C "client hello, adding extended_master_secret extension" \ |
| 1260 | -S "found extended master secret extension" \ |
| 1261 | -S "server hello, adding extended master secret extension" \ |
| 1262 | -C "found extended_master_secret extension" \ |
| 1263 | -C "using extended master secret" \ |
| 1264 | -S "using extended master secret" |
| 1265 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1266 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1267 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1268 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1269 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1270 | 0 \ |
| 1271 | -C "client hello, adding extended_master_secret extension" \ |
| 1272 | -S "found extended master secret extension" \ |
| 1273 | -S "server hello, adding extended master secret extension" \ |
| 1274 | -C "found extended_master_secret extension" \ |
| 1275 | -C "using extended master secret" \ |
| 1276 | -S "using extended master secret" |
| 1277 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1278 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1279 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1280 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1281 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1282 | 0 \ |
| 1283 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1284 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1285 | -S "server hello, adding extended master secret extension" \ |
| 1286 | -C "found extended_master_secret extension" \ |
| 1287 | -C "using extended master secret" \ |
| 1288 | -S "using extended master secret" |
| 1289 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1290 | # Tests for FALLBACK_SCSV |
| 1291 | |
| 1292 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1293 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1294 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1295 | 0 \ |
| 1296 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1297 | -S "received FALLBACK_SCSV" \ |
| 1298 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1299 | -C "is a fatal alert message (msg 86)" |
| 1300 | |
| 1301 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1302 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1303 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1304 | 0 \ |
| 1305 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1306 | -S "received FALLBACK_SCSV" \ |
| 1307 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1308 | -C "is a fatal alert message (msg 86)" |
| 1309 | |
| 1310 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1311 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1312 | "$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] | 1313 | 1 \ |
| 1314 | -c "adding FALLBACK_SCSV" \ |
| 1315 | -s "received FALLBACK_SCSV" \ |
| 1316 | -s "inapropriate fallback" \ |
| 1317 | -c "is a fatal alert message (msg 86)" |
| 1318 | |
| 1319 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1320 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1321 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1322 | 0 \ |
| 1323 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1324 | -s "received FALLBACK_SCSV" \ |
| 1325 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1326 | -C "is a fatal alert message (msg 86)" |
| 1327 | |
| 1328 | requires_openssl_with_fallback_scsv |
| 1329 | run_test "Fallback SCSV: default, openssl server" \ |
| 1330 | "$O_SRV" \ |
| 1331 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1332 | 0 \ |
| 1333 | -C "adding FALLBACK_SCSV" \ |
| 1334 | -C "is a fatal alert message (msg 86)" |
| 1335 | |
| 1336 | requires_openssl_with_fallback_scsv |
| 1337 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1338 | "$O_SRV" \ |
| 1339 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1340 | 1 \ |
| 1341 | -c "adding FALLBACK_SCSV" \ |
| 1342 | -c "is a fatal alert message (msg 86)" |
| 1343 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1344 | requires_openssl_with_fallback_scsv |
| 1345 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1346 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1347 | "$O_CLI -tls1_1" \ |
| 1348 | 0 \ |
| 1349 | -S "received FALLBACK_SCSV" \ |
| 1350 | -S "inapropriate fallback" |
| 1351 | |
| 1352 | requires_openssl_with_fallback_scsv |
| 1353 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1354 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1355 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1356 | 1 \ |
| 1357 | -s "received FALLBACK_SCSV" \ |
| 1358 | -s "inapropriate fallback" |
| 1359 | |
| 1360 | requires_openssl_with_fallback_scsv |
| 1361 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1362 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1363 | "$O_CLI -fallback_scsv" \ |
| 1364 | 0 \ |
| 1365 | -s "received FALLBACK_SCSV" \ |
| 1366 | -S "inapropriate fallback" |
| 1367 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1368 | # Test sending and receiving empty application data records |
| 1369 | |
| 1370 | run_test "Encrypt then MAC: empty application data record" \ |
| 1371 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1372 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1373 | 0 \ |
| 1374 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1375 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1376 | -c "0 bytes written in 1 fragments" |
| 1377 | |
| 1378 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1379 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1380 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1381 | 0 \ |
| 1382 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1383 | -c "0 bytes written in 1 fragments" |
| 1384 | |
| 1385 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1386 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1387 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1388 | 0 \ |
| 1389 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1390 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1391 | -c "0 bytes written in 1 fragments" |
| 1392 | |
| 1393 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1394 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1395 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1396 | 0 \ |
| 1397 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1398 | -c "0 bytes written in 1 fragments" |
| 1399 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1400 | ## ClientHello generated with |
| 1401 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1402 | ## then manually twiddling the ciphersuite list. |
| 1403 | ## The ClientHello content is spelled out below as a hex string as |
| 1404 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1405 | ## The expected response is an inappropriate_fallback alert. |
| 1406 | requires_openssl_with_fallback_scsv |
| 1407 | run_test "Fallback SCSV: beginning of list" \ |
| 1408 | "$P_SRV debug_level=2" \ |
| 1409 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1410 | 0 \ |
| 1411 | -s "received FALLBACK_SCSV" \ |
| 1412 | -s "inapropriate fallback" |
| 1413 | |
| 1414 | requires_openssl_with_fallback_scsv |
| 1415 | run_test "Fallback SCSV: end of list" \ |
| 1416 | "$P_SRV debug_level=2" \ |
| 1417 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1418 | 0 \ |
| 1419 | -s "received FALLBACK_SCSV" \ |
| 1420 | -s "inapropriate fallback" |
| 1421 | |
| 1422 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1423 | requires_openssl_with_fallback_scsv |
| 1424 | run_test "Fallback SCSV: not in list" \ |
| 1425 | "$P_SRV debug_level=2" \ |
| 1426 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1427 | 0 \ |
| 1428 | -S "received FALLBACK_SCSV" \ |
| 1429 | -S "inapropriate fallback" |
| 1430 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1431 | # Tests for CBC 1/n-1 record splitting |
| 1432 | |
| 1433 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1434 | "$P_SRV" \ |
| 1435 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1436 | request_size=123 force_version=tls1_2" \ |
| 1437 | 0 \ |
| 1438 | -s "Read from client: 123 bytes read" \ |
| 1439 | -S "Read from client: 1 bytes read" \ |
| 1440 | -S "122 bytes read" |
| 1441 | |
| 1442 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1443 | "$P_SRV" \ |
| 1444 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1445 | request_size=123 force_version=tls1_1" \ |
| 1446 | 0 \ |
| 1447 | -s "Read from client: 123 bytes read" \ |
| 1448 | -S "Read from client: 1 bytes read" \ |
| 1449 | -S "122 bytes read" |
| 1450 | |
| 1451 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1452 | "$P_SRV" \ |
| 1453 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1454 | request_size=123 force_version=tls1" \ |
| 1455 | 0 \ |
| 1456 | -S "Read from client: 123 bytes read" \ |
| 1457 | -s "Read from client: 1 bytes read" \ |
| 1458 | -s "122 bytes read" |
| 1459 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1460 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1461 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1462 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1463 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1464 | request_size=123 force_version=ssl3" \ |
| 1465 | 0 \ |
| 1466 | -S "Read from client: 123 bytes read" \ |
| 1467 | -s "Read from client: 1 bytes read" \ |
| 1468 | -s "122 bytes read" |
| 1469 | |
| 1470 | 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] | 1471 | "$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] | 1472 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1473 | request_size=123 force_version=tls1" \ |
| 1474 | 0 \ |
| 1475 | -s "Read from client: 123 bytes read" \ |
| 1476 | -S "Read from client: 1 bytes read" \ |
| 1477 | -S "122 bytes read" |
| 1478 | |
| 1479 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1480 | "$P_SRV" \ |
| 1481 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1482 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1483 | 0 \ |
| 1484 | -s "Read from client: 123 bytes read" \ |
| 1485 | -S "Read from client: 1 bytes read" \ |
| 1486 | -S "122 bytes read" |
| 1487 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1488 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1489 | "$P_SRV nbio=2" \ |
| 1490 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1491 | request_size=123 force_version=tls1" \ |
| 1492 | 0 \ |
| 1493 | -S "Read from client: 123 bytes read" \ |
| 1494 | -s "Read from client: 1 bytes read" \ |
| 1495 | -s "122 bytes read" |
| 1496 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1497 | # Tests for Session Tickets |
| 1498 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1499 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1500 | "$P_SRV debug_level=3 tickets=1" \ |
| 1501 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1502 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1503 | -c "client hello, adding session ticket extension" \ |
| 1504 | -s "found session ticket extension" \ |
| 1505 | -s "server hello, adding session ticket extension" \ |
| 1506 | -c "found session_ticket extension" \ |
| 1507 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1508 | -S "session successfully restored from cache" \ |
| 1509 | -s "session successfully restored from ticket" \ |
| 1510 | -s "a session has been resumed" \ |
| 1511 | -c "a session has been resumed" |
| 1512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1513 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1514 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1515 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1516 | 0 \ |
| 1517 | -c "client hello, adding session ticket extension" \ |
| 1518 | -s "found session ticket extension" \ |
| 1519 | -s "server hello, adding session ticket extension" \ |
| 1520 | -c "found session_ticket extension" \ |
| 1521 | -c "parse new session ticket" \ |
| 1522 | -S "session successfully restored from cache" \ |
| 1523 | -s "session successfully restored from ticket" \ |
| 1524 | -s "a session has been resumed" \ |
| 1525 | -c "a session has been resumed" |
| 1526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1527 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1528 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1529 | "$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] | 1530 | 0 \ |
| 1531 | -c "client hello, adding session ticket extension" \ |
| 1532 | -s "found session ticket extension" \ |
| 1533 | -s "server hello, adding session ticket extension" \ |
| 1534 | -c "found session_ticket extension" \ |
| 1535 | -c "parse new session ticket" \ |
| 1536 | -S "session successfully restored from cache" \ |
| 1537 | -S "session successfully restored from ticket" \ |
| 1538 | -S "a session has been resumed" \ |
| 1539 | -C "a session has been resumed" |
| 1540 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1541 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1542 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1543 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1544 | 0 \ |
| 1545 | -c "client hello, adding session ticket extension" \ |
| 1546 | -c "found session_ticket extension" \ |
| 1547 | -c "parse new session ticket" \ |
| 1548 | -c "a session has been resumed" |
| 1549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1550 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1551 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1552 | "( $O_CLI -sess_out $SESSION; \ |
| 1553 | $O_CLI -sess_in $SESSION; \ |
| 1554 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1555 | 0 \ |
| 1556 | -s "found session ticket extension" \ |
| 1557 | -s "server hello, adding session ticket extension" \ |
| 1558 | -S "session successfully restored from cache" \ |
| 1559 | -s "session successfully restored from ticket" \ |
| 1560 | -s "a session has been resumed" |
| 1561 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1562 | # Tests for Session Tickets with DTLS |
| 1563 | |
| 1564 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1565 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1566 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1567 | 0 \ |
| 1568 | -c "client hello, adding session ticket extension" \ |
| 1569 | -s "found session ticket extension" \ |
| 1570 | -s "server hello, adding session ticket extension" \ |
| 1571 | -c "found session_ticket extension" \ |
| 1572 | -c "parse new session ticket" \ |
| 1573 | -S "session successfully restored from cache" \ |
| 1574 | -s "session successfully restored from ticket" \ |
| 1575 | -s "a session has been resumed" \ |
| 1576 | -c "a session has been resumed" |
| 1577 | |
| 1578 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1579 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 1580 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1581 | 0 \ |
| 1582 | -c "client hello, adding session ticket extension" \ |
| 1583 | -s "found session ticket extension" \ |
| 1584 | -s "server hello, adding session ticket extension" \ |
| 1585 | -c "found session_ticket extension" \ |
| 1586 | -c "parse new session ticket" \ |
| 1587 | -S "session successfully restored from cache" \ |
| 1588 | -s "session successfully restored from ticket" \ |
| 1589 | -s "a session has been resumed" \ |
| 1590 | -c "a session has been resumed" |
| 1591 | |
| 1592 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1593 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1594 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 1595 | 0 \ |
| 1596 | -c "client hello, adding session ticket extension" \ |
| 1597 | -s "found session ticket extension" \ |
| 1598 | -s "server hello, adding session ticket extension" \ |
| 1599 | -c "found session_ticket extension" \ |
| 1600 | -c "parse new session ticket" \ |
| 1601 | -S "session successfully restored from cache" \ |
| 1602 | -S "session successfully restored from ticket" \ |
| 1603 | -S "a session has been resumed" \ |
| 1604 | -C "a session has been resumed" |
| 1605 | |
| 1606 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1607 | "$O_SRV -dtls1" \ |
| 1608 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1609 | 0 \ |
| 1610 | -c "client hello, adding session ticket extension" \ |
| 1611 | -c "found session_ticket extension" \ |
| 1612 | -c "parse new session ticket" \ |
| 1613 | -c "a session has been resumed" |
| 1614 | |
| 1615 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1616 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1617 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1618 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1619 | rm -f $SESSION )" \ |
| 1620 | 0 \ |
| 1621 | -s "found session ticket extension" \ |
| 1622 | -s "server hello, adding session ticket extension" \ |
| 1623 | -S "session successfully restored from cache" \ |
| 1624 | -s "session successfully restored from ticket" \ |
| 1625 | -s "a session has been resumed" |
| 1626 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1627 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1629 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1630 | "$P_SRV debug_level=3 tickets=0" \ |
| 1631 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1632 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1633 | -c "client hello, adding session ticket extension" \ |
| 1634 | -s "found session ticket extension" \ |
| 1635 | -S "server hello, adding session ticket extension" \ |
| 1636 | -C "found session_ticket extension" \ |
| 1637 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1638 | -s "session successfully restored from cache" \ |
| 1639 | -S "session successfully restored from ticket" \ |
| 1640 | -s "a session has been resumed" \ |
| 1641 | -c "a session has been resumed" |
| 1642 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1643 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1644 | "$P_SRV debug_level=3 tickets=1" \ |
| 1645 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1646 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1647 | -C "client hello, adding session ticket extension" \ |
| 1648 | -S "found session ticket extension" \ |
| 1649 | -S "server hello, adding session ticket extension" \ |
| 1650 | -C "found session_ticket extension" \ |
| 1651 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1652 | -s "session successfully restored from cache" \ |
| 1653 | -S "session successfully restored from ticket" \ |
| 1654 | -s "a session has been resumed" \ |
| 1655 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1656 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1657 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1658 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1659 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1660 | 0 \ |
| 1661 | -S "session successfully restored from cache" \ |
| 1662 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1663 | -S "a session has been resumed" \ |
| 1664 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1666 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1667 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1668 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1669 | 0 \ |
| 1670 | -s "session successfully restored from cache" \ |
| 1671 | -S "session successfully restored from ticket" \ |
| 1672 | -s "a session has been resumed" \ |
| 1673 | -c "a session has been resumed" |
| 1674 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1675 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1676 | "$P_SRV debug_level=3 tickets=0" \ |
| 1677 | "$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] | 1678 | 0 \ |
| 1679 | -s "session successfully restored from cache" \ |
| 1680 | -S "session successfully restored from ticket" \ |
| 1681 | -s "a session has been resumed" \ |
| 1682 | -c "a session has been resumed" |
| 1683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1684 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1685 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1686 | "$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] | 1687 | 0 \ |
| 1688 | -S "session successfully restored from cache" \ |
| 1689 | -S "session successfully restored from ticket" \ |
| 1690 | -S "a session has been resumed" \ |
| 1691 | -C "a session has been resumed" |
| 1692 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1693 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1694 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1695 | "$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] | 1696 | 0 \ |
| 1697 | -s "session successfully restored from cache" \ |
| 1698 | -S "session successfully restored from ticket" \ |
| 1699 | -s "a session has been resumed" \ |
| 1700 | -c "a session has been resumed" |
| 1701 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1702 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1703 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1704 | "( $O_CLI -sess_out $SESSION; \ |
| 1705 | $O_CLI -sess_in $SESSION; \ |
| 1706 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1707 | 0 \ |
| 1708 | -s "found session ticket extension" \ |
| 1709 | -S "server hello, adding session ticket extension" \ |
| 1710 | -s "session successfully restored from cache" \ |
| 1711 | -S "session successfully restored from ticket" \ |
| 1712 | -s "a session has been resumed" |
| 1713 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1714 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1715 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1716 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1717 | 0 \ |
| 1718 | -C "found session_ticket extension" \ |
| 1719 | -C "parse new session ticket" \ |
| 1720 | -c "a session has been resumed" |
| 1721 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1722 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1723 | |
| 1724 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1725 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1726 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1727 | 0 \ |
| 1728 | -c "client hello, adding session ticket extension" \ |
| 1729 | -s "found session ticket extension" \ |
| 1730 | -S "server hello, adding session ticket extension" \ |
| 1731 | -C "found session_ticket extension" \ |
| 1732 | -C "parse new session ticket" \ |
| 1733 | -s "session successfully restored from cache" \ |
| 1734 | -S "session successfully restored from ticket" \ |
| 1735 | -s "a session has been resumed" \ |
| 1736 | -c "a session has been resumed" |
| 1737 | |
| 1738 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1739 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1740 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1741 | 0 \ |
| 1742 | -C "client hello, adding session ticket extension" \ |
| 1743 | -S "found session ticket extension" \ |
| 1744 | -S "server hello, adding session ticket extension" \ |
| 1745 | -C "found session_ticket extension" \ |
| 1746 | -C "parse new session ticket" \ |
| 1747 | -s "session successfully restored from cache" \ |
| 1748 | -S "session successfully restored from ticket" \ |
| 1749 | -s "a session has been resumed" \ |
| 1750 | -c "a session has been resumed" |
| 1751 | |
| 1752 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1753 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 1754 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1755 | 0 \ |
| 1756 | -S "session successfully restored from cache" \ |
| 1757 | -S "session successfully restored from ticket" \ |
| 1758 | -S "a session has been resumed" \ |
| 1759 | -C "a session has been resumed" |
| 1760 | |
| 1761 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1762 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 1763 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1764 | 0 \ |
| 1765 | -s "session successfully restored from cache" \ |
| 1766 | -S "session successfully restored from ticket" \ |
| 1767 | -s "a session has been resumed" \ |
| 1768 | -c "a session has been resumed" |
| 1769 | |
| 1770 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1771 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1772 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 1773 | 0 \ |
| 1774 | -s "session successfully restored from cache" \ |
| 1775 | -S "session successfully restored from ticket" \ |
| 1776 | -s "a session has been resumed" \ |
| 1777 | -c "a session has been resumed" |
| 1778 | |
| 1779 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1780 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 1781 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1782 | 0 \ |
| 1783 | -S "session successfully restored from cache" \ |
| 1784 | -S "session successfully restored from ticket" \ |
| 1785 | -S "a session has been resumed" \ |
| 1786 | -C "a session has been resumed" |
| 1787 | |
| 1788 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1789 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 1790 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 1791 | 0 \ |
| 1792 | -s "session successfully restored from cache" \ |
| 1793 | -S "session successfully restored from ticket" \ |
| 1794 | -s "a session has been resumed" \ |
| 1795 | -c "a session has been resumed" |
| 1796 | |
| 1797 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1798 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1799 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1800 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1801 | rm -f $SESSION )" \ |
| 1802 | 0 \ |
| 1803 | -s "found session ticket extension" \ |
| 1804 | -S "server hello, adding session ticket extension" \ |
| 1805 | -s "session successfully restored from cache" \ |
| 1806 | -S "session successfully restored from ticket" \ |
| 1807 | -s "a session has been resumed" |
| 1808 | |
| 1809 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1810 | "$O_SRV -dtls1" \ |
| 1811 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1812 | 0 \ |
| 1813 | -C "found session_ticket extension" \ |
| 1814 | -C "parse new session ticket" \ |
| 1815 | -c "a session has been resumed" |
| 1816 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1817 | # Tests for Max Fragment Length extension |
| 1818 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1819 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1820 | 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] | 1821 | exit 1 |
| 1822 | fi |
| 1823 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1824 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1825 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1826 | fi |
| 1827 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1828 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1829 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1830 | "$P_SRV debug_level=3" \ |
| 1831 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1832 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1833 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1834 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1835 | -C "client hello, adding max_fragment_length extension" \ |
| 1836 | -S "found max fragment length extension" \ |
| 1837 | -S "server hello, max_fragment_length extension" \ |
| 1838 | -C "found max_fragment_length extension" |
| 1839 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1840 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1841 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1842 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1843 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1844 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1845 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1846 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1847 | -C "client hello, adding max_fragment_length extension" \ |
| 1848 | -S "found max fragment length extension" \ |
| 1849 | -S "server hello, max_fragment_length extension" \ |
| 1850 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1851 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1852 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1853 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1854 | |
| 1855 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1856 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1857 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1858 | "$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] | 1859 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1860 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1861 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1862 | -C "client hello, adding max_fragment_length extension" \ |
| 1863 | -S "found max fragment length extension" \ |
| 1864 | -S "server hello, max_fragment_length extension" \ |
| 1865 | -C "found max_fragment_length extension" \ |
| 1866 | -c "fragment larger than.*maximum " |
| 1867 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1868 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1869 | # (session fragment length will be 16384 regardless of mbedtls |
| 1870 | # content length configuration.) |
| 1871 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1872 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1873 | run_test "Max fragment length: disabled, larger message" \ |
| 1874 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1875 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1876 | 0 \ |
| 1877 | -C "Maximum fragment length is 16384" \ |
| 1878 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1879 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1880 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1881 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1882 | |
| 1883 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1884 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1885 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1886 | "$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] | 1887 | 1 \ |
| 1888 | -C "Maximum fragment length is 16384" \ |
| 1889 | -S "Maximum fragment length is 16384" \ |
| 1890 | -c "fragment larger than.*maximum " |
| 1891 | |
| 1892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1893 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1894 | "$P_SRV debug_level=3" \ |
| 1895 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1896 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1897 | -c "Maximum fragment length is 4096" \ |
| 1898 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1899 | -c "client hello, adding max_fragment_length extension" \ |
| 1900 | -s "found max fragment length extension" \ |
| 1901 | -s "server hello, max_fragment_length extension" \ |
| 1902 | -c "found max_fragment_length extension" |
| 1903 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1904 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1905 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1906 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1907 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1908 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1909 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1910 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1911 | -C "client hello, adding max_fragment_length extension" \ |
| 1912 | -S "found max fragment length extension" \ |
| 1913 | -S "server hello, max_fragment_length extension" \ |
| 1914 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1915 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1916 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1917 | requires_gnutls |
| 1918 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1919 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1920 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1921 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1922 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1923 | -c "client hello, adding max_fragment_length extension" \ |
| 1924 | -c "found max_fragment_length extension" |
| 1925 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1926 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1927 | run_test "Max fragment length: client, message just fits" \ |
| 1928 | "$P_SRV debug_level=3" \ |
| 1929 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1930 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1931 | -c "Maximum fragment length is 2048" \ |
| 1932 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1933 | -c "client hello, adding max_fragment_length extension" \ |
| 1934 | -s "found max fragment length extension" \ |
| 1935 | -s "server hello, max_fragment_length extension" \ |
| 1936 | -c "found max_fragment_length extension" \ |
| 1937 | -c "2048 bytes written in 1 fragments" \ |
| 1938 | -s "2048 bytes read" |
| 1939 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1940 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1941 | run_test "Max fragment length: client, larger message" \ |
| 1942 | "$P_SRV debug_level=3" \ |
| 1943 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1944 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1945 | -c "Maximum fragment length is 2048" \ |
| 1946 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1947 | -c "client hello, adding max_fragment_length extension" \ |
| 1948 | -s "found max fragment length extension" \ |
| 1949 | -s "server hello, max_fragment_length extension" \ |
| 1950 | -c "found max_fragment_length extension" \ |
| 1951 | -c "2345 bytes written in 2 fragments" \ |
| 1952 | -s "2048 bytes read" \ |
| 1953 | -s "297 bytes read" |
| 1954 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1956 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1957 | "$P_SRV debug_level=3 dtls=1" \ |
| 1958 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 1959 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1960 | -c "Maximum fragment length is 2048" \ |
| 1961 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1962 | -c "client hello, adding max_fragment_length extension" \ |
| 1963 | -s "found max fragment length extension" \ |
| 1964 | -s "server hello, max_fragment_length extension" \ |
| 1965 | -c "found max_fragment_length extension" \ |
| 1966 | -c "fragment larger than.*maximum" |
| 1967 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1968 | # Tests for renegotiation |
| 1969 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1970 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1971 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1972 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1973 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1974 | 0 \ |
| 1975 | -C "client hello, adding renegotiation extension" \ |
| 1976 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1977 | -S "found renegotiation extension" \ |
| 1978 | -s "server hello, secure renegotiation extension" \ |
| 1979 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1980 | -C "=> renegotiate" \ |
| 1981 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1982 | -S "write hello request" |
| 1983 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1985 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1986 | "$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] | 1987 | "$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] | 1988 | 0 \ |
| 1989 | -c "client hello, adding renegotiation extension" \ |
| 1990 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 1991 | -s "found renegotiation extension" \ |
| 1992 | -s "server hello, secure renegotiation extension" \ |
| 1993 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1994 | -c "=> renegotiate" \ |
| 1995 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1996 | -S "write hello request" |
| 1997 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1998 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1999 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2000 | "$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] | 2001 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2002 | 0 \ |
| 2003 | -c "client hello, adding renegotiation extension" \ |
| 2004 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2005 | -s "found renegotiation extension" \ |
| 2006 | -s "server hello, secure renegotiation extension" \ |
| 2007 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2008 | -c "=> renegotiate" \ |
| 2009 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2010 | -s "write hello request" |
| 2011 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2012 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2013 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2014 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2016 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2017 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2018 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2019 | 0 \ |
| 2020 | -c "client hello, adding renegotiation extension" \ |
| 2021 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2022 | -s "found renegotiation extension" \ |
| 2023 | -s "server hello, secure renegotiation extension" \ |
| 2024 | -c "found renegotiation extension" \ |
| 2025 | -c "=> renegotiate" \ |
| 2026 | -s "=> renegotiate" \ |
| 2027 | -S "write hello request" \ |
| 2028 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2029 | |
| 2030 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2031 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2032 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2033 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2034 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2035 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2036 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2037 | 0 \ |
| 2038 | -c "client hello, adding renegotiation extension" \ |
| 2039 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2040 | -s "found renegotiation extension" \ |
| 2041 | -s "server hello, secure renegotiation extension" \ |
| 2042 | -c "found renegotiation extension" \ |
| 2043 | -c "=> renegotiate" \ |
| 2044 | -s "=> renegotiate" \ |
| 2045 | -s "write hello request" \ |
| 2046 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2047 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2049 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2050 | "$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] | 2051 | "$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] | 2052 | 0 \ |
| 2053 | -c "client hello, adding renegotiation extension" \ |
| 2054 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2055 | -s "found renegotiation extension" \ |
| 2056 | -s "server hello, secure renegotiation extension" \ |
| 2057 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2058 | -c "=> renegotiate" \ |
| 2059 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2060 | -s "write hello request" |
| 2061 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2063 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2064 | "$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] | 2065 | "$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] | 2066 | 1 \ |
| 2067 | -c "client hello, adding renegotiation extension" \ |
| 2068 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2069 | -S "found renegotiation extension" \ |
| 2070 | -s "server hello, secure renegotiation extension" \ |
| 2071 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2072 | -c "=> renegotiate" \ |
| 2073 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2074 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2075 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2076 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2077 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2078 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2079 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2080 | "$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] | 2081 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2082 | 0 \ |
| 2083 | -C "client hello, adding renegotiation extension" \ |
| 2084 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2085 | -S "found renegotiation extension" \ |
| 2086 | -s "server hello, secure renegotiation extension" \ |
| 2087 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2088 | -C "=> renegotiate" \ |
| 2089 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2090 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2091 | -S "SSL - An unexpected message was received from our peer" \ |
| 2092 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2093 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2095 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2096 | "$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] | 2097 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2098 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2099 | 0 \ |
| 2100 | -C "client hello, adding renegotiation extension" \ |
| 2101 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2102 | -S "found renegotiation extension" \ |
| 2103 | -s "server hello, secure renegotiation extension" \ |
| 2104 | -c "found renegotiation extension" \ |
| 2105 | -C "=> renegotiate" \ |
| 2106 | -S "=> renegotiate" \ |
| 2107 | -s "write hello request" \ |
| 2108 | -S "SSL - An unexpected message was received from our peer" \ |
| 2109 | -S "failed" |
| 2110 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2111 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2112 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2113 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2114 | "$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] | 2115 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2116 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2117 | 0 \ |
| 2118 | -C "client hello, adding renegotiation extension" \ |
| 2119 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2120 | -S "found renegotiation extension" \ |
| 2121 | -s "server hello, secure renegotiation extension" \ |
| 2122 | -c "found renegotiation extension" \ |
| 2123 | -C "=> renegotiate" \ |
| 2124 | -S "=> renegotiate" \ |
| 2125 | -s "write hello request" \ |
| 2126 | -S "SSL - An unexpected message was received from our peer" \ |
| 2127 | -S "failed" |
| 2128 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2130 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2131 | "$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] | 2132 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2133 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2134 | 0 \ |
| 2135 | -C "client hello, adding renegotiation extension" \ |
| 2136 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2137 | -S "found renegotiation extension" \ |
| 2138 | -s "server hello, secure renegotiation extension" \ |
| 2139 | -c "found renegotiation extension" \ |
| 2140 | -C "=> renegotiate" \ |
| 2141 | -S "=> renegotiate" \ |
| 2142 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2143 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2144 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2146 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2147 | "$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] | 2148 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2149 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2150 | 0 \ |
| 2151 | -c "client hello, adding renegotiation extension" \ |
| 2152 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2153 | -s "found renegotiation extension" \ |
| 2154 | -s "server hello, secure renegotiation extension" \ |
| 2155 | -c "found renegotiation extension" \ |
| 2156 | -c "=> renegotiate" \ |
| 2157 | -s "=> renegotiate" \ |
| 2158 | -s "write hello request" \ |
| 2159 | -S "SSL - An unexpected message was received from our peer" \ |
| 2160 | -S "failed" |
| 2161 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2163 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2164 | "$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] | 2165 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2166 | 0 \ |
| 2167 | -C "client hello, adding renegotiation extension" \ |
| 2168 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2169 | -S "found renegotiation extension" \ |
| 2170 | -s "server hello, secure renegotiation extension" \ |
| 2171 | -c "found renegotiation extension" \ |
| 2172 | -S "record counter limit reached: renegotiate" \ |
| 2173 | -C "=> renegotiate" \ |
| 2174 | -S "=> renegotiate" \ |
| 2175 | -S "write hello request" \ |
| 2176 | -S "SSL - An unexpected message was received from our peer" \ |
| 2177 | -S "failed" |
| 2178 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2179 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2181 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2182 | "$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] | 2183 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2184 | 0 \ |
| 2185 | -c "client hello, adding renegotiation extension" \ |
| 2186 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2187 | -s "found renegotiation extension" \ |
| 2188 | -s "server hello, secure renegotiation extension" \ |
| 2189 | -c "found renegotiation extension" \ |
| 2190 | -s "record counter limit reached: renegotiate" \ |
| 2191 | -c "=> renegotiate" \ |
| 2192 | -s "=> renegotiate" \ |
| 2193 | -s "write hello request" \ |
| 2194 | -S "SSL - An unexpected message was received from our peer" \ |
| 2195 | -S "failed" |
| 2196 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2198 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2199 | "$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] | 2200 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2201 | 0 \ |
| 2202 | -c "client hello, adding renegotiation extension" \ |
| 2203 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2204 | -s "found renegotiation extension" \ |
| 2205 | -s "server hello, secure renegotiation extension" \ |
| 2206 | -c "found renegotiation extension" \ |
| 2207 | -s "record counter limit reached: renegotiate" \ |
| 2208 | -c "=> renegotiate" \ |
| 2209 | -s "=> renegotiate" \ |
| 2210 | -s "write hello request" \ |
| 2211 | -S "SSL - An unexpected message was received from our peer" \ |
| 2212 | -S "failed" |
| 2213 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2215 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2216 | "$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] | 2217 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2218 | 0 \ |
| 2219 | -C "client hello, adding renegotiation extension" \ |
| 2220 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2221 | -S "found renegotiation extension" \ |
| 2222 | -s "server hello, secure renegotiation extension" \ |
| 2223 | -c "found renegotiation extension" \ |
| 2224 | -S "record counter limit reached: renegotiate" \ |
| 2225 | -C "=> renegotiate" \ |
| 2226 | -S "=> renegotiate" \ |
| 2227 | -S "write hello request" \ |
| 2228 | -S "SSL - An unexpected message was received from our peer" \ |
| 2229 | -S "failed" |
| 2230 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2231 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2232 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2233 | "$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] | 2234 | "$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] | 2235 | 0 \ |
| 2236 | -c "client hello, adding renegotiation extension" \ |
| 2237 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2238 | -s "found renegotiation extension" \ |
| 2239 | -s "server hello, secure renegotiation extension" \ |
| 2240 | -c "found renegotiation extension" \ |
| 2241 | -c "=> renegotiate" \ |
| 2242 | -s "=> renegotiate" \ |
| 2243 | -S "write hello request" |
| 2244 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2246 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2247 | "$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] | 2248 | "$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] | 2249 | 0 \ |
| 2250 | -c "client hello, adding renegotiation extension" \ |
| 2251 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2252 | -s "found renegotiation extension" \ |
| 2253 | -s "server hello, secure renegotiation extension" \ |
| 2254 | -c "found renegotiation extension" \ |
| 2255 | -c "=> renegotiate" \ |
| 2256 | -s "=> renegotiate" \ |
| 2257 | -s "write hello request" |
| 2258 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2260 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2261 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2262 | "$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] | 2263 | 0 \ |
| 2264 | -c "client hello, adding renegotiation extension" \ |
| 2265 | -c "found renegotiation extension" \ |
| 2266 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2267 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2268 | -C "error" \ |
| 2269 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2270 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2271 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2272 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2273 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2274 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2275 | "$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] | 2276 | 0 \ |
| 2277 | -c "client hello, adding renegotiation extension" \ |
| 2278 | -c "found renegotiation extension" \ |
| 2279 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2280 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2281 | -C "error" \ |
| 2282 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2283 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2284 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2285 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2286 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2287 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2288 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2289 | 1 \ |
| 2290 | -c "client hello, adding renegotiation extension" \ |
| 2291 | -C "found renegotiation extension" \ |
| 2292 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2293 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2294 | -c "error" \ |
| 2295 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2296 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2297 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2299 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2300 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2301 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2302 | allow_legacy=0" \ |
| 2303 | 1 \ |
| 2304 | -c "client hello, adding renegotiation extension" \ |
| 2305 | -C "found renegotiation extension" \ |
| 2306 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2307 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2308 | -c "error" \ |
| 2309 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2310 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2311 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2313 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2314 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2315 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2316 | allow_legacy=1" \ |
| 2317 | 0 \ |
| 2318 | -c "client hello, adding renegotiation extension" \ |
| 2319 | -C "found renegotiation extension" \ |
| 2320 | -c "=> renegotiate" \ |
| 2321 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2322 | -C "error" \ |
| 2323 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2324 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2326 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2327 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2328 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2329 | 0 \ |
| 2330 | -c "client hello, adding renegotiation extension" \ |
| 2331 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2332 | -s "found renegotiation extension" \ |
| 2333 | -s "server hello, secure renegotiation extension" \ |
| 2334 | -c "found renegotiation extension" \ |
| 2335 | -c "=> renegotiate" \ |
| 2336 | -s "=> renegotiate" \ |
| 2337 | -S "write hello request" |
| 2338 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2340 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2341 | "$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] | 2342 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2343 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2344 | 0 \ |
| 2345 | -c "client hello, adding renegotiation extension" \ |
| 2346 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2347 | -s "found renegotiation extension" \ |
| 2348 | -s "server hello, secure renegotiation extension" \ |
| 2349 | -c "found renegotiation extension" \ |
| 2350 | -c "=> renegotiate" \ |
| 2351 | -s "=> renegotiate" \ |
| 2352 | -s "write hello request" |
| 2353 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2355 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2356 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2357 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2358 | 0 \ |
| 2359 | -c "client hello, adding renegotiation extension" \ |
| 2360 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2361 | -s "found renegotiation extension" \ |
| 2362 | -s "server hello, secure renegotiation extension" \ |
| 2363 | -s "record counter limit reached: renegotiate" \ |
| 2364 | -c "=> renegotiate" \ |
| 2365 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2366 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2367 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2368 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2370 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2371 | "$G_SRV -u --mtu 4096" \ |
| 2372 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2373 | 0 \ |
| 2374 | -c "client hello, adding renegotiation extension" \ |
| 2375 | -c "found renegotiation extension" \ |
| 2376 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2377 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2378 | -C "error" \ |
| 2379 | -s "Extra-header:" |
| 2380 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2381 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2382 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2383 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2384 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2385 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2386 | "$P_CLI debug_level=3" \ |
| 2387 | 0 \ |
| 2388 | -c "found renegotiation extension" \ |
| 2389 | -C "error" \ |
| 2390 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2391 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2392 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2393 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2394 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2395 | "$P_CLI debug_level=3" \ |
| 2396 | 0 \ |
| 2397 | -C "found renegotiation extension" \ |
| 2398 | -C "error" \ |
| 2399 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2400 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2401 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2402 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2403 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2404 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2405 | 1 \ |
| 2406 | -C "found renegotiation extension" \ |
| 2407 | -c "error" \ |
| 2408 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2409 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2410 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2411 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2412 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2413 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2414 | 0 \ |
| 2415 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2416 | -s "server hello, secure renegotiation extension" |
| 2417 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2418 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2419 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2420 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2421 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2422 | 0 \ |
| 2423 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2424 | -S "server hello, secure renegotiation extension" |
| 2425 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2426 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2427 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2428 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2429 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2430 | 1 \ |
| 2431 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2432 | -S "server hello, secure renegotiation extension" |
| 2433 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2434 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2435 | |
| 2436 | requires_gnutls |
| 2437 | run_test "DER format: no trailing bytes" \ |
| 2438 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2439 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2440 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2441 | 0 \ |
| 2442 | -c "Handshake was completed" \ |
| 2443 | |
| 2444 | requires_gnutls |
| 2445 | run_test "DER format: with a trailing zero byte" \ |
| 2446 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2447 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2448 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2449 | 0 \ |
| 2450 | -c "Handshake was completed" \ |
| 2451 | |
| 2452 | requires_gnutls |
| 2453 | run_test "DER format: with a trailing random byte" \ |
| 2454 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2455 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2456 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2457 | 0 \ |
| 2458 | -c "Handshake was completed" \ |
| 2459 | |
| 2460 | requires_gnutls |
| 2461 | run_test "DER format: with 2 trailing random bytes" \ |
| 2462 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2463 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2464 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2465 | 0 \ |
| 2466 | -c "Handshake was completed" \ |
| 2467 | |
| 2468 | requires_gnutls |
| 2469 | run_test "DER format: with 4 trailing random bytes" \ |
| 2470 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2471 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2472 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2473 | 0 \ |
| 2474 | -c "Handshake was completed" \ |
| 2475 | |
| 2476 | requires_gnutls |
| 2477 | run_test "DER format: with 8 trailing random bytes" \ |
| 2478 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2479 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2480 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2481 | 0 \ |
| 2482 | -c "Handshake was completed" \ |
| 2483 | |
| 2484 | requires_gnutls |
| 2485 | run_test "DER format: with 9 trailing random bytes" \ |
| 2486 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2487 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2488 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2489 | 0 \ |
| 2490 | -c "Handshake was completed" \ |
| 2491 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2492 | # Tests for auth_mode |
| 2493 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2494 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2495 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2496 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2497 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2498 | 1 \ |
| 2499 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2500 | -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] | 2501 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2502 | -c "X509 - Certificate verification failed" |
| 2503 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2504 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2505 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2506 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2507 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2508 | 0 \ |
| 2509 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2510 | -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] | 2511 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2512 | -C "X509 - Certificate verification failed" |
| 2513 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2514 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2515 | "$P_SRV" \ |
| 2516 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2517 | 0 \ |
| 2518 | -c "x509_verify_cert() returned" \ |
| 2519 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2520 | -c "! Certificate verification flags"\ |
| 2521 | -C "! mbedtls_ssl_handshake returned" \ |
| 2522 | -C "X509 - Certificate verification failed" \ |
| 2523 | -C "SSL - No CA Chain is set, but required to operate" |
| 2524 | |
| 2525 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2526 | "$P_SRV" \ |
| 2527 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2528 | 1 \ |
| 2529 | -c "x509_verify_cert() returned" \ |
| 2530 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2531 | -c "! Certificate verification flags"\ |
| 2532 | -c "! mbedtls_ssl_handshake returned" \ |
| 2533 | -c "SSL - No CA Chain is set, but required to operate" |
| 2534 | |
| 2535 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2536 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2537 | # the client informs the server about the supported curves - it does, though, in the |
| 2538 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2539 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2540 | # different means to have the server ignoring the client's supported curve list. |
| 2541 | |
| 2542 | requires_config_enabled MBEDTLS_ECP_C |
| 2543 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2544 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2545 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2546 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2547 | 1 \ |
| 2548 | -c "bad certificate (EC key curve)"\ |
| 2549 | -c "! Certificate verification flags"\ |
| 2550 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2551 | |
| 2552 | requires_config_enabled MBEDTLS_ECP_C |
| 2553 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2554 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2555 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2556 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2557 | 1 \ |
| 2558 | -c "bad certificate (EC key curve)"\ |
| 2559 | -c "! Certificate verification flags"\ |
| 2560 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2561 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2562 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2563 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2564 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2565 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2566 | 0 \ |
| 2567 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2568 | -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] | 2569 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2570 | -C "X509 - Certificate verification failed" |
| 2571 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2572 | run_test "Authentication: client SHA256, server required" \ |
| 2573 | "$P_SRV auth_mode=required" \ |
| 2574 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2575 | key_file=data_files/server6.key \ |
| 2576 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2577 | 0 \ |
| 2578 | -c "Supported Signature Algorithm found: 4," \ |
| 2579 | -c "Supported Signature Algorithm found: 5," |
| 2580 | |
| 2581 | run_test "Authentication: client SHA384, server required" \ |
| 2582 | "$P_SRV auth_mode=required" \ |
| 2583 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2584 | key_file=data_files/server6.key \ |
| 2585 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2586 | 0 \ |
| 2587 | -c "Supported Signature Algorithm found: 4," \ |
| 2588 | -c "Supported Signature Algorithm found: 5," |
| 2589 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2590 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2591 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2592 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2593 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2594 | key_file=data_files/server5.key" \ |
| 2595 | 1 \ |
| 2596 | -S "skip write certificate request" \ |
| 2597 | -C "skip parse certificate request" \ |
| 2598 | -c "got a certificate request" \ |
| 2599 | -c "got no certificate to send" \ |
| 2600 | -S "x509_verify_cert() returned" \ |
| 2601 | -s "client has no certificate" \ |
| 2602 | -s "! mbedtls_ssl_handshake returned" \ |
| 2603 | -c "! mbedtls_ssl_handshake returned" \ |
| 2604 | -s "No client certification received from the client, but required by the authentication mode" |
| 2605 | |
| 2606 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2607 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2608 | "$P_CLI debug_level=3 crt_file=none \ |
| 2609 | key_file=data_files/server5.key" \ |
| 2610 | 1 \ |
| 2611 | -S "skip write certificate request" \ |
| 2612 | -C "skip parse certificate request" \ |
| 2613 | -c "got a certificate request" \ |
| 2614 | -c "= write certificate$" \ |
| 2615 | -C "skip write certificate$" \ |
| 2616 | -S "x509_verify_cert() returned" \ |
| 2617 | -s "client has no certificate" \ |
| 2618 | -s "! mbedtls_ssl_handshake returned" \ |
| 2619 | -c "! mbedtls_ssl_handshake returned" \ |
| 2620 | -s "No client certification received from the client, but required by the authentication mode" |
| 2621 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2622 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2623 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2624 | "$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] | 2625 | key_file=data_files/server5.key" \ |
| 2626 | 1 \ |
| 2627 | -S "skip write certificate request" \ |
| 2628 | -C "skip parse certificate request" \ |
| 2629 | -c "got a certificate request" \ |
| 2630 | -C "skip write certificate" \ |
| 2631 | -C "skip write certificate verify" \ |
| 2632 | -S "skip parse certificate verify" \ |
| 2633 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2634 | -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] | 2635 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2636 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2637 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2638 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2639 | # We don't check that the client receives the alert because it might |
| 2640 | # detect that its write end of the connection is closed and abort |
| 2641 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2642 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2643 | run_test "Authentication: client cert not trusted, server required" \ |
| 2644 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2645 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2646 | key_file=data_files/server5.key" \ |
| 2647 | 1 \ |
| 2648 | -S "skip write certificate request" \ |
| 2649 | -C "skip parse certificate request" \ |
| 2650 | -c "got a certificate request" \ |
| 2651 | -C "skip write certificate" \ |
| 2652 | -C "skip write certificate verify" \ |
| 2653 | -S "skip parse certificate verify" \ |
| 2654 | -s "x509_verify_cert() returned" \ |
| 2655 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2656 | -s "! mbedtls_ssl_handshake returned" \ |
| 2657 | -c "! mbedtls_ssl_handshake returned" \ |
| 2658 | -s "X509 - Certificate verification failed" |
| 2659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2660 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2661 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2662 | "$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] | 2663 | key_file=data_files/server5.key" \ |
| 2664 | 0 \ |
| 2665 | -S "skip write certificate request" \ |
| 2666 | -C "skip parse certificate request" \ |
| 2667 | -c "got a certificate request" \ |
| 2668 | -C "skip write certificate" \ |
| 2669 | -C "skip write certificate verify" \ |
| 2670 | -S "skip parse certificate verify" \ |
| 2671 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2672 | -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] | 2673 | -S "! mbedtls_ssl_handshake returned" \ |
| 2674 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2675 | -S "X509 - Certificate verification failed" |
| 2676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2677 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2678 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2679 | "$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] | 2680 | key_file=data_files/server5.key" \ |
| 2681 | 0 \ |
| 2682 | -s "skip write certificate request" \ |
| 2683 | -C "skip parse certificate request" \ |
| 2684 | -c "got no certificate request" \ |
| 2685 | -c "skip write certificate" \ |
| 2686 | -c "skip write certificate verify" \ |
| 2687 | -s "skip parse certificate verify" \ |
| 2688 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2689 | -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] | 2690 | -S "! mbedtls_ssl_handshake returned" \ |
| 2691 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2692 | -S "X509 - Certificate verification failed" |
| 2693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2694 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2695 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2696 | "$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] | 2697 | 0 \ |
| 2698 | -S "skip write certificate request" \ |
| 2699 | -C "skip parse certificate request" \ |
| 2700 | -c "got a certificate request" \ |
| 2701 | -C "skip write certificate$" \ |
| 2702 | -C "got no certificate to send" \ |
| 2703 | -S "SSLv3 client has no certificate" \ |
| 2704 | -c "skip write certificate verify" \ |
| 2705 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2706 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2707 | -S "! mbedtls_ssl_handshake returned" \ |
| 2708 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2709 | -S "X509 - Certificate verification failed" |
| 2710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2711 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2712 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2713 | "$O_CLI" \ |
| 2714 | 0 \ |
| 2715 | -S "skip write certificate request" \ |
| 2716 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2717 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2718 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2719 | -S "X509 - Certificate verification failed" |
| 2720 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2721 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2722 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2723 | "$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] | 2724 | 0 \ |
| 2725 | -C "skip parse certificate request" \ |
| 2726 | -c "got a certificate request" \ |
| 2727 | -C "skip write certificate$" \ |
| 2728 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2729 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2730 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2731 | run_test "Authentication: client no cert, openssl server required" \ |
| 2732 | "$O_SRV -Verify 10" \ |
| 2733 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2734 | 1 \ |
| 2735 | -C "skip parse certificate request" \ |
| 2736 | -c "got a certificate request" \ |
| 2737 | -C "skip write certificate$" \ |
| 2738 | -c "skip write certificate verify" \ |
| 2739 | -c "! mbedtls_ssl_handshake returned" |
| 2740 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2741 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2742 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2743 | "$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] | 2744 | "$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] | 2745 | 0 \ |
| 2746 | -S "skip write certificate request" \ |
| 2747 | -C "skip parse certificate request" \ |
| 2748 | -c "got a certificate request" \ |
| 2749 | -C "skip write certificate$" \ |
| 2750 | -c "skip write certificate verify" \ |
| 2751 | -c "got no certificate to send" \ |
| 2752 | -s "SSLv3 client has no certificate" \ |
| 2753 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2754 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2755 | -S "! mbedtls_ssl_handshake returned" \ |
| 2756 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2757 | -S "X509 - Certificate verification failed" |
| 2758 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2759 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2760 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2761 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2762 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2763 | 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] | 2764 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2765 | 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] | 2766 | 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] | 2767 | 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] | 2768 | printf "test value of ${MAX_IM_CA}. \n" |
| 2769 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2770 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2771 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2772 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2773 | |
| 2774 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2775 | fi |
| 2776 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2777 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2778 | run_test "Authentication: server max_int chain, client default" \ |
| 2779 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2780 | key_file=data_files/dir-maxpath/09.key" \ |
| 2781 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2782 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2783 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2784 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2785 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2786 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2787 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2788 | key_file=data_files/dir-maxpath/10.key" \ |
| 2789 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2790 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2791 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2792 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2793 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2794 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2795 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2796 | key_file=data_files/dir-maxpath/10.key" \ |
| 2797 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2798 | auth_mode=optional" \ |
| 2799 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2800 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2801 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2802 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2803 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2804 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2805 | key_file=data_files/dir-maxpath/10.key" \ |
| 2806 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2807 | auth_mode=none" \ |
| 2808 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2809 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2810 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2811 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2812 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2813 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2814 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2815 | key_file=data_files/dir-maxpath/10.key" \ |
| 2816 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2817 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2818 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2819 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2820 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2821 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2822 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2823 | key_file=data_files/dir-maxpath/10.key" \ |
| 2824 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2825 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2826 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2827 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2828 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2829 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2830 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2831 | key_file=data_files/dir-maxpath/10.key" \ |
| 2832 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2833 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2834 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2835 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2836 | run_test "Authentication: client max_int chain, server required" \ |
| 2837 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2838 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2839 | key_file=data_files/dir-maxpath/09.key" \ |
| 2840 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2841 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2842 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2843 | # Tests for CA list in CertificateRequest messages |
| 2844 | |
| 2845 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2846 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2847 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2848 | key_file=data_files/server6.key" \ |
| 2849 | 0 \ |
| 2850 | -s "requested DN" |
| 2851 | |
| 2852 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2853 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2854 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2855 | key_file=data_files/server6.key" \ |
| 2856 | 0 \ |
| 2857 | -S "requested DN" |
| 2858 | |
| 2859 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2860 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2861 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2862 | key_file=data_files/server5.key" \ |
| 2863 | 1 \ |
| 2864 | -S "requested DN" \ |
| 2865 | -s "x509_verify_cert() returned" \ |
| 2866 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2867 | -s "! mbedtls_ssl_handshake returned" \ |
| 2868 | -c "! mbedtls_ssl_handshake returned" \ |
| 2869 | -s "X509 - Certificate verification failed" |
| 2870 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2871 | # Tests for certificate selection based on SHA verson |
| 2872 | |
| 2873 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2874 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2875 | key_file=data_files/server5.key \ |
| 2876 | crt_file2=data_files/server5-sha1.crt \ |
| 2877 | key_file2=data_files/server5.key" \ |
| 2878 | "$P_CLI force_version=tls1_2" \ |
| 2879 | 0 \ |
| 2880 | -c "signed using.*ECDSA with SHA256" \ |
| 2881 | -C "signed using.*ECDSA with SHA1" |
| 2882 | |
| 2883 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2884 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2885 | key_file=data_files/server5.key \ |
| 2886 | crt_file2=data_files/server5-sha1.crt \ |
| 2887 | key_file2=data_files/server5.key" \ |
| 2888 | "$P_CLI force_version=tls1_1" \ |
| 2889 | 0 \ |
| 2890 | -C "signed using.*ECDSA with SHA256" \ |
| 2891 | -c "signed using.*ECDSA with SHA1" |
| 2892 | |
| 2893 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2894 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2895 | key_file=data_files/server5.key \ |
| 2896 | crt_file2=data_files/server5-sha1.crt \ |
| 2897 | key_file2=data_files/server5.key" \ |
| 2898 | "$P_CLI force_version=tls1" \ |
| 2899 | 0 \ |
| 2900 | -C "signed using.*ECDSA with SHA256" \ |
| 2901 | -c "signed using.*ECDSA with SHA1" |
| 2902 | |
| 2903 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2904 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2905 | key_file=data_files/server5.key \ |
| 2906 | crt_file2=data_files/server6.crt \ |
| 2907 | key_file2=data_files/server6.key" \ |
| 2908 | "$P_CLI force_version=tls1_1" \ |
| 2909 | 0 \ |
| 2910 | -c "serial number.*09" \ |
| 2911 | -c "signed using.*ECDSA with SHA256" \ |
| 2912 | -C "signed using.*ECDSA with SHA1" |
| 2913 | |
| 2914 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2915 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2916 | key_file=data_files/server6.key \ |
| 2917 | crt_file2=data_files/server5.crt \ |
| 2918 | key_file2=data_files/server5.key" \ |
| 2919 | "$P_CLI force_version=tls1_1" \ |
| 2920 | 0 \ |
| 2921 | -c "serial number.*0A" \ |
| 2922 | -c "signed using.*ECDSA with SHA256" \ |
| 2923 | -C "signed using.*ECDSA with SHA1" |
| 2924 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2925 | # tests for SNI |
| 2926 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2927 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2928 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2929 | 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] | 2930 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2931 | 0 \ |
| 2932 | -S "parse ServerName extension" \ |
| 2933 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2934 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2935 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2936 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2937 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2938 | 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] | 2939 | 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] | 2940 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2941 | 0 \ |
| 2942 | -s "parse ServerName extension" \ |
| 2943 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2944 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2946 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2947 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2948 | 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] | 2949 | 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] | 2950 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2951 | 0 \ |
| 2952 | -s "parse ServerName extension" \ |
| 2953 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2954 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2956 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2957 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2958 | 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] | 2959 | 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] | 2960 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2961 | 1 \ |
| 2962 | -s "parse ServerName extension" \ |
| 2963 | -s "ssl_sni_wrapper() returned" \ |
| 2964 | -s "mbedtls_ssl_handshake returned" \ |
| 2965 | -c "mbedtls_ssl_handshake returned" \ |
| 2966 | -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] | 2967 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2968 | run_test "SNI: client auth no override: optional" \ |
| 2969 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2970 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2971 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 2972 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2973 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2974 | -S "skip write certificate request" \ |
| 2975 | -C "skip parse certificate request" \ |
| 2976 | -c "got a certificate request" \ |
| 2977 | -C "skip write certificate" \ |
| 2978 | -C "skip write certificate verify" \ |
| 2979 | -S "skip parse certificate verify" |
| 2980 | |
| 2981 | run_test "SNI: client auth override: none -> optional" \ |
| 2982 | "$P_SRV debug_level=3 auth_mode=none \ |
| 2983 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2984 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 2985 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2986 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2987 | -S "skip write certificate request" \ |
| 2988 | -C "skip parse certificate request" \ |
| 2989 | -c "got a certificate request" \ |
| 2990 | -C "skip write certificate" \ |
| 2991 | -C "skip write certificate verify" \ |
| 2992 | -S "skip parse certificate verify" |
| 2993 | |
| 2994 | run_test "SNI: client auth override: optional -> none" \ |
| 2995 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 2996 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 2997 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 2998 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2999 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3000 | -s "skip write certificate request" \ |
| 3001 | -C "skip parse certificate request" \ |
| 3002 | -c "got no certificate request" \ |
| 3003 | -c "skip write certificate" \ |
| 3004 | -c "skip write certificate verify" \ |
| 3005 | -s "skip parse certificate verify" |
| 3006 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3007 | run_test "SNI: CA no override" \ |
| 3008 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3009 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3010 | ca_file=data_files/test-ca.crt \ |
| 3011 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3012 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3013 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3014 | 1 \ |
| 3015 | -S "skip write certificate request" \ |
| 3016 | -C "skip parse certificate request" \ |
| 3017 | -c "got a certificate request" \ |
| 3018 | -C "skip write certificate" \ |
| 3019 | -C "skip write certificate verify" \ |
| 3020 | -S "skip parse certificate verify" \ |
| 3021 | -s "x509_verify_cert() returned" \ |
| 3022 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3023 | -S "The certificate has been revoked (is on a CRL)" |
| 3024 | |
| 3025 | run_test "SNI: CA override" \ |
| 3026 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3027 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3028 | ca_file=data_files/test-ca.crt \ |
| 3029 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3030 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3031 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3032 | 0 \ |
| 3033 | -S "skip write certificate request" \ |
| 3034 | -C "skip parse certificate request" \ |
| 3035 | -c "got a certificate request" \ |
| 3036 | -C "skip write certificate" \ |
| 3037 | -C "skip write certificate verify" \ |
| 3038 | -S "skip parse certificate verify" \ |
| 3039 | -S "x509_verify_cert() returned" \ |
| 3040 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3041 | -S "The certificate has been revoked (is on a CRL)" |
| 3042 | |
| 3043 | run_test "SNI: CA override with CRL" \ |
| 3044 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3045 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3046 | ca_file=data_files/test-ca.crt \ |
| 3047 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3048 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3049 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3050 | 1 \ |
| 3051 | -S "skip write certificate request" \ |
| 3052 | -C "skip parse certificate request" \ |
| 3053 | -c "got a certificate request" \ |
| 3054 | -C "skip write certificate" \ |
| 3055 | -C "skip write certificate verify" \ |
| 3056 | -S "skip parse certificate verify" \ |
| 3057 | -s "x509_verify_cert() returned" \ |
| 3058 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3059 | -s "The certificate has been revoked (is on a CRL)" |
| 3060 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3061 | # Tests for SNI and DTLS |
| 3062 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3063 | run_test "SNI: DTLS, no SNI callback" \ |
| 3064 | "$P_SRV debug_level=3 dtls=1 \ |
| 3065 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3066 | "$P_CLI server_name=localhost dtls=1" \ |
| 3067 | 0 \ |
| 3068 | -S "parse ServerName extension" \ |
| 3069 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3070 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3071 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3072 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3073 | "$P_SRV debug_level=3 dtls=1 \ |
| 3074 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3075 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3076 | "$P_CLI server_name=localhost dtls=1" \ |
| 3077 | 0 \ |
| 3078 | -s "parse ServerName extension" \ |
| 3079 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3080 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3081 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3082 | run_test "SNI: DTLS, matching cert 2" \ |
| 3083 | "$P_SRV debug_level=3 dtls=1 \ |
| 3084 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3085 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3086 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3087 | 0 \ |
| 3088 | -s "parse ServerName extension" \ |
| 3089 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3090 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3091 | |
| 3092 | run_test "SNI: DTLS, no matching cert" \ |
| 3093 | "$P_SRV debug_level=3 dtls=1 \ |
| 3094 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3095 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3096 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3097 | 1 \ |
| 3098 | -s "parse ServerName extension" \ |
| 3099 | -s "ssl_sni_wrapper() returned" \ |
| 3100 | -s "mbedtls_ssl_handshake returned" \ |
| 3101 | -c "mbedtls_ssl_handshake returned" \ |
| 3102 | -c "SSL - A fatal alert message was received from our peer" |
| 3103 | |
| 3104 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3105 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3106 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3107 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3108 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3109 | 0 \ |
| 3110 | -S "skip write certificate request" \ |
| 3111 | -C "skip parse certificate request" \ |
| 3112 | -c "got a certificate request" \ |
| 3113 | -C "skip write certificate" \ |
| 3114 | -C "skip write certificate verify" \ |
| 3115 | -S "skip parse certificate verify" |
| 3116 | |
| 3117 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3118 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3119 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3120 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3121 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3122 | 0 \ |
| 3123 | -S "skip write certificate request" \ |
| 3124 | -C "skip parse certificate request" \ |
| 3125 | -c "got a certificate request" \ |
| 3126 | -C "skip write certificate" \ |
| 3127 | -C "skip write certificate verify" \ |
| 3128 | -S "skip parse certificate verify" |
| 3129 | |
| 3130 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3131 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3132 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3133 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3134 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3135 | 0 \ |
| 3136 | -s "skip write certificate request" \ |
| 3137 | -C "skip parse certificate request" \ |
| 3138 | -c "got no certificate request" \ |
| 3139 | -c "skip write certificate" \ |
| 3140 | -c "skip write certificate verify" \ |
| 3141 | -s "skip parse certificate verify" |
| 3142 | |
| 3143 | run_test "SNI: DTLS, CA no override" \ |
| 3144 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3145 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3146 | ca_file=data_files/test-ca.crt \ |
| 3147 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3148 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3149 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3150 | 1 \ |
| 3151 | -S "skip write certificate request" \ |
| 3152 | -C "skip parse certificate request" \ |
| 3153 | -c "got a certificate request" \ |
| 3154 | -C "skip write certificate" \ |
| 3155 | -C "skip write certificate verify" \ |
| 3156 | -S "skip parse certificate verify" \ |
| 3157 | -s "x509_verify_cert() returned" \ |
| 3158 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3159 | -S "The certificate has been revoked (is on a CRL)" |
| 3160 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3161 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3162 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3163 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3164 | ca_file=data_files/test-ca.crt \ |
| 3165 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3166 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3167 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3168 | 0 \ |
| 3169 | -S "skip write certificate request" \ |
| 3170 | -C "skip parse certificate request" \ |
| 3171 | -c "got a certificate request" \ |
| 3172 | -C "skip write certificate" \ |
| 3173 | -C "skip write certificate verify" \ |
| 3174 | -S "skip parse certificate verify" \ |
| 3175 | -S "x509_verify_cert() returned" \ |
| 3176 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3177 | -S "The certificate has been revoked (is on a CRL)" |
| 3178 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3179 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3180 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3181 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3182 | ca_file=data_files/test-ca.crt \ |
| 3183 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3184 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3185 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3186 | 1 \ |
| 3187 | -S "skip write certificate request" \ |
| 3188 | -C "skip parse certificate request" \ |
| 3189 | -c "got a certificate request" \ |
| 3190 | -C "skip write certificate" \ |
| 3191 | -C "skip write certificate verify" \ |
| 3192 | -S "skip parse certificate verify" \ |
| 3193 | -s "x509_verify_cert() returned" \ |
| 3194 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3195 | -s "The certificate has been revoked (is on a CRL)" |
| 3196 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3197 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3199 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3200 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3201 | "$P_CLI nbio=2 tickets=0" \ |
| 3202 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3203 | -S "mbedtls_ssl_handshake returned" \ |
| 3204 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3205 | -c "Read from server: .* bytes read" |
| 3206 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3207 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3208 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3209 | "$P_CLI nbio=2 tickets=0" \ |
| 3210 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3211 | -S "mbedtls_ssl_handshake returned" \ |
| 3212 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3213 | -c "Read from server: .* bytes read" |
| 3214 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3215 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3216 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3217 | "$P_CLI nbio=2 tickets=1" \ |
| 3218 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3219 | -S "mbedtls_ssl_handshake returned" \ |
| 3220 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3221 | -c "Read from server: .* bytes read" |
| 3222 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3223 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3224 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3225 | "$P_CLI nbio=2 tickets=1" \ |
| 3226 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3227 | -S "mbedtls_ssl_handshake returned" \ |
| 3228 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3229 | -c "Read from server: .* bytes read" |
| 3230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3231 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3232 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3233 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3234 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3235 | -S "mbedtls_ssl_handshake returned" \ |
| 3236 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3237 | -c "Read from server: .* bytes read" |
| 3238 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3239 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3240 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3241 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3242 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3243 | -S "mbedtls_ssl_handshake returned" \ |
| 3244 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3245 | -c "Read from server: .* bytes read" |
| 3246 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3247 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3248 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3249 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3250 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3251 | -S "mbedtls_ssl_handshake returned" \ |
| 3252 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3253 | -c "Read from server: .* bytes read" |
| 3254 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3255 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3256 | |
| 3257 | run_test "Event-driven I/O: basic handshake" \ |
| 3258 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3259 | "$P_CLI event=1 tickets=0" \ |
| 3260 | 0 \ |
| 3261 | -S "mbedtls_ssl_handshake returned" \ |
| 3262 | -C "mbedtls_ssl_handshake returned" \ |
| 3263 | -c "Read from server: .* bytes read" |
| 3264 | |
| 3265 | run_test "Event-driven I/O: client auth" \ |
| 3266 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3267 | "$P_CLI event=1 tickets=0" \ |
| 3268 | 0 \ |
| 3269 | -S "mbedtls_ssl_handshake returned" \ |
| 3270 | -C "mbedtls_ssl_handshake returned" \ |
| 3271 | -c "Read from server: .* bytes read" |
| 3272 | |
| 3273 | run_test "Event-driven I/O: ticket" \ |
| 3274 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3275 | "$P_CLI event=1 tickets=1" \ |
| 3276 | 0 \ |
| 3277 | -S "mbedtls_ssl_handshake returned" \ |
| 3278 | -C "mbedtls_ssl_handshake returned" \ |
| 3279 | -c "Read from server: .* bytes read" |
| 3280 | |
| 3281 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3282 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3283 | "$P_CLI event=1 tickets=1" \ |
| 3284 | 0 \ |
| 3285 | -S "mbedtls_ssl_handshake returned" \ |
| 3286 | -C "mbedtls_ssl_handshake returned" \ |
| 3287 | -c "Read from server: .* bytes read" |
| 3288 | |
| 3289 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3290 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3291 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3292 | 0 \ |
| 3293 | -S "mbedtls_ssl_handshake returned" \ |
| 3294 | -C "mbedtls_ssl_handshake returned" \ |
| 3295 | -c "Read from server: .* bytes read" |
| 3296 | |
| 3297 | run_test "Event-driven I/O: ticket + resume" \ |
| 3298 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3299 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3300 | 0 \ |
| 3301 | -S "mbedtls_ssl_handshake returned" \ |
| 3302 | -C "mbedtls_ssl_handshake returned" \ |
| 3303 | -c "Read from server: .* bytes read" |
| 3304 | |
| 3305 | run_test "Event-driven I/O: session-id resume" \ |
| 3306 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3307 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3308 | 0 \ |
| 3309 | -S "mbedtls_ssl_handshake returned" \ |
| 3310 | -C "mbedtls_ssl_handshake returned" \ |
| 3311 | -c "Read from server: .* bytes read" |
| 3312 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3313 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3314 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3315 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3316 | 0 \ |
| 3317 | -c "Read from server: .* bytes read" |
| 3318 | |
| 3319 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3320 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3321 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3322 | 0 \ |
| 3323 | -c "Read from server: .* bytes read" |
| 3324 | |
| 3325 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3326 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3327 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3328 | 0 \ |
| 3329 | -c "Read from server: .* bytes read" |
| 3330 | |
| 3331 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3332 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3333 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3334 | 0 \ |
| 3335 | -c "Read from server: .* bytes read" |
| 3336 | |
| 3337 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3338 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3339 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3340 | 0 \ |
| 3341 | -c "Read from server: .* bytes read" |
| 3342 | |
| 3343 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3344 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3345 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3346 | 0 \ |
| 3347 | -c "Read from server: .* bytes read" |
| 3348 | |
| 3349 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3350 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3351 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3352 | 0 \ |
| 3353 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3354 | |
| 3355 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3356 | # During session resumption, the client will send its ApplicationData record |
| 3357 | # within the same datagram as the Finished messages. In this situation, the |
| 3358 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3359 | # because the ApplicationData request has already been queued internally. |
| 3360 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3361 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3362 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3363 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3364 | 0 \ |
| 3365 | -c "Read from server: .* bytes read" |
| 3366 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3367 | # Tests for version negotiation |
| 3368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3369 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3370 | "$P_SRV" \ |
| 3371 | "$P_CLI" \ |
| 3372 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3373 | -S "mbedtls_ssl_handshake returned" \ |
| 3374 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3375 | -s "Protocol is TLSv1.2" \ |
| 3376 | -c "Protocol is TLSv1.2" |
| 3377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3378 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3379 | "$P_SRV" \ |
| 3380 | "$P_CLI max_version=tls1_1" \ |
| 3381 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3382 | -S "mbedtls_ssl_handshake returned" \ |
| 3383 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3384 | -s "Protocol is TLSv1.1" \ |
| 3385 | -c "Protocol is TLSv1.1" |
| 3386 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3387 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3388 | "$P_SRV max_version=tls1_1" \ |
| 3389 | "$P_CLI" \ |
| 3390 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3391 | -S "mbedtls_ssl_handshake returned" \ |
| 3392 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3393 | -s "Protocol is TLSv1.1" \ |
| 3394 | -c "Protocol is TLSv1.1" |
| 3395 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3396 | 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] | 3397 | "$P_SRV max_version=tls1_1" \ |
| 3398 | "$P_CLI max_version=tls1_1" \ |
| 3399 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3400 | -S "mbedtls_ssl_handshake returned" \ |
| 3401 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3402 | -s "Protocol is TLSv1.1" \ |
| 3403 | -c "Protocol is TLSv1.1" |
| 3404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3405 | 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] | 3406 | "$P_SRV min_version=tls1_1" \ |
| 3407 | "$P_CLI max_version=tls1_1" \ |
| 3408 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3409 | -S "mbedtls_ssl_handshake returned" \ |
| 3410 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3411 | -s "Protocol is TLSv1.1" \ |
| 3412 | -c "Protocol is TLSv1.1" |
| 3413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3414 | 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] | 3415 | "$P_SRV max_version=tls1_1" \ |
| 3416 | "$P_CLI min_version=tls1_1" \ |
| 3417 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3418 | -S "mbedtls_ssl_handshake returned" \ |
| 3419 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3420 | -s "Protocol is TLSv1.1" \ |
| 3421 | -c "Protocol is TLSv1.1" |
| 3422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3423 | 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] | 3424 | "$P_SRV max_version=tls1_1" \ |
| 3425 | "$P_CLI min_version=tls1_2" \ |
| 3426 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3427 | -s "mbedtls_ssl_handshake returned" \ |
| 3428 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3429 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3431 | 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] | 3432 | "$P_SRV min_version=tls1_2" \ |
| 3433 | "$P_CLI max_version=tls1_1" \ |
| 3434 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3435 | -s "mbedtls_ssl_handshake returned" \ |
| 3436 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3437 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3438 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3439 | # Tests for ALPN extension |
| 3440 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3441 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3442 | "$P_SRV debug_level=3" \ |
| 3443 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3444 | 0 \ |
| 3445 | -C "client hello, adding alpn extension" \ |
| 3446 | -S "found alpn extension" \ |
| 3447 | -C "got an alert message, type: \\[2:120]" \ |
| 3448 | -S "server hello, adding alpn extension" \ |
| 3449 | -C "found alpn extension " \ |
| 3450 | -C "Application Layer Protocol is" \ |
| 3451 | -S "Application Layer Protocol is" |
| 3452 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3453 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3454 | "$P_SRV debug_level=3" \ |
| 3455 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3456 | 0 \ |
| 3457 | -c "client hello, adding alpn extension" \ |
| 3458 | -s "found alpn extension" \ |
| 3459 | -C "got an alert message, type: \\[2:120]" \ |
| 3460 | -S "server hello, adding alpn extension" \ |
| 3461 | -C "found alpn extension " \ |
| 3462 | -c "Application Layer Protocol is (none)" \ |
| 3463 | -S "Application Layer Protocol is" |
| 3464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3465 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3466 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3467 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3468 | 0 \ |
| 3469 | -C "client hello, adding alpn extension" \ |
| 3470 | -S "found alpn extension" \ |
| 3471 | -C "got an alert message, type: \\[2:120]" \ |
| 3472 | -S "server hello, adding alpn extension" \ |
| 3473 | -C "found alpn extension " \ |
| 3474 | -C "Application Layer Protocol is" \ |
| 3475 | -s "Application Layer Protocol is (none)" |
| 3476 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3477 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3478 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3479 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3480 | 0 \ |
| 3481 | -c "client hello, adding alpn extension" \ |
| 3482 | -s "found alpn extension" \ |
| 3483 | -C "got an alert message, type: \\[2:120]" \ |
| 3484 | -s "server hello, adding alpn extension" \ |
| 3485 | -c "found alpn extension" \ |
| 3486 | -c "Application Layer Protocol is abc" \ |
| 3487 | -s "Application Layer Protocol is abc" |
| 3488 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3489 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3490 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3491 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3492 | 0 \ |
| 3493 | -c "client hello, adding alpn extension" \ |
| 3494 | -s "found alpn extension" \ |
| 3495 | -C "got an alert message, type: \\[2:120]" \ |
| 3496 | -s "server hello, adding alpn extension" \ |
| 3497 | -c "found alpn extension" \ |
| 3498 | -c "Application Layer Protocol is abc" \ |
| 3499 | -s "Application Layer Protocol is abc" |
| 3500 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3501 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3502 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3503 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3504 | 0 \ |
| 3505 | -c "client hello, adding alpn extension" \ |
| 3506 | -s "found alpn extension" \ |
| 3507 | -C "got an alert message, type: \\[2:120]" \ |
| 3508 | -s "server hello, adding alpn extension" \ |
| 3509 | -c "found alpn extension" \ |
| 3510 | -c "Application Layer Protocol is 1234" \ |
| 3511 | -s "Application Layer Protocol is 1234" |
| 3512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3513 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3514 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3515 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3516 | 1 \ |
| 3517 | -c "client hello, adding alpn extension" \ |
| 3518 | -s "found alpn extension" \ |
| 3519 | -c "got an alert message, type: \\[2:120]" \ |
| 3520 | -S "server hello, adding alpn extension" \ |
| 3521 | -C "found alpn extension" \ |
| 3522 | -C "Application Layer Protocol is 1234" \ |
| 3523 | -S "Application Layer Protocol is 1234" |
| 3524 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3525 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3526 | # Tests for keyUsage in leaf certificates, part 1: |
| 3527 | # server-side certificate/suite selection |
| 3528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3529 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3530 | "$P_SRV key_file=data_files/server2.key \ |
| 3531 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3532 | "$P_CLI" \ |
| 3533 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3534 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3535 | |
| 3536 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3537 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3538 | "$P_SRV key_file=data_files/server2.key \ |
| 3539 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3540 | "$P_CLI" \ |
| 3541 | 0 \ |
| 3542 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3544 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3545 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3546 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3547 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3548 | 1 \ |
| 3549 | -C "Ciphersuite is " |
| 3550 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3551 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3552 | "$P_SRV key_file=data_files/server5.key \ |
| 3553 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3554 | "$P_CLI" \ |
| 3555 | 0 \ |
| 3556 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3557 | |
| 3558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3559 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3560 | "$P_SRV key_file=data_files/server5.key \ |
| 3561 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3562 | "$P_CLI" \ |
| 3563 | 0 \ |
| 3564 | -c "Ciphersuite is TLS-ECDH-" |
| 3565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3566 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3567 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3568 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3569 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3570 | 1 \ |
| 3571 | -C "Ciphersuite is " |
| 3572 | |
| 3573 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3574 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3576 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3577 | "$O_SRV -key data_files/server2.key \ |
| 3578 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3579 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3580 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3581 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3582 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3583 | -C "Processing of the Certificate handshake message failed" \ |
| 3584 | -c "Ciphersuite is TLS-" |
| 3585 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3586 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3587 | "$O_SRV -key data_files/server2.key \ |
| 3588 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3589 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3590 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3591 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3592 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3593 | -C "Processing of the Certificate handshake message failed" \ |
| 3594 | -c "Ciphersuite is TLS-" |
| 3595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3596 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3597 | "$O_SRV -key data_files/server2.key \ |
| 3598 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3599 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3600 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3601 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3602 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3603 | -C "Processing of the Certificate handshake message failed" \ |
| 3604 | -c "Ciphersuite is TLS-" |
| 3605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3606 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3607 | "$O_SRV -key data_files/server2.key \ |
| 3608 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3609 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3610 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3611 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3612 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3613 | -c "Processing of the Certificate handshake message failed" \ |
| 3614 | -C "Ciphersuite is TLS-" |
| 3615 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3616 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3617 | "$O_SRV -key data_files/server2.key \ |
| 3618 | -cert data_files/server2.ku-ke.crt" \ |
| 3619 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3620 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3621 | 0 \ |
| 3622 | -c "bad certificate (usage extensions)" \ |
| 3623 | -C "Processing of the Certificate handshake message failed" \ |
| 3624 | -c "Ciphersuite is TLS-" \ |
| 3625 | -c "! Usage does not match the keyUsage extension" |
| 3626 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3627 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3628 | "$O_SRV -key data_files/server2.key \ |
| 3629 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3630 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3631 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3632 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3633 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3634 | -C "Processing of the Certificate handshake message failed" \ |
| 3635 | -c "Ciphersuite is TLS-" |
| 3636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3637 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3638 | "$O_SRV -key data_files/server2.key \ |
| 3639 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3640 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3641 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3642 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3643 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3644 | -c "Processing of the Certificate handshake message failed" \ |
| 3645 | -C "Ciphersuite is TLS-" |
| 3646 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3647 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3648 | "$O_SRV -key data_files/server2.key \ |
| 3649 | -cert data_files/server2.ku-ds.crt" \ |
| 3650 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3651 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3652 | 0 \ |
| 3653 | -c "bad certificate (usage extensions)" \ |
| 3654 | -C "Processing of the Certificate handshake message failed" \ |
| 3655 | -c "Ciphersuite is TLS-" \ |
| 3656 | -c "! Usage does not match the keyUsage extension" |
| 3657 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3658 | # Tests for keyUsage in leaf certificates, part 3: |
| 3659 | # server-side checking of client cert |
| 3660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3661 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3662 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3663 | "$O_CLI -key data_files/server2.key \ |
| 3664 | -cert data_files/server2.ku-ds.crt" \ |
| 3665 | 0 \ |
| 3666 | -S "bad certificate (usage extensions)" \ |
| 3667 | -S "Processing of the Certificate handshake message failed" |
| 3668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3670 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3671 | "$O_CLI -key data_files/server2.key \ |
| 3672 | -cert data_files/server2.ku-ke.crt" \ |
| 3673 | 0 \ |
| 3674 | -s "bad certificate (usage extensions)" \ |
| 3675 | -S "Processing of the Certificate handshake message failed" |
| 3676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3677 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3678 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3679 | "$O_CLI -key data_files/server2.key \ |
| 3680 | -cert data_files/server2.ku-ke.crt" \ |
| 3681 | 1 \ |
| 3682 | -s "bad certificate (usage extensions)" \ |
| 3683 | -s "Processing of the Certificate handshake message failed" |
| 3684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3685 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3686 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3687 | "$O_CLI -key data_files/server5.key \ |
| 3688 | -cert data_files/server5.ku-ds.crt" \ |
| 3689 | 0 \ |
| 3690 | -S "bad certificate (usage extensions)" \ |
| 3691 | -S "Processing of the Certificate handshake message failed" |
| 3692 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3693 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3694 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3695 | "$O_CLI -key data_files/server5.key \ |
| 3696 | -cert data_files/server5.ku-ka.crt" \ |
| 3697 | 0 \ |
| 3698 | -s "bad certificate (usage extensions)" \ |
| 3699 | -S "Processing of the Certificate handshake message failed" |
| 3700 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3701 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3703 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3704 | "$P_SRV key_file=data_files/server5.key \ |
| 3705 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3706 | "$P_CLI" \ |
| 3707 | 0 |
| 3708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3709 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3710 | "$P_SRV key_file=data_files/server5.key \ |
| 3711 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3712 | "$P_CLI" \ |
| 3713 | 0 |
| 3714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3715 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3716 | "$P_SRV key_file=data_files/server5.key \ |
| 3717 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3718 | "$P_CLI" \ |
| 3719 | 0 |
| 3720 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3721 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3722 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3723 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3724 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3725 | 1 |
| 3726 | |
| 3727 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3729 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3730 | "$O_SRV -key data_files/server5.key \ |
| 3731 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3732 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3733 | 0 \ |
| 3734 | -C "bad certificate (usage extensions)" \ |
| 3735 | -C "Processing of the Certificate handshake message failed" \ |
| 3736 | -c "Ciphersuite is TLS-" |
| 3737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3738 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3739 | "$O_SRV -key data_files/server5.key \ |
| 3740 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3741 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3742 | 0 \ |
| 3743 | -C "bad certificate (usage extensions)" \ |
| 3744 | -C "Processing of the Certificate handshake message failed" \ |
| 3745 | -c "Ciphersuite is TLS-" |
| 3746 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3747 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3748 | "$O_SRV -key data_files/server5.key \ |
| 3749 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3750 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3751 | 0 \ |
| 3752 | -C "bad certificate (usage extensions)" \ |
| 3753 | -C "Processing of the Certificate handshake message failed" \ |
| 3754 | -c "Ciphersuite is TLS-" |
| 3755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3756 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3757 | "$O_SRV -key data_files/server5.key \ |
| 3758 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3759 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3760 | 1 \ |
| 3761 | -c "bad certificate (usage extensions)" \ |
| 3762 | -c "Processing of the Certificate handshake message failed" \ |
| 3763 | -C "Ciphersuite is TLS-" |
| 3764 | |
| 3765 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3767 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3768 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3769 | "$O_CLI -key data_files/server5.key \ |
| 3770 | -cert data_files/server5.eku-cli.crt" \ |
| 3771 | 0 \ |
| 3772 | -S "bad certificate (usage extensions)" \ |
| 3773 | -S "Processing of the Certificate handshake message failed" |
| 3774 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3775 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3776 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3777 | "$O_CLI -key data_files/server5.key \ |
| 3778 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3779 | 0 \ |
| 3780 | -S "bad certificate (usage extensions)" \ |
| 3781 | -S "Processing of the Certificate handshake message failed" |
| 3782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3783 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3784 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3785 | "$O_CLI -key data_files/server5.key \ |
| 3786 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3787 | 0 \ |
| 3788 | -S "bad certificate (usage extensions)" \ |
| 3789 | -S "Processing of the Certificate handshake message failed" |
| 3790 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3791 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3792 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3793 | "$O_CLI -key data_files/server5.key \ |
| 3794 | -cert data_files/server5.eku-cs.crt" \ |
| 3795 | 0 \ |
| 3796 | -s "bad certificate (usage extensions)" \ |
| 3797 | -S "Processing of the Certificate handshake message failed" |
| 3798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3799 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3800 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3801 | "$O_CLI -key data_files/server5.key \ |
| 3802 | -cert data_files/server5.eku-cs.crt" \ |
| 3803 | 1 \ |
| 3804 | -s "bad certificate (usage extensions)" \ |
| 3805 | -s "Processing of the Certificate handshake message failed" |
| 3806 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3807 | # Tests for DHM parameters loading |
| 3808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3809 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3810 | "$P_SRV" \ |
| 3811 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3812 | debug_level=3" \ |
| 3813 | 0 \ |
| 3814 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3815 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3817 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3818 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3819 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3820 | debug_level=3" \ |
| 3821 | 0 \ |
| 3822 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3823 | -c "value of 'DHM: G ' (2 bits)" |
| 3824 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3825 | # Tests for DHM client-side size checking |
| 3826 | |
| 3827 | run_test "DHM size: server default, client default, OK" \ |
| 3828 | "$P_SRV" \ |
| 3829 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3830 | debug_level=1" \ |
| 3831 | 0 \ |
| 3832 | -C "DHM prime too short:" |
| 3833 | |
| 3834 | run_test "DHM size: server default, client 2048, OK" \ |
| 3835 | "$P_SRV" \ |
| 3836 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3837 | debug_level=1 dhmlen=2048" \ |
| 3838 | 0 \ |
| 3839 | -C "DHM prime too short:" |
| 3840 | |
| 3841 | run_test "DHM size: server 1024, client default, OK" \ |
| 3842 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3843 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3844 | debug_level=1" \ |
| 3845 | 0 \ |
| 3846 | -C "DHM prime too short:" |
| 3847 | |
| 3848 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3849 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3850 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3851 | debug_level=1" \ |
| 3852 | 1 \ |
| 3853 | -c "DHM prime too short:" |
| 3854 | |
| 3855 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3856 | "$P_SRV" \ |
| 3857 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3858 | debug_level=1 dhmlen=2049" \ |
| 3859 | 1 \ |
| 3860 | -c "DHM prime too short:" |
| 3861 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3862 | # Tests for PSK callback |
| 3863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3864 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3865 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3866 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3867 | psk_identity=foo psk=abc123" \ |
| 3868 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3869 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3870 | -S "SSL - Unknown identity received" \ |
| 3871 | -S "SSL - Verification of the message MAC failed" |
| 3872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3873 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3874 | "$P_SRV" \ |
| 3875 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3876 | psk_identity=foo psk=abc123" \ |
| 3877 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3878 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3879 | -S "SSL - Unknown identity received" \ |
| 3880 | -S "SSL - Verification of the message MAC failed" |
| 3881 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3882 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3883 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3884 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3885 | psk_identity=foo psk=abc123" \ |
| 3886 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3887 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3888 | -s "SSL - Unknown identity received" \ |
| 3889 | -S "SSL - Verification of the message MAC failed" |
| 3890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3891 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3892 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3893 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3894 | psk_identity=abc psk=dead" \ |
| 3895 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3896 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3897 | -S "SSL - Unknown identity received" \ |
| 3898 | -S "SSL - Verification of the message MAC failed" |
| 3899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3900 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3901 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3902 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3903 | psk_identity=def psk=beef" \ |
| 3904 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3905 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3906 | -S "SSL - Unknown identity received" \ |
| 3907 | -S "SSL - Verification of the message MAC failed" |
| 3908 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3909 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3910 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3911 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3912 | psk_identity=ghi psk=beef" \ |
| 3913 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3914 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3915 | -s "SSL - Unknown identity received" \ |
| 3916 | -S "SSL - Verification of the message MAC failed" |
| 3917 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3918 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3919 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3920 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3921 | psk_identity=abc psk=beef" \ |
| 3922 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3923 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3924 | -S "SSL - Unknown identity received" \ |
| 3925 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3926 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3927 | # Tests for EC J-PAKE |
| 3928 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3930 | run_test "ECJPAKE: client not configured" \ |
| 3931 | "$P_SRV debug_level=3" \ |
| 3932 | "$P_CLI debug_level=3" \ |
| 3933 | 0 \ |
| 3934 | -C "add ciphersuite: c0ff" \ |
| 3935 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3936 | -S "found ecjpake kkpp extension" \ |
| 3937 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3938 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3939 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3940 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3941 | -S "None of the common ciphersuites is usable" |
| 3942 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3944 | run_test "ECJPAKE: server not configured" \ |
| 3945 | "$P_SRV debug_level=3" \ |
| 3946 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3947 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3948 | 1 \ |
| 3949 | -c "add ciphersuite: c0ff" \ |
| 3950 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3951 | -s "found ecjpake kkpp extension" \ |
| 3952 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3953 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3954 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3955 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3956 | -s "None of the common ciphersuites is usable" |
| 3957 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3958 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3959 | run_test "ECJPAKE: working, TLS" \ |
| 3960 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3961 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3962 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3963 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3964 | -c "add ciphersuite: c0ff" \ |
| 3965 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3966 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3967 | -s "found ecjpake kkpp extension" \ |
| 3968 | -S "skip ecjpake kkpp extension" \ |
| 3969 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3970 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3971 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3972 | -S "None of the common ciphersuites is usable" \ |
| 3973 | -S "SSL - Verification of the message MAC failed" |
| 3974 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3975 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3976 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3977 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 3978 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 3979 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 3980 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3981 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3982 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3983 | -s "SSL - Verification of the message MAC failed" |
| 3984 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3986 | run_test "ECJPAKE: working, DTLS" \ |
| 3987 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 3988 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3989 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3990 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3991 | -c "re-using cached ecjpake parameters" \ |
| 3992 | -S "SSL - Verification of the message MAC failed" |
| 3993 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3994 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3995 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 3996 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 3997 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 3998 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 3999 | 0 \ |
| 4000 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4001 | -S "SSL - Verification of the message MAC failed" |
| 4002 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4003 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4004 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4005 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4006 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4007 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4008 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4009 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4010 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4011 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4012 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4013 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4014 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4015 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4016 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4017 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4018 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4019 | 0 |
| 4020 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4021 | # Tests for ciphersuites per version |
| 4022 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4023 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4024 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4025 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4026 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4027 | "$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] | 4028 | "$P_CLI force_version=ssl3" \ |
| 4029 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4030 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4031 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4033 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4034 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4035 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4036 | "$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] | 4037 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4038 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4039 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4040 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4041 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4042 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4043 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4044 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4045 | "$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] | 4046 | "$P_CLI force_version=tls1_1" \ |
| 4047 | 0 \ |
| 4048 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4049 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4050 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4051 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4052 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4053 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4054 | "$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] | 4055 | "$P_CLI force_version=tls1_2" \ |
| 4056 | 0 \ |
| 4057 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4058 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4059 | # Test for ClientHello without extensions |
| 4060 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4061 | requires_gnutls |
Manuel Pégourié-Gonnard | d20ae89 | 2020-01-30 12:45:14 +0100 | [diff] [blame^] | 4062 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 7c9add2 | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 4063 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4064 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4065 | 0 \ |
| 4066 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4067 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4068 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4069 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4070 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4071 | "$P_SRV" \ |
| 4072 | "$P_CLI request_size=100" \ |
| 4073 | 0 \ |
| 4074 | -s "Read from client: 100 bytes read$" |
| 4075 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4076 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4077 | "$P_SRV" \ |
| 4078 | "$P_CLI request_size=500" \ |
| 4079 | 0 \ |
| 4080 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4081 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4082 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4083 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4085 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4086 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4087 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4089 | 0 \ |
| 4090 | -s "Read from client: 1 bytes read" |
| 4091 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4092 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4093 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4094 | "$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] | 4095 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4096 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4097 | 0 \ |
| 4098 | -s "Read from client: 1 bytes read" |
| 4099 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4100 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4101 | "$P_SRV" \ |
| 4102 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4103 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4104 | 0 \ |
| 4105 | -s "Read from client: 1 bytes read" |
| 4106 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4107 | 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] | 4108 | "$P_SRV" \ |
| 4109 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4110 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4111 | 0 \ |
| 4112 | -s "Read from client: 1 bytes read" |
| 4113 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4114 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4115 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4116 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4117 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4118 | 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] | 4119 | 0 \ |
| 4120 | -s "Read from client: 1 bytes read" |
| 4121 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4122 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4123 | 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] | 4124 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4125 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4126 | 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] | 4127 | 0 \ |
| 4128 | -s "Read from client: 1 bytes read" |
| 4129 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4130 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4131 | "$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] | 4132 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4133 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4134 | 0 \ |
| 4135 | -s "Read from client: 1 bytes read" |
| 4136 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4137 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4138 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4139 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4140 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4141 | 0 \ |
| 4142 | -s "Read from client: 1 bytes read" |
| 4143 | |
| 4144 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4145 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4146 | "$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] | 4147 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4148 | 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] | 4149 | 0 \ |
| 4150 | -s "Read from client: 1 bytes read" |
| 4151 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4153 | 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] | 4154 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4155 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4156 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4157 | 0 \ |
| 4158 | -s "Read from client: 1 bytes read" |
| 4159 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4160 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4161 | "$P_SRV" \ |
| 4162 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4163 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4164 | 0 \ |
| 4165 | -s "Read from client: 1 bytes read" |
| 4166 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4167 | 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] | 4168 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4169 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4171 | 0 \ |
| 4172 | -s "Read from client: 1 bytes read" |
| 4173 | |
| 4174 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4175 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4176 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4177 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4179 | 0 \ |
| 4180 | -s "Read from client: 1 bytes read" |
| 4181 | |
| 4182 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4183 | 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] | 4184 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4185 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4186 | 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] | 4187 | 0 \ |
| 4188 | -s "Read from client: 1 bytes read" |
| 4189 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4190 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4191 | "$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] | 4192 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4193 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4194 | 0 \ |
| 4195 | -s "Read from client: 1 bytes read" |
| 4196 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4197 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4198 | "$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] | 4199 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4200 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4201 | 0 \ |
| 4202 | -s "Read from client: 1 bytes read" |
| 4203 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4205 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4206 | "$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] | 4207 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4208 | 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] | 4209 | 0 \ |
| 4210 | -s "Read from client: 1 bytes read" |
| 4211 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4212 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4213 | 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] | 4214 | "$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] | 4215 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4216 | 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] | 4217 | 0 \ |
| 4218 | -s "Read from client: 1 bytes read" |
| 4219 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4220 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4221 | "$P_SRV" \ |
| 4222 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4224 | 0 \ |
| 4225 | -s "Read from client: 1 bytes read" |
| 4226 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4227 | 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] | 4228 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4229 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4230 | 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] | 4231 | 0 \ |
| 4232 | -s "Read from client: 1 bytes read" |
| 4233 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4234 | 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] | 4235 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4236 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4237 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4238 | 0 \ |
| 4239 | -s "Read from client: 1 bytes read" |
| 4240 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4242 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4243 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4244 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4245 | 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] | 4246 | 0 \ |
| 4247 | -s "Read from client: 1 bytes read" |
| 4248 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4250 | 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] | 4251 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4252 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4254 | 0 \ |
| 4255 | -s "Read from client: 1 bytes read" |
| 4256 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4257 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4258 | "$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] | 4259 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4260 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4261 | 0 \ |
| 4262 | -s "Read from client: 1 bytes read" |
| 4263 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4264 | 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] | 4265 | "$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] | 4266 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4267 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4268 | 0 \ |
| 4269 | -s "Read from client: 1 bytes read" |
| 4270 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4271 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4272 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4273 | "$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] | 4274 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4275 | 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] | 4276 | 0 \ |
| 4277 | -s "Read from client: 1 bytes read" |
| 4278 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4280 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4281 | "$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] | 4282 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4283 | 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] | 4284 | 0 \ |
| 4285 | -s "Read from client: 1 bytes read" |
| 4286 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4287 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4288 | "$P_SRV" \ |
| 4289 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4290 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4291 | 0 \ |
| 4292 | -s "Read from client: 1 bytes read" |
| 4293 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4294 | 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] | 4295 | "$P_SRV" \ |
| 4296 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4297 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4298 | 0 \ |
| 4299 | -s "Read from client: 1 bytes read" |
| 4300 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4301 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4302 | |
| 4303 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4304 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4305 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4306 | "$P_CLI dtls=1 request_size=1 \ |
| 4307 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4308 | 0 \ |
| 4309 | -s "Read from client: 1 bytes read" |
| 4310 | |
| 4311 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4312 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4313 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4314 | "$P_CLI dtls=1 request_size=1 \ |
| 4315 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4316 | 0 \ |
| 4317 | -s "Read from client: 1 bytes read" |
| 4318 | |
| 4319 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4321 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4322 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4323 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4324 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4325 | 0 \ |
| 4326 | -s "Read from client: 1 bytes read" |
| 4327 | |
| 4328 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4329 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4330 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4331 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4332 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4334 | 0 \ |
| 4335 | -s "Read from client: 1 bytes read" |
| 4336 | |
| 4337 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4338 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4339 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4340 | "$P_CLI dtls=1 request_size=1 \ |
| 4341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4342 | 0 \ |
| 4343 | -s "Read from client: 1 bytes read" |
| 4344 | |
| 4345 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4346 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4347 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4348 | "$P_CLI dtls=1 request_size=1 \ |
| 4349 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4350 | 0 \ |
| 4351 | -s "Read from client: 1 bytes read" |
| 4352 | |
| 4353 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4354 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4355 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4356 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4357 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4358 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4359 | 0 \ |
| 4360 | -s "Read from client: 1 bytes read" |
| 4361 | |
| 4362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4363 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4364 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4365 | "$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] | 4366 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4367 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4368 | 0 \ |
| 4369 | -s "Read from client: 1 bytes read" |
| 4370 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4371 | # Tests for small server packets |
| 4372 | |
| 4373 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4374 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4375 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4376 | "$P_CLI force_version=ssl3 \ |
| 4377 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4378 | 0 \ |
| 4379 | -c "Read from server: 1 bytes read" |
| 4380 | |
| 4381 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4382 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4383 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4384 | "$P_CLI force_version=ssl3 \ |
| 4385 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4386 | 0 \ |
| 4387 | -c "Read from server: 1 bytes read" |
| 4388 | |
| 4389 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4390 | "$P_SRV response_size=1" \ |
| 4391 | "$P_CLI force_version=tls1 \ |
| 4392 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4393 | 0 \ |
| 4394 | -c "Read from server: 1 bytes read" |
| 4395 | |
| 4396 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4397 | "$P_SRV response_size=1" \ |
| 4398 | "$P_CLI force_version=tls1 etm=0 \ |
| 4399 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4400 | 0 \ |
| 4401 | -c "Read from server: 1 bytes read" |
| 4402 | |
| 4403 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4404 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4405 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4406 | "$P_CLI force_version=tls1 \ |
| 4407 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4408 | 0 \ |
| 4409 | -c "Read from server: 1 bytes read" |
| 4410 | |
| 4411 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4412 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4413 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4414 | "$P_CLI force_version=tls1 \ |
| 4415 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4416 | 0 \ |
| 4417 | -c "Read from server: 1 bytes read" |
| 4418 | |
| 4419 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4420 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4421 | "$P_CLI force_version=tls1 \ |
| 4422 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4423 | 0 \ |
| 4424 | -c "Read from server: 1 bytes read" |
| 4425 | |
| 4426 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4427 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4428 | "$P_CLI force_version=tls1 \ |
| 4429 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4430 | 0 \ |
| 4431 | -c "Read from server: 1 bytes read" |
| 4432 | |
| 4433 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4434 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4435 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4436 | "$P_CLI force_version=tls1 \ |
| 4437 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4438 | 0 \ |
| 4439 | -c "Read from server: 1 bytes read" |
| 4440 | |
| 4441 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4442 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4443 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4444 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4445 | trunc_hmac=1 etm=0" \ |
| 4446 | 0 \ |
| 4447 | -c "Read from server: 1 bytes read" |
| 4448 | |
| 4449 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4450 | "$P_SRV response_size=1" \ |
| 4451 | "$P_CLI force_version=tls1_1 \ |
| 4452 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4453 | 0 \ |
| 4454 | -c "Read from server: 1 bytes read" |
| 4455 | |
| 4456 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4457 | "$P_SRV response_size=1" \ |
| 4458 | "$P_CLI force_version=tls1_1 \ |
| 4459 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4460 | 0 \ |
| 4461 | -c "Read from server: 1 bytes read" |
| 4462 | |
| 4463 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4464 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4465 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4466 | "$P_CLI force_version=tls1_1 \ |
| 4467 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4468 | 0 \ |
| 4469 | -c "Read from server: 1 bytes read" |
| 4470 | |
| 4471 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4472 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4473 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4474 | "$P_CLI force_version=tls1_1 \ |
| 4475 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4476 | 0 \ |
| 4477 | -c "Read from server: 1 bytes read" |
| 4478 | |
| 4479 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4480 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4481 | "$P_CLI force_version=tls1_1 \ |
| 4482 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4483 | 0 \ |
| 4484 | -c "Read from server: 1 bytes read" |
| 4485 | |
| 4486 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4487 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4488 | "$P_CLI force_version=tls1_1 \ |
| 4489 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4490 | 0 \ |
| 4491 | -c "Read from server: 1 bytes read" |
| 4492 | |
| 4493 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4494 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4495 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4496 | "$P_CLI force_version=tls1_1 \ |
| 4497 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4498 | 0 \ |
| 4499 | -c "Read from server: 1 bytes read" |
| 4500 | |
| 4501 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4502 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4503 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4504 | "$P_CLI force_version=tls1_1 \ |
| 4505 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4506 | 0 \ |
| 4507 | -c "Read from server: 1 bytes read" |
| 4508 | |
| 4509 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4510 | "$P_SRV response_size=1" \ |
| 4511 | "$P_CLI force_version=tls1_2 \ |
| 4512 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4513 | 0 \ |
| 4514 | -c "Read from server: 1 bytes read" |
| 4515 | |
| 4516 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4517 | "$P_SRV response_size=1" \ |
| 4518 | "$P_CLI force_version=tls1_2 \ |
| 4519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4520 | 0 \ |
| 4521 | -c "Read from server: 1 bytes read" |
| 4522 | |
| 4523 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4524 | "$P_SRV response_size=1" \ |
| 4525 | "$P_CLI force_version=tls1_2 \ |
| 4526 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4527 | 0 \ |
| 4528 | -c "Read from server: 1 bytes read" |
| 4529 | |
| 4530 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4531 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4532 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4533 | "$P_CLI force_version=tls1_2 \ |
| 4534 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4535 | 0 \ |
| 4536 | -c "Read from server: 1 bytes read" |
| 4537 | |
| 4538 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4539 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4540 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4541 | "$P_CLI force_version=tls1_2 \ |
| 4542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4543 | 0 \ |
| 4544 | -c "Read from server: 1 bytes read" |
| 4545 | |
| 4546 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4547 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4548 | "$P_CLI force_version=tls1_2 \ |
| 4549 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4550 | 0 \ |
| 4551 | -c "Read from server: 1 bytes read" |
| 4552 | |
| 4553 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4554 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4555 | "$P_CLI force_version=tls1_2 \ |
| 4556 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4557 | 0 \ |
| 4558 | -c "Read from server: 1 bytes read" |
| 4559 | |
| 4560 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4561 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4562 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4563 | "$P_CLI force_version=tls1_2 \ |
| 4564 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4565 | 0 \ |
| 4566 | -c "Read from server: 1 bytes read" |
| 4567 | |
| 4568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4569 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4570 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4571 | "$P_CLI force_version=tls1_2 \ |
| 4572 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4573 | 0 \ |
| 4574 | -c "Read from server: 1 bytes read" |
| 4575 | |
| 4576 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4577 | "$P_SRV response_size=1" \ |
| 4578 | "$P_CLI force_version=tls1_2 \ |
| 4579 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4580 | 0 \ |
| 4581 | -c "Read from server: 1 bytes read" |
| 4582 | |
| 4583 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4584 | "$P_SRV response_size=1" \ |
| 4585 | "$P_CLI force_version=tls1_2 \ |
| 4586 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4587 | 0 \ |
| 4588 | -c "Read from server: 1 bytes read" |
| 4589 | |
| 4590 | # Tests for small server packets in DTLS |
| 4591 | |
| 4592 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4593 | run_test "Small server packet DTLS 1.0" \ |
| 4594 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4595 | "$P_CLI dtls=1 \ |
| 4596 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4597 | 0 \ |
| 4598 | -c "Read from server: 1 bytes read" |
| 4599 | |
| 4600 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4601 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4602 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4603 | "$P_CLI dtls=1 \ |
| 4604 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4605 | 0 \ |
| 4606 | -c "Read from server: 1 bytes read" |
| 4607 | |
| 4608 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4609 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4610 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4611 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4612 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4613 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4614 | 0 \ |
| 4615 | -c "Read from server: 1 bytes read" |
| 4616 | |
| 4617 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4618 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4619 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4620 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4621 | "$P_CLI dtls=1 \ |
| 4622 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4623 | 0 \ |
| 4624 | -c "Read from server: 1 bytes read" |
| 4625 | |
| 4626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4627 | run_test "Small server packet DTLS 1.2" \ |
| 4628 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4629 | "$P_CLI dtls=1 \ |
| 4630 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4631 | 0 \ |
| 4632 | -c "Read from server: 1 bytes read" |
| 4633 | |
| 4634 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4635 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4636 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4637 | "$P_CLI dtls=1 \ |
| 4638 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4639 | 0 \ |
| 4640 | -c "Read from server: 1 bytes read" |
| 4641 | |
| 4642 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4643 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4644 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4645 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4646 | "$P_CLI dtls=1 \ |
| 4647 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4648 | 0 \ |
| 4649 | -c "Read from server: 1 bytes read" |
| 4650 | |
| 4651 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4652 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4653 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4654 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4655 | "$P_CLI dtls=1 \ |
| 4656 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4657 | 0 \ |
| 4658 | -c "Read from server: 1 bytes read" |
| 4659 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4660 | # A test for extensions in SSLv3 |
| 4661 | |
| 4662 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4663 | run_test "SSLv3 with extensions, server side" \ |
| 4664 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4665 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4666 | 0 \ |
| 4667 | -S "dumping 'client hello extensions'" \ |
| 4668 | -S "server hello, total extension length:" |
| 4669 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4670 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4671 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4672 | # How many fragments do we expect to write $1 bytes? |
| 4673 | fragments_for_write() { |
| 4674 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4675 | } |
| 4676 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4677 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4678 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4679 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4680 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4681 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4682 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4683 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4684 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4685 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4686 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4687 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4688 | "$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] | 4689 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4690 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4691 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4692 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4693 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4694 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4695 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4696 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4697 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4698 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4699 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4700 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4701 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4702 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4703 | 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] | 4704 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4705 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4706 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4707 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4708 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4709 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4710 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4711 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4712 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4713 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4714 | 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] | 4715 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4716 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4718 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4719 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4720 | 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] | 4721 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4722 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4723 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4724 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4725 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4726 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4727 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4728 | "$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] | 4729 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4730 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4731 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4732 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4733 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4734 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4735 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4736 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4737 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4738 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4739 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4740 | |
| 4741 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4742 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4743 | "$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] | 4744 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4745 | 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] | 4746 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4747 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4748 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4749 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4750 | 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] | 4751 | "$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] | 4752 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4753 | 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] | 4754 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4755 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4756 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4757 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4758 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4759 | "$P_SRV" \ |
| 4760 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4761 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4762 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4763 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4764 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4765 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4766 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4767 | "$P_SRV" \ |
| 4768 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4770 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4771 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4772 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4773 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4774 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4775 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4776 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4777 | 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] | 4778 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4779 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4780 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4781 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4782 | 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] | 4783 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4784 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4785 | 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] | 4786 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4787 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4788 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4789 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4790 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4791 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4792 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4793 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4794 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4795 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4796 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4797 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4798 | "$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] | 4799 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4800 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4801 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4802 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4803 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4804 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4805 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4806 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4807 | "$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] | 4808 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4809 | 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] | 4810 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4811 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4812 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4813 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4814 | 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] | 4815 | "$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] | 4816 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4817 | 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] | 4818 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4819 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4820 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4821 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4822 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4823 | "$P_SRV" \ |
| 4824 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4825 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4826 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4827 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4828 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4829 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4830 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4831 | "$P_SRV" \ |
| 4832 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4833 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4834 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4835 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4836 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4837 | 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] | 4838 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4839 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4840 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4841 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4842 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4843 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4844 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4845 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4846 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4847 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4848 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4849 | 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] | 4850 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4851 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4852 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4854 | 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] | 4855 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4856 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4857 | 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] | 4858 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4859 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4860 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4861 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4862 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4863 | "$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] | 4864 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4865 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4866 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4867 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4868 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4869 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4870 | 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] | 4871 | "$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] | 4872 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4873 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4874 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4875 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4876 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4877 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4878 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4879 | "$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] | 4880 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4881 | 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] | 4882 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4883 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4884 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4885 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4886 | 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] | 4887 | "$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] | 4888 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4889 | 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] | 4890 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4891 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4892 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4893 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4894 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4895 | "$P_SRV" \ |
| 4896 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4897 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4898 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4899 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4900 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4901 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4902 | 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] | 4903 | "$P_SRV" \ |
| 4904 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4905 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4906 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4907 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4908 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4909 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4910 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4911 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4912 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 4913 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4914 | "$P_CLI force_version=ssl3 \ |
| 4915 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4916 | 0 \ |
| 4917 | -c "Read from server: 16384 bytes read" |
| 4918 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 4919 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 4920 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4921 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 4922 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 4923 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 4924 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4925 | 0 \ |
| 4926 | -c "Read from server: 1 bytes read"\ |
| 4927 | -c "16383 bytes read"\ |
| 4928 | -C "Read from server: 16384 bytes read" |
| 4929 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4930 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 4931 | "$P_SRV response_size=16384" \ |
| 4932 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 4933 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4934 | 0 \ |
| 4935 | -c "Read from server: 1 bytes read"\ |
| 4936 | -c "16383 bytes read"\ |
| 4937 | -C "Read from server: 16384 bytes read" |
| 4938 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4939 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4940 | "$P_SRV response_size=16384" \ |
| 4941 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 4942 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4943 | 0 \ |
| 4944 | -c "Read from server: 1 bytes read"\ |
| 4945 | -c "16383 bytes read"\ |
| 4946 | -C "Read from server: 16384 bytes read" |
| 4947 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4948 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4949 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 4950 | "$P_SRV response_size=16384" \ |
| 4951 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 4952 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 4953 | trunc_hmac=1" \ |
| 4954 | 0 \ |
| 4955 | -c "Read from server: 1 bytes read"\ |
| 4956 | -c "16383 bytes read"\ |
| 4957 | -C "Read from server: 16384 bytes read" |
| 4958 | |
| 4959 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4960 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 4961 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4962 | "$P_CLI force_version=tls1 \ |
| 4963 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4964 | trunc_hmac=1" \ |
| 4965 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4966 | -s "16384 bytes written in 1 fragments" \ |
| 4967 | -c "Read from server: 16384 bytes read" |
| 4968 | |
| 4969 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 4970 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4971 | "$P_CLI force_version=tls1 \ |
| 4972 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4973 | 0 \ |
| 4974 | -s "16384 bytes written in 1 fragments" \ |
| 4975 | -c "Read from server: 16384 bytes read" |
| 4976 | |
| 4977 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4978 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4979 | "$P_CLI force_version=tls1 \ |
| 4980 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4981 | 0 \ |
| 4982 | -s "16384 bytes written in 1 fragments" \ |
| 4983 | -c "Read from server: 16384 bytes read" |
| 4984 | |
| 4985 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4986 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4987 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4988 | "$P_CLI force_version=tls1 \ |
| 4989 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4990 | 0 \ |
| 4991 | -s "16384 bytes written in 1 fragments" \ |
| 4992 | -c "Read from server: 16384 bytes read" |
| 4993 | |
| 4994 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4995 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4996 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4997 | "$P_CLI force_version=tls1 \ |
| 4998 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4999 | 0 \ |
| 5000 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5001 | -c "Read from server: 16384 bytes read" |
| 5002 | |
| 5003 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5004 | "$P_SRV response_size=16384" \ |
| 5005 | "$P_CLI force_version=tls1_1 \ |
| 5006 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5007 | 0 \ |
| 5008 | -c "Read from server: 16384 bytes read" |
| 5009 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5010 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5011 | "$P_SRV response_size=16384" \ |
| 5012 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5013 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5014 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5015 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5016 | -c "Read from server: 16384 bytes read" |
| 5017 | |
| 5018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5019 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5020 | "$P_SRV response_size=16384" \ |
| 5021 | "$P_CLI force_version=tls1_1 \ |
| 5022 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5023 | trunc_hmac=1" \ |
| 5024 | 0 \ |
| 5025 | -c "Read from server: 16384 bytes read" |
| 5026 | |
| 5027 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5028 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5029 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5030 | "$P_CLI force_version=tls1_1 \ |
| 5031 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5032 | 0 \ |
| 5033 | -s "16384 bytes written in 1 fragments" \ |
| 5034 | -c "Read from server: 16384 bytes read" |
| 5035 | |
| 5036 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5037 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5038 | "$P_CLI force_version=tls1_1 \ |
| 5039 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5040 | 0 \ |
| 5041 | -c "Read from server: 16384 bytes read" |
| 5042 | |
| 5043 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5044 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5045 | "$P_CLI force_version=tls1_1 \ |
| 5046 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5047 | 0 \ |
| 5048 | -s "16384 bytes written in 1 fragments" \ |
| 5049 | -c "Read from server: 16384 bytes read" |
| 5050 | |
| 5051 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5052 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5053 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5054 | "$P_CLI force_version=tls1_1 \ |
| 5055 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5056 | trunc_hmac=1" \ |
| 5057 | 0 \ |
| 5058 | -c "Read from server: 16384 bytes read" |
| 5059 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5060 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5061 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5062 | "$P_CLI force_version=tls1_1 \ |
| 5063 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5064 | 0 \ |
| 5065 | -s "16384 bytes written in 1 fragments" \ |
| 5066 | -c "Read from server: 16384 bytes read" |
| 5067 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5068 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5069 | "$P_SRV response_size=16384" \ |
| 5070 | "$P_CLI force_version=tls1_2 \ |
| 5071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5072 | 0 \ |
| 5073 | -c "Read from server: 16384 bytes read" |
| 5074 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5075 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5076 | "$P_SRV response_size=16384" \ |
| 5077 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5078 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5079 | 0 \ |
| 5080 | -s "16384 bytes written in 1 fragments" \ |
| 5081 | -c "Read from server: 16384 bytes read" |
| 5082 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5083 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5084 | "$P_SRV response_size=16384" \ |
| 5085 | "$P_CLI force_version=tls1_2 \ |
| 5086 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5087 | 0 \ |
| 5088 | -c "Read from server: 16384 bytes read" |
| 5089 | |
| 5090 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5091 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5092 | "$P_SRV response_size=16384" \ |
| 5093 | "$P_CLI force_version=tls1_2 \ |
| 5094 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5095 | trunc_hmac=1" \ |
| 5096 | 0 \ |
| 5097 | -c "Read from server: 16384 bytes read" |
| 5098 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5099 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5100 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5101 | "$P_CLI force_version=tls1_2 \ |
| 5102 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5103 | 0 \ |
| 5104 | -s "16384 bytes written in 1 fragments" \ |
| 5105 | -c "Read from server: 16384 bytes read" |
| 5106 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5107 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5108 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5109 | "$P_CLI force_version=tls1_2 \ |
| 5110 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5111 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5112 | -s "16384 bytes written in 1 fragments" \ |
| 5113 | -c "Read from server: 16384 bytes read" |
| 5114 | |
| 5115 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5116 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5117 | "$P_CLI force_version=tls1_2 \ |
| 5118 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5119 | 0 \ |
| 5120 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5121 | -c "Read from server: 16384 bytes read" |
| 5122 | |
| 5123 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5124 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5125 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5126 | "$P_CLI force_version=tls1_2 \ |
| 5127 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5128 | trunc_hmac=1" \ |
| 5129 | 0 \ |
| 5130 | -c "Read from server: 16384 bytes read" |
| 5131 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5133 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5134 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5135 | "$P_CLI force_version=tls1_2 \ |
| 5136 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5137 | 0 \ |
| 5138 | -s "16384 bytes written in 1 fragments" \ |
| 5139 | -c "Read from server: 16384 bytes read" |
| 5140 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5141 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5142 | "$P_SRV response_size=16384" \ |
| 5143 | "$P_CLI force_version=tls1_2 \ |
| 5144 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5145 | 0 \ |
| 5146 | -c "Read from server: 16384 bytes read" |
| 5147 | |
| 5148 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5149 | "$P_SRV response_size=16384" \ |
| 5150 | "$P_CLI force_version=tls1_2 \ |
| 5151 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5152 | 0 \ |
| 5153 | -c "Read from server: 16384 bytes read" |
| 5154 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5155 | # Tests for restartable ECC |
| 5156 | |
| 5157 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5158 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5159 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5160 | "$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] | 5161 | 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] | 5162 | debug_level=1" \ |
| 5163 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5164 | -C "x509_verify_cert.*4b00" \ |
| 5165 | -C "mbedtls_pk_verify.*4b00" \ |
| 5166 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5167 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5168 | |
| 5169 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5170 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5171 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5172 | "$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] | 5173 | 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] | 5174 | debug_level=1 ec_max_ops=0" \ |
| 5175 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5176 | -C "x509_verify_cert.*4b00" \ |
| 5177 | -C "mbedtls_pk_verify.*4b00" \ |
| 5178 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5179 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5180 | |
| 5181 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5182 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5183 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5184 | "$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] | 5185 | 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] | 5186 | debug_level=1 ec_max_ops=65535" \ |
| 5187 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5188 | -C "x509_verify_cert.*4b00" \ |
| 5189 | -C "mbedtls_pk_verify.*4b00" \ |
| 5190 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5191 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5192 | |
| 5193 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5194 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5195 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5196 | "$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] | 5197 | 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] | 5198 | debug_level=1 ec_max_ops=1000" \ |
| 5199 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5200 | -c "x509_verify_cert.*4b00" \ |
| 5201 | -c "mbedtls_pk_verify.*4b00" \ |
| 5202 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5203 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5204 | |
| 5205 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5206 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5207 | "$P_SRV auth_mode=required \ |
| 5208 | crt_file=data_files/server5-badsign.crt \ |
| 5209 | key_file=data_files/server5.key" \ |
| 5210 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5211 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5212 | debug_level=1 ec_max_ops=1000" \ |
| 5213 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5214 | -c "x509_verify_cert.*4b00" \ |
| 5215 | -C "mbedtls_pk_verify.*4b00" \ |
| 5216 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5217 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5218 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5219 | -c "! mbedtls_ssl_handshake returned" \ |
| 5220 | -c "X509 - Certificate verification failed" |
| 5221 | |
| 5222 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5223 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5224 | "$P_SRV auth_mode=required \ |
| 5225 | crt_file=data_files/server5-badsign.crt \ |
| 5226 | key_file=data_files/server5.key" \ |
| 5227 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5228 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5229 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5230 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5231 | -c "x509_verify_cert.*4b00" \ |
| 5232 | -c "mbedtls_pk_verify.*4b00" \ |
| 5233 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5234 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5235 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5236 | -C "! mbedtls_ssl_handshake returned" \ |
| 5237 | -C "X509 - Certificate verification failed" |
| 5238 | |
| 5239 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5240 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5241 | "$P_SRV auth_mode=required \ |
| 5242 | crt_file=data_files/server5-badsign.crt \ |
| 5243 | key_file=data_files/server5.key" \ |
| 5244 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5245 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5246 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5247 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5248 | -C "x509_verify_cert.*4b00" \ |
| 5249 | -c "mbedtls_pk_verify.*4b00" \ |
| 5250 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5251 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5252 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5253 | -C "! mbedtls_ssl_handshake returned" \ |
| 5254 | -C "X509 - Certificate verification failed" |
| 5255 | |
| 5256 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5257 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5258 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5259 | "$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] | 5260 | 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] | 5261 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5262 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5263 | -c "x509_verify_cert.*4b00" \ |
| 5264 | -c "mbedtls_pk_verify.*4b00" \ |
| 5265 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5266 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5267 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5268 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5269 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5270 | "$P_SRV" \ |
| 5271 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5272 | debug_level=1 ec_max_ops=1000" \ |
| 5273 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5274 | -c "x509_verify_cert.*4b00" \ |
| 5275 | -c "mbedtls_pk_verify.*4b00" \ |
| 5276 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5277 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5278 | |
| 5279 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5280 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5281 | "$P_SRV psk=abc123" \ |
| 5282 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5283 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5284 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5285 | -C "x509_verify_cert.*4b00" \ |
| 5286 | -C "mbedtls_pk_verify.*4b00" \ |
| 5287 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5288 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5289 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5290 | # Tests of asynchronous private key support in SSL |
| 5291 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5292 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5293 | run_test "SSL async private: sign, delay=0" \ |
| 5294 | "$P_SRV \ |
| 5295 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5296 | "$P_CLI" \ |
| 5297 | 0 \ |
| 5298 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5299 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5300 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5301 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5302 | run_test "SSL async private: sign, delay=1" \ |
| 5303 | "$P_SRV \ |
| 5304 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5305 | "$P_CLI" \ |
| 5306 | 0 \ |
| 5307 | -s "Async sign callback: using key slot " \ |
| 5308 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5309 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5310 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5311 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5312 | run_test "SSL async private: sign, delay=2" \ |
| 5313 | "$P_SRV \ |
| 5314 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5315 | "$P_CLI" \ |
| 5316 | 0 \ |
| 5317 | -s "Async sign callback: using key slot " \ |
| 5318 | -U "Async sign callback: using key slot " \ |
| 5319 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5320 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5321 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5322 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5323 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5324 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5325 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5327 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5328 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5329 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5330 | "$P_CLI force_version=tls1_1" \ |
| 5331 | 0 \ |
| 5332 | -s "Async sign callback: using key slot " \ |
| 5333 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5334 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5335 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5336 | run_test "SSL async private: sign, SNI" \ |
| 5337 | "$P_SRV debug_level=3 \ |
| 5338 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5339 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5340 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5341 | "$P_CLI server_name=polarssl.example" \ |
| 5342 | 0 \ |
| 5343 | -s "Async sign callback: using key slot " \ |
| 5344 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5345 | -s "parse ServerName extension" \ |
| 5346 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5347 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5348 | |
| 5349 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5350 | run_test "SSL async private: decrypt, delay=0" \ |
| 5351 | "$P_SRV \ |
| 5352 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5353 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5354 | 0 \ |
| 5355 | -s "Async decrypt callback: using key slot " \ |
| 5356 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5357 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5358 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5359 | run_test "SSL async private: decrypt, delay=1" \ |
| 5360 | "$P_SRV \ |
| 5361 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5362 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5363 | 0 \ |
| 5364 | -s "Async decrypt callback: using key slot " \ |
| 5365 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5366 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5367 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5368 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5369 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5370 | "$P_SRV psk=abc123 \ |
| 5371 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5372 | "$P_CLI psk=abc123 \ |
| 5373 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5374 | 0 \ |
| 5375 | -s "Async decrypt callback: using key slot " \ |
| 5376 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5377 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5378 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5379 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5380 | "$P_SRV psk=abc123 \ |
| 5381 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5382 | "$P_CLI psk=abc123 \ |
| 5383 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5384 | 0 \ |
| 5385 | -s "Async decrypt callback: using key slot " \ |
| 5386 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5387 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5388 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5389 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5390 | run_test "SSL async private: sign callback not present" \ |
| 5391 | "$P_SRV \ |
| 5392 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5393 | "$P_CLI; [ \$? -eq 1 ] && |
| 5394 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5395 | 0 \ |
| 5396 | -S "Async sign callback" \ |
| 5397 | -s "! mbedtls_ssl_handshake returned" \ |
| 5398 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5399 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5400 | -s "Successful connection" |
| 5401 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5402 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5403 | run_test "SSL async private: decrypt callback not present" \ |
| 5404 | "$P_SRV debug_level=1 \ |
| 5405 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5406 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5407 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5408 | 0 \ |
| 5409 | -S "Async decrypt callback" \ |
| 5410 | -s "! mbedtls_ssl_handshake returned" \ |
| 5411 | -s "got no RSA private key" \ |
| 5412 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5413 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5414 | |
| 5415 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5416 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5417 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5418 | "$P_SRV \ |
| 5419 | async_operations=s async_private_delay1=1 \ |
| 5420 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5421 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5422 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5423 | 0 \ |
| 5424 | -s "Async sign callback: using key slot 0," \ |
| 5425 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5426 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5427 | |
| 5428 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5429 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5430 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5431 | "$P_SRV \ |
| 5432 | async_operations=s async_private_delay2=1 \ |
| 5433 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5434 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5435 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5436 | 0 \ |
| 5437 | -s "Async sign callback: using key slot 0," \ |
| 5438 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5439 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5440 | |
| 5441 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5442 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5443 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5444 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5445 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5446 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5447 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5448 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5449 | 0 \ |
| 5450 | -s "Async sign callback: using key slot 1," \ |
| 5451 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5452 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5453 | |
| 5454 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5455 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5456 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5457 | "$P_SRV \ |
| 5458 | async_operations=s async_private_delay1=1 \ |
| 5459 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5460 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5461 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5462 | 0 \ |
| 5463 | -s "Async sign callback: no key matches this certificate." |
| 5464 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5465 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5466 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5467 | "$P_SRV \ |
| 5468 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5469 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5470 | "$P_CLI" \ |
| 5471 | 1 \ |
| 5472 | -s "Async sign callback: injected error" \ |
| 5473 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5474 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5475 | -s "! mbedtls_ssl_handshake returned" |
| 5476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5478 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5479 | "$P_SRV \ |
| 5480 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5481 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5482 | "$P_CLI" \ |
| 5483 | 1 \ |
| 5484 | -s "Async sign callback: using key slot " \ |
| 5485 | -S "Async resume" \ |
| 5486 | -s "Async cancel" |
| 5487 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5488 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5489 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5490 | "$P_SRV \ |
| 5491 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5492 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5493 | "$P_CLI" \ |
| 5494 | 1 \ |
| 5495 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5496 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5497 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5498 | -s "! mbedtls_ssl_handshake returned" |
| 5499 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5500 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5501 | run_test "SSL async private: decrypt, error in start" \ |
| 5502 | "$P_SRV \ |
| 5503 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5504 | async_private_error=1" \ |
| 5505 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5506 | 1 \ |
| 5507 | -s "Async decrypt callback: injected error" \ |
| 5508 | -S "Async resume" \ |
| 5509 | -S "Async cancel" \ |
| 5510 | -s "! mbedtls_ssl_handshake returned" |
| 5511 | |
| 5512 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5513 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5514 | "$P_SRV \ |
| 5515 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5516 | async_private_error=2" \ |
| 5517 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5518 | 1 \ |
| 5519 | -s "Async decrypt callback: using key slot " \ |
| 5520 | -S "Async resume" \ |
| 5521 | -s "Async cancel" |
| 5522 | |
| 5523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5524 | run_test "SSL async private: decrypt, error in resume" \ |
| 5525 | "$P_SRV \ |
| 5526 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5527 | async_private_error=3" \ |
| 5528 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5529 | 1 \ |
| 5530 | -s "Async decrypt callback: using key slot " \ |
| 5531 | -s "Async resume callback: decrypt done but injected error" \ |
| 5532 | -S "Async cancel" \ |
| 5533 | -s "! mbedtls_ssl_handshake returned" |
| 5534 | |
| 5535 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5536 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5537 | "$P_SRV \ |
| 5538 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5539 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5540 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5541 | 0 \ |
| 5542 | -s "Async cancel" \ |
| 5543 | -s "! mbedtls_ssl_handshake returned" \ |
| 5544 | -s "Async resume" \ |
| 5545 | -s "Successful connection" |
| 5546 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5547 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5548 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5549 | "$P_SRV \ |
| 5550 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5551 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5552 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5553 | 0 \ |
| 5554 | -s "! mbedtls_ssl_handshake returned" \ |
| 5555 | -s "Async resume" \ |
| 5556 | -s "Successful connection" |
| 5557 | |
| 5558 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5559 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5560 | 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] | 5561 | "$P_SRV \ |
| 5562 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5563 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5564 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5565 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5566 | [ \$? -eq 1 ] && |
| 5567 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5568 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5569 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5570 | -S "Async resume" \ |
| 5571 | -s "Async cancel" \ |
| 5572 | -s "! mbedtls_ssl_handshake returned" \ |
| 5573 | -s "Async sign callback: no key matches this certificate." \ |
| 5574 | -s "Successful connection" |
| 5575 | |
| 5576 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5578 | 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] | 5579 | "$P_SRV \ |
| 5580 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5581 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5582 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5583 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5584 | [ \$? -eq 1 ] && |
| 5585 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5586 | 0 \ |
| 5587 | -s "Async resume" \ |
| 5588 | -s "! mbedtls_ssl_handshake returned" \ |
| 5589 | -s "Async sign callback: no key matches this certificate." \ |
| 5590 | -s "Successful connection" |
| 5591 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5592 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5593 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5594 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5595 | "$P_SRV \ |
| 5596 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5597 | exchanges=2 renegotiation=1" \ |
| 5598 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5599 | 0 \ |
| 5600 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5601 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5602 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5603 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5604 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5605 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5606 | "$P_SRV \ |
| 5607 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5608 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5609 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5610 | 0 \ |
| 5611 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5612 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5613 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5614 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5616 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5617 | "$P_SRV \ |
| 5618 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5619 | exchanges=2 renegotiation=1" \ |
| 5620 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5621 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5622 | 0 \ |
| 5623 | -s "Async decrypt callback: using key slot " \ |
| 5624 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5625 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5626 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5627 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5628 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5629 | "$P_SRV \ |
| 5630 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5631 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5632 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5633 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5634 | 0 \ |
| 5635 | -s "Async decrypt callback: using key slot " \ |
| 5636 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5637 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5638 | # Tests for ECC extensions (rfc 4492) |
| 5639 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5640 | requires_config_enabled MBEDTLS_AES_C |
| 5641 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5642 | requires_config_enabled MBEDTLS_SHA256_C |
| 5643 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5644 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5645 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5646 | "$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] | 5647 | 0 \ |
| 5648 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5649 | -C "client hello, adding supported_point_formats extension" \ |
| 5650 | -S "found supported elliptic curves extension" \ |
| 5651 | -S "found supported point formats extension" |
| 5652 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_AES_C |
| 5654 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5655 | requires_config_enabled MBEDTLS_SHA256_C |
| 5656 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5657 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5658 | "$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] | 5659 | "$P_CLI debug_level=3" \ |
| 5660 | 0 \ |
| 5661 | -C "found supported_point_formats extension" \ |
| 5662 | -S "server hello, supported_point_formats extension" |
| 5663 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5664 | requires_config_enabled MBEDTLS_AES_C |
| 5665 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5666 | requires_config_enabled MBEDTLS_SHA256_C |
| 5667 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5668 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5669 | "$P_SRV debug_level=3" \ |
| 5670 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5671 | 0 \ |
| 5672 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5673 | -c "client hello, adding supported_point_formats extension" \ |
| 5674 | -s "found supported elliptic curves extension" \ |
| 5675 | -s "found supported point formats extension" |
| 5676 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_AES_C |
| 5678 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5679 | requires_config_enabled MBEDTLS_SHA256_C |
| 5680 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5681 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5682 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5683 | "$P_CLI debug_level=3" \ |
| 5684 | 0 \ |
| 5685 | -c "found supported_point_formats extension" \ |
| 5686 | -s "server hello, supported_point_formats extension" |
| 5687 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5688 | # Tests for DTLS HelloVerifyRequest |
| 5689 | |
| 5690 | run_test "DTLS cookie: enabled" \ |
| 5691 | "$P_SRV dtls=1 debug_level=2" \ |
| 5692 | "$P_CLI dtls=1 debug_level=2" \ |
| 5693 | 0 \ |
| 5694 | -s "cookie verification failed" \ |
| 5695 | -s "cookie verification passed" \ |
| 5696 | -S "cookie verification skipped" \ |
| 5697 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5698 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5699 | -S "SSL - The requested feature is not available" |
| 5700 | |
| 5701 | run_test "DTLS cookie: disabled" \ |
| 5702 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5703 | "$P_CLI dtls=1 debug_level=2" \ |
| 5704 | 0 \ |
| 5705 | -S "cookie verification failed" \ |
| 5706 | -S "cookie verification passed" \ |
| 5707 | -s "cookie verification skipped" \ |
| 5708 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5709 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5710 | -S "SSL - The requested feature is not available" |
| 5711 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5712 | run_test "DTLS cookie: default (failing)" \ |
| 5713 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5714 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5715 | 1 \ |
| 5716 | -s "cookie verification failed" \ |
| 5717 | -S "cookie verification passed" \ |
| 5718 | -S "cookie verification skipped" \ |
| 5719 | -C "received hello verify request" \ |
| 5720 | -S "hello verification requested" \ |
| 5721 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5722 | |
| 5723 | requires_ipv6 |
| 5724 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5725 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5726 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5727 | 0 \ |
| 5728 | -s "cookie verification failed" \ |
| 5729 | -s "cookie verification passed" \ |
| 5730 | -S "cookie verification skipped" \ |
| 5731 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5732 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5733 | -S "SSL - The requested feature is not available" |
| 5734 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5735 | run_test "DTLS cookie: enabled, nbio" \ |
| 5736 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5737 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5738 | 0 \ |
| 5739 | -s "cookie verification failed" \ |
| 5740 | -s "cookie verification passed" \ |
| 5741 | -S "cookie verification skipped" \ |
| 5742 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5743 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5744 | -S "SSL - The requested feature is not available" |
| 5745 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5746 | # Tests for client reconnecting from the same port with DTLS |
| 5747 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5748 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5749 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5750 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 5751 | "$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] | 5752 | 0 \ |
| 5753 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5754 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5755 | -S "Client initiated reconnection from same port" |
| 5756 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5757 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5758 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5759 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 5760 | "$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] | 5761 | 0 \ |
| 5762 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5763 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5764 | -s "Client initiated reconnection from same port" |
| 5765 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5766 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 5767 | 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] | 5768 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 5769 | "$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] | 5770 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5771 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5772 | -s "Client initiated reconnection from same port" |
| 5773 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5774 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 5775 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 5776 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 5777 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 5778 | 0 \ |
| 5779 | -S "The operation timed out" \ |
| 5780 | -s "Client initiated reconnection from same port" |
| 5781 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5782 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 5783 | "$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] | 5784 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 5785 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5786 | -s "The operation timed out" \ |
| 5787 | -S "Client initiated reconnection from same port" |
| 5788 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5789 | # Tests for various cases of client authentication with DTLS |
| 5790 | # (focused on handshake flows and message parsing) |
| 5791 | |
| 5792 | run_test "DTLS client auth: required" \ |
| 5793 | "$P_SRV dtls=1 auth_mode=required" \ |
| 5794 | "$P_CLI dtls=1" \ |
| 5795 | 0 \ |
| 5796 | -s "Verifying peer X.509 certificate... ok" |
| 5797 | |
| 5798 | run_test "DTLS client auth: optional, client has no cert" \ |
| 5799 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 5800 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 5801 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5802 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5803 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5804 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5805 | "$P_SRV dtls=1 auth_mode=none" \ |
| 5806 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 5807 | 0 \ |
| 5808 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5809 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5810 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 5811 | run_test "DTLS wrong PSK: badmac alert" \ |
| 5812 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 5813 | "$P_CLI dtls=1 psk=abc124" \ |
| 5814 | 1 \ |
| 5815 | -s "SSL - Verification of the message MAC failed" \ |
| 5816 | -c "SSL - A fatal alert message was received from our peer" |
| 5817 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 5818 | # Tests for receiving fragmented handshake messages with DTLS |
| 5819 | |
| 5820 | requires_gnutls |
| 5821 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 5822 | "$G_SRV -u --mtu 2048 -a" \ |
| 5823 | "$P_CLI dtls=1 debug_level=2" \ |
| 5824 | 0 \ |
| 5825 | -C "found fragmented DTLS handshake message" \ |
| 5826 | -C "error" |
| 5827 | |
| 5828 | requires_gnutls |
| 5829 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 5830 | "$G_SRV -u --mtu 512" \ |
| 5831 | "$P_CLI dtls=1 debug_level=2" \ |
| 5832 | 0 \ |
| 5833 | -c "found fragmented DTLS handshake message" \ |
| 5834 | -C "error" |
| 5835 | |
| 5836 | requires_gnutls |
| 5837 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 5838 | "$G_SRV -u --mtu 128" \ |
| 5839 | "$P_CLI dtls=1 debug_level=2" \ |
| 5840 | 0 \ |
| 5841 | -c "found fragmented DTLS handshake message" \ |
| 5842 | -C "error" |
| 5843 | |
| 5844 | requires_gnutls |
| 5845 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 5846 | "$G_SRV -u --mtu 128" \ |
| 5847 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5848 | 0 \ |
| 5849 | -c "found fragmented DTLS handshake message" \ |
| 5850 | -C "error" |
| 5851 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5852 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5854 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 5855 | "$G_SRV -u --mtu 256" \ |
| 5856 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 5857 | 0 \ |
| 5858 | -c "found fragmented DTLS handshake message" \ |
| 5859 | -c "client hello, adding renegotiation extension" \ |
| 5860 | -c "found renegotiation extension" \ |
| 5861 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5862 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5863 | -C "error" \ |
| 5864 | -s "Extra-header:" |
| 5865 | |
| 5866 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5868 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 5869 | "$G_SRV -u --mtu 256" \ |
| 5870 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 5871 | 0 \ |
| 5872 | -c "found fragmented DTLS handshake message" \ |
| 5873 | -c "client hello, adding renegotiation extension" \ |
| 5874 | -c "found renegotiation extension" \ |
| 5875 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5876 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5877 | -C "error" \ |
| 5878 | -s "Extra-header:" |
| 5879 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5880 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 5881 | "$O_SRV -dtls1 -mtu 2048" \ |
| 5882 | "$P_CLI dtls=1 debug_level=2" \ |
| 5883 | 0 \ |
| 5884 | -C "found fragmented DTLS handshake message" \ |
| 5885 | -C "error" |
| 5886 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5887 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 5888 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5889 | "$P_CLI dtls=1 debug_level=2" \ |
| 5890 | 0 \ |
| 5891 | -c "found fragmented DTLS handshake message" \ |
| 5892 | -C "error" |
| 5893 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5894 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5895 | "$O_SRV -dtls1 -mtu 256" \ |
| 5896 | "$P_CLI dtls=1 debug_level=2" \ |
| 5897 | 0 \ |
| 5898 | -c "found fragmented DTLS handshake message" \ |
| 5899 | -C "error" |
| 5900 | |
| 5901 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 5902 | "$O_SRV -dtls1 -mtu 256" \ |
| 5903 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5904 | 0 \ |
| 5905 | -c "found fragmented DTLS handshake message" \ |
| 5906 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5907 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5908 | # Tests for sending fragmented handshake messages with DTLS |
| 5909 | # |
| 5910 | # Use client auth when we need the client to send large messages, |
| 5911 | # and use large cert chains on both sides too (the long chains we have all use |
| 5912 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 5913 | # Sizes reached (UDP payload): |
| 5914 | # - 2037B for server certificate |
| 5915 | # - 1542B for client certificate |
| 5916 | # - 1013B for newsessionticket |
| 5917 | # - all others below 512B |
| 5918 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 5919 | |
| 5920 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5921 | requires_config_enabled MBEDTLS_RSA_C |
| 5922 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5923 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5924 | run_test "DTLS fragmenting: none (for reference)" \ |
| 5925 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5926 | crt_file=data_files/server7_int-ca.crt \ |
| 5927 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5928 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5929 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5930 | "$P_CLI dtls=1 debug_level=2 \ |
| 5931 | crt_file=data_files/server8_int-ca2.crt \ |
| 5932 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5933 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5934 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5935 | 0 \ |
| 5936 | -S "found fragmented DTLS handshake message" \ |
| 5937 | -C "found fragmented DTLS handshake message" \ |
| 5938 | -C "error" |
| 5939 | |
| 5940 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5941 | requires_config_enabled MBEDTLS_RSA_C |
| 5942 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5943 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5944 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5945 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5946 | crt_file=data_files/server7_int-ca.crt \ |
| 5947 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5948 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5949 | max_frag_len=1024" \ |
| 5950 | "$P_CLI dtls=1 debug_level=2 \ |
| 5951 | crt_file=data_files/server8_int-ca2.crt \ |
| 5952 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5953 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5954 | max_frag_len=2048" \ |
| 5955 | 0 \ |
| 5956 | -S "found fragmented DTLS handshake message" \ |
| 5957 | -c "found fragmented DTLS handshake message" \ |
| 5958 | -C "error" |
| 5959 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5960 | # With the MFL extension, the server has no way of forcing |
| 5961 | # the client to not exceed a certain MTU; hence, the following |
| 5962 | # test can't be replicated with an MTU proxy such as the one |
| 5963 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5964 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5965 | requires_config_enabled MBEDTLS_RSA_C |
| 5966 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5967 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5968 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5969 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5970 | crt_file=data_files/server7_int-ca.crt \ |
| 5971 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5972 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5973 | max_frag_len=512" \ |
| 5974 | "$P_CLI dtls=1 debug_level=2 \ |
| 5975 | crt_file=data_files/server8_int-ca2.crt \ |
| 5976 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5977 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5978 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5979 | 0 \ |
| 5980 | -S "found fragmented DTLS handshake message" \ |
| 5981 | -c "found fragmented DTLS handshake message" \ |
| 5982 | -C "error" |
| 5983 | |
| 5984 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5985 | requires_config_enabled MBEDTLS_RSA_C |
| 5986 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5987 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5988 | 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] | 5989 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 5990 | crt_file=data_files/server7_int-ca.crt \ |
| 5991 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5992 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5993 | max_frag_len=2048" \ |
| 5994 | "$P_CLI dtls=1 debug_level=2 \ |
| 5995 | crt_file=data_files/server8_int-ca2.crt \ |
| 5996 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5997 | hs_timeout=2500-60000 \ |
| 5998 | max_frag_len=1024" \ |
| 5999 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6000 | -S "found fragmented DTLS handshake message" \ |
| 6001 | -c "found fragmented DTLS handshake message" \ |
| 6002 | -C "error" |
| 6003 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6004 | # While not required by the standard defining the MFL extension |
| 6005 | # (according to which it only applies to records, not to datagrams), |
| 6006 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6007 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6008 | # to the peer. |
| 6009 | # The next test checks that no datagrams significantly larger than the |
| 6010 | # negotiated MFL are sent. |
| 6011 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6012 | requires_config_enabled MBEDTLS_RSA_C |
| 6013 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6014 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6015 | 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] | 6016 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6017 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6018 | crt_file=data_files/server7_int-ca.crt \ |
| 6019 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6020 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6021 | max_frag_len=2048" \ |
| 6022 | "$P_CLI dtls=1 debug_level=2 \ |
| 6023 | crt_file=data_files/server8_int-ca2.crt \ |
| 6024 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6025 | hs_timeout=2500-60000 \ |
| 6026 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6027 | 0 \ |
| 6028 | -S "found fragmented DTLS handshake message" \ |
| 6029 | -c "found fragmented DTLS handshake message" \ |
| 6030 | -C "error" |
| 6031 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6032 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6033 | requires_config_enabled MBEDTLS_RSA_C |
| 6034 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6035 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6036 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6037 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6038 | crt_file=data_files/server7_int-ca.crt \ |
| 6039 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6040 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6041 | max_frag_len=2048" \ |
| 6042 | "$P_CLI dtls=1 debug_level=2 \ |
| 6043 | crt_file=data_files/server8_int-ca2.crt \ |
| 6044 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6045 | hs_timeout=2500-60000 \ |
| 6046 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6047 | 0 \ |
| 6048 | -s "found fragmented DTLS handshake message" \ |
| 6049 | -c "found fragmented DTLS handshake message" \ |
| 6050 | -C "error" |
| 6051 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6052 | # While not required by the standard defining the MFL extension |
| 6053 | # (according to which it only applies to records, not to datagrams), |
| 6054 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6055 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6056 | # to the peer. |
| 6057 | # The next test checks that no datagrams significantly larger than the |
| 6058 | # negotiated MFL are sent. |
| 6059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6060 | requires_config_enabled MBEDTLS_RSA_C |
| 6061 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6062 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6063 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6064 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6065 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6066 | crt_file=data_files/server7_int-ca.crt \ |
| 6067 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6068 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6069 | max_frag_len=2048" \ |
| 6070 | "$P_CLI dtls=1 debug_level=2 \ |
| 6071 | crt_file=data_files/server8_int-ca2.crt \ |
| 6072 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6073 | hs_timeout=2500-60000 \ |
| 6074 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6075 | 0 \ |
| 6076 | -s "found fragmented DTLS handshake message" \ |
| 6077 | -c "found fragmented DTLS handshake message" \ |
| 6078 | -C "error" |
| 6079 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6080 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6081 | requires_config_enabled MBEDTLS_RSA_C |
| 6082 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6083 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6084 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6085 | crt_file=data_files/server7_int-ca.crt \ |
| 6086 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6087 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6088 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6089 | "$P_CLI dtls=1 debug_level=2 \ |
| 6090 | crt_file=data_files/server8_int-ca2.crt \ |
| 6091 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6092 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6093 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6094 | 0 \ |
| 6095 | -S "found fragmented DTLS handshake message" \ |
| 6096 | -C "found fragmented DTLS handshake message" \ |
| 6097 | -C "error" |
| 6098 | |
| 6099 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6100 | requires_config_enabled MBEDTLS_RSA_C |
| 6101 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6102 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6104 | crt_file=data_files/server7_int-ca.crt \ |
| 6105 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6106 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6107 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6108 | "$P_CLI dtls=1 debug_level=2 \ |
| 6109 | crt_file=data_files/server8_int-ca2.crt \ |
| 6110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6111 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6112 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6113 | 0 \ |
| 6114 | -s "found fragmented DTLS handshake message" \ |
| 6115 | -C "found fragmented DTLS handshake message" \ |
| 6116 | -C "error" |
| 6117 | |
| 6118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6119 | requires_config_enabled MBEDTLS_RSA_C |
| 6120 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6121 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6122 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6123 | crt_file=data_files/server7_int-ca.crt \ |
| 6124 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6125 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6126 | mtu=512" \ |
| 6127 | "$P_CLI dtls=1 debug_level=2 \ |
| 6128 | crt_file=data_files/server8_int-ca2.crt \ |
| 6129 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6130 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6131 | mtu=2048" \ |
| 6132 | 0 \ |
| 6133 | -S "found fragmented DTLS handshake message" \ |
| 6134 | -c "found fragmented DTLS handshake message" \ |
| 6135 | -C "error" |
| 6136 | |
| 6137 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6138 | requires_config_enabled MBEDTLS_RSA_C |
| 6139 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6140 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6141 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6142 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6143 | crt_file=data_files/server7_int-ca.crt \ |
| 6144 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6145 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6146 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6147 | "$P_CLI dtls=1 debug_level=2 \ |
| 6148 | crt_file=data_files/server8_int-ca2.crt \ |
| 6149 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6150 | hs_timeout=2500-60000 \ |
| 6151 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6152 | 0 \ |
| 6153 | -s "found fragmented DTLS handshake message" \ |
| 6154 | -c "found fragmented DTLS handshake message" \ |
| 6155 | -C "error" |
| 6156 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6157 | # 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] | 6158 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6159 | requires_config_enabled MBEDTLS_RSA_C |
| 6160 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6161 | requires_config_enabled MBEDTLS_SHA256_C |
| 6162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6163 | requires_config_enabled MBEDTLS_AES_C |
| 6164 | requires_config_enabled MBEDTLS_GCM_C |
| 6165 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6166 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6167 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6168 | crt_file=data_files/server7_int-ca.crt \ |
| 6169 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6170 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6171 | mtu=512" \ |
| 6172 | "$P_CLI dtls=1 debug_level=2 \ |
| 6173 | crt_file=data_files/server8_int-ca2.crt \ |
| 6174 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6175 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6176 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6177 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6178 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6179 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6180 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6181 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6182 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6183 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6184 | # 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] | 6185 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6186 | # retransmissions, but in some cases (like both the server and client using |
| 6187 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6188 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6189 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6191 | requires_config_enabled MBEDTLS_RSA_C |
| 6192 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6193 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6194 | requires_config_enabled MBEDTLS_AES_C |
| 6195 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6196 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6197 | -p "$P_PXY mtu=508" \ |
| 6198 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6199 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6200 | key_file=data_files/server7.key \ |
| 6201 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6202 | "$P_CLI dtls=1 debug_level=2 \ |
| 6203 | crt_file=data_files/server8_int-ca2.crt \ |
| 6204 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6205 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6206 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6207 | 0 \ |
| 6208 | -s "found fragmented DTLS handshake message" \ |
| 6209 | -c "found fragmented DTLS handshake message" \ |
| 6210 | -C "error" |
| 6211 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6212 | # 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] | 6213 | only_with_valgrind |
| 6214 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6215 | requires_config_enabled MBEDTLS_RSA_C |
| 6216 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6218 | requires_config_enabled MBEDTLS_AES_C |
| 6219 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6220 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6221 | -p "$P_PXY mtu=508" \ |
| 6222 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6223 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6224 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6225 | hs_timeout=250-10000" \ |
| 6226 | "$P_CLI dtls=1 debug_level=2 \ |
| 6227 | crt_file=data_files/server8_int-ca2.crt \ |
| 6228 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6229 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6230 | hs_timeout=250-10000" \ |
| 6231 | 0 \ |
| 6232 | -s "found fragmented DTLS handshake message" \ |
| 6233 | -c "found fragmented DTLS handshake message" \ |
| 6234 | -C "error" |
| 6235 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6236 | # 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] | 6237 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6238 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6239 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6241 | requires_config_enabled MBEDTLS_RSA_C |
| 6242 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6243 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6244 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6245 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6246 | crt_file=data_files/server7_int-ca.crt \ |
| 6247 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6248 | hs_timeout=10000-60000 \ |
| 6249 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6250 | "$P_CLI dtls=1 debug_level=2 \ |
| 6251 | crt_file=data_files/server8_int-ca2.crt \ |
| 6252 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6253 | hs_timeout=10000-60000 \ |
| 6254 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6255 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6256 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6257 | -s "found fragmented DTLS handshake message" \ |
| 6258 | -c "found fragmented DTLS handshake message" \ |
| 6259 | -C "error" |
| 6260 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6261 | # 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] | 6262 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6263 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6264 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6265 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6266 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6267 | requires_config_enabled MBEDTLS_RSA_C |
| 6268 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6270 | requires_config_enabled MBEDTLS_AES_C |
| 6271 | requires_config_enabled MBEDTLS_GCM_C |
| 6272 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6273 | -p "$P_PXY mtu=512" \ |
| 6274 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6275 | crt_file=data_files/server7_int-ca.crt \ |
| 6276 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6277 | hs_timeout=10000-60000 \ |
| 6278 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6279 | "$P_CLI dtls=1 debug_level=2 \ |
| 6280 | crt_file=data_files/server8_int-ca2.crt \ |
| 6281 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6282 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6283 | hs_timeout=10000-60000 \ |
| 6284 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6285 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6286 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6287 | -s "found fragmented DTLS handshake message" \ |
| 6288 | -c "found fragmented DTLS handshake message" \ |
| 6289 | -C "error" |
| 6290 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6291 | not_with_valgrind # spurious autoreduction due to timeout |
| 6292 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6293 | requires_config_enabled MBEDTLS_RSA_C |
| 6294 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6295 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6296 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6297 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6298 | crt_file=data_files/server7_int-ca.crt \ |
| 6299 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6300 | hs_timeout=10000-60000 \ |
| 6301 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6302 | "$P_CLI dtls=1 debug_level=2 \ |
| 6303 | crt_file=data_files/server8_int-ca2.crt \ |
| 6304 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6305 | hs_timeout=10000-60000 \ |
| 6306 | mtu=1024 nbio=2" \ |
| 6307 | 0 \ |
| 6308 | -S "autoreduction" \ |
| 6309 | -s "found fragmented DTLS handshake message" \ |
| 6310 | -c "found fragmented DTLS handshake message" \ |
| 6311 | -C "error" |
| 6312 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6313 | # 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] | 6314 | not_with_valgrind # spurious autoreduction due to timeout |
| 6315 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6316 | requires_config_enabled MBEDTLS_RSA_C |
| 6317 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6318 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6319 | requires_config_enabled MBEDTLS_AES_C |
| 6320 | requires_config_enabled MBEDTLS_GCM_C |
| 6321 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6322 | -p "$P_PXY mtu=512" \ |
| 6323 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6324 | crt_file=data_files/server7_int-ca.crt \ |
| 6325 | key_file=data_files/server7.key \ |
| 6326 | hs_timeout=10000-60000 \ |
| 6327 | mtu=512 nbio=2" \ |
| 6328 | "$P_CLI dtls=1 debug_level=2 \ |
| 6329 | crt_file=data_files/server8_int-ca2.crt \ |
| 6330 | key_file=data_files/server8.key \ |
| 6331 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6332 | hs_timeout=10000-60000 \ |
| 6333 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6334 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6335 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6336 | -s "found fragmented DTLS handshake message" \ |
| 6337 | -c "found fragmented DTLS handshake message" \ |
| 6338 | -C "error" |
| 6339 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6340 | # 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] | 6341 | # This ensures things still work after session_reset(). |
| 6342 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6343 | # Since we don't support reading fragmented ClientHello yet, |
| 6344 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6345 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6346 | # An autoreduction on the client-side might happen if the server is |
| 6347 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6348 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6349 | # resumed listening, which would result in a spurious autoreduction. |
| 6350 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6351 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6352 | requires_config_enabled MBEDTLS_RSA_C |
| 6353 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6354 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6355 | requires_config_enabled MBEDTLS_AES_C |
| 6356 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6357 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6358 | -p "$P_PXY mtu=1450" \ |
| 6359 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6360 | crt_file=data_files/server7_int-ca.crt \ |
| 6361 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6362 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6363 | mtu=1450" \ |
| 6364 | "$P_CLI dtls=1 debug_level=2 \ |
| 6365 | crt_file=data_files/server8_int-ca2.crt \ |
| 6366 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6367 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6368 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6369 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6370 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6371 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6372 | -s "found fragmented DTLS handshake message" \ |
| 6373 | -c "found fragmented DTLS handshake message" \ |
| 6374 | -C "error" |
| 6375 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6376 | # An autoreduction on the client-side might happen if the server is |
| 6377 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6378 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6379 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6380 | requires_config_enabled MBEDTLS_RSA_C |
| 6381 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6382 | requires_config_enabled MBEDTLS_SHA256_C |
| 6383 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6385 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6386 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6387 | -p "$P_PXY mtu=512" \ |
| 6388 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6389 | crt_file=data_files/server7_int-ca.crt \ |
| 6390 | key_file=data_files/server7.key \ |
| 6391 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6392 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6393 | mtu=512" \ |
| 6394 | "$P_CLI dtls=1 debug_level=2 \ |
| 6395 | crt_file=data_files/server8_int-ca2.crt \ |
| 6396 | key_file=data_files/server8.key \ |
| 6397 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6398 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6399 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6400 | mtu=512" \ |
| 6401 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6402 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6403 | -s "found fragmented DTLS handshake message" \ |
| 6404 | -c "found fragmented DTLS handshake message" \ |
| 6405 | -C "error" |
| 6406 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6407 | # An autoreduction on the client-side might happen if the server is |
| 6408 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6409 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6410 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6411 | requires_config_enabled MBEDTLS_RSA_C |
| 6412 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6413 | requires_config_enabled MBEDTLS_SHA256_C |
| 6414 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6415 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6416 | requires_config_enabled MBEDTLS_AES_C |
| 6417 | requires_config_enabled MBEDTLS_GCM_C |
| 6418 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6419 | -p "$P_PXY mtu=512" \ |
| 6420 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6421 | crt_file=data_files/server7_int-ca.crt \ |
| 6422 | key_file=data_files/server7.key \ |
| 6423 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6424 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6425 | mtu=512" \ |
| 6426 | "$P_CLI dtls=1 debug_level=2 \ |
| 6427 | crt_file=data_files/server8_int-ca2.crt \ |
| 6428 | key_file=data_files/server8.key \ |
| 6429 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6430 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6431 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6432 | mtu=512" \ |
| 6433 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6434 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6435 | -s "found fragmented DTLS handshake message" \ |
| 6436 | -c "found fragmented DTLS handshake message" \ |
| 6437 | -C "error" |
| 6438 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6439 | # An autoreduction on the client-side might happen if the server is |
| 6440 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6441 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6442 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6443 | requires_config_enabled MBEDTLS_RSA_C |
| 6444 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6445 | requires_config_enabled MBEDTLS_SHA256_C |
| 6446 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6447 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6448 | requires_config_enabled MBEDTLS_AES_C |
| 6449 | requires_config_enabled MBEDTLS_CCM_C |
| 6450 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6451 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6452 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6453 | crt_file=data_files/server7_int-ca.crt \ |
| 6454 | key_file=data_files/server7.key \ |
| 6455 | exchanges=2 renegotiation=1 \ |
| 6456 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6457 | hs_timeout=10000-60000 \ |
| 6458 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6459 | "$P_CLI dtls=1 debug_level=2 \ |
| 6460 | crt_file=data_files/server8_int-ca2.crt \ |
| 6461 | key_file=data_files/server8.key \ |
| 6462 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6463 | hs_timeout=10000-60000 \ |
| 6464 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6465 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6466 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6467 | -s "found fragmented DTLS handshake message" \ |
| 6468 | -c "found fragmented DTLS handshake message" \ |
| 6469 | -C "error" |
| 6470 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6471 | # An autoreduction on the client-side might happen if the server is |
| 6472 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6473 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6475 | requires_config_enabled MBEDTLS_RSA_C |
| 6476 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6477 | requires_config_enabled MBEDTLS_SHA256_C |
| 6478 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6479 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6480 | requires_config_enabled MBEDTLS_AES_C |
| 6481 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6482 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 6483 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6484 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6485 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6486 | crt_file=data_files/server7_int-ca.crt \ |
| 6487 | key_file=data_files/server7.key \ |
| 6488 | exchanges=2 renegotiation=1 \ |
| 6489 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6490 | hs_timeout=10000-60000 \ |
| 6491 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6492 | "$P_CLI dtls=1 debug_level=2 \ |
| 6493 | crt_file=data_files/server8_int-ca2.crt \ |
| 6494 | key_file=data_files/server8.key \ |
| 6495 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6496 | hs_timeout=10000-60000 \ |
| 6497 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6498 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6499 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6500 | -s "found fragmented DTLS handshake message" \ |
| 6501 | -c "found fragmented DTLS handshake message" \ |
| 6502 | -C "error" |
| 6503 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6504 | # An autoreduction on the client-side might happen if the server is |
| 6505 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6506 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6508 | requires_config_enabled MBEDTLS_RSA_C |
| 6509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6510 | requires_config_enabled MBEDTLS_SHA256_C |
| 6511 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6513 | requires_config_enabled MBEDTLS_AES_C |
| 6514 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6515 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6516 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6517 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6518 | crt_file=data_files/server7_int-ca.crt \ |
| 6519 | key_file=data_files/server7.key \ |
| 6520 | exchanges=2 renegotiation=1 \ |
| 6521 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6522 | hs_timeout=10000-60000 \ |
| 6523 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6524 | "$P_CLI dtls=1 debug_level=2 \ |
| 6525 | crt_file=data_files/server8_int-ca2.crt \ |
| 6526 | key_file=data_files/server8.key \ |
| 6527 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6528 | hs_timeout=10000-60000 \ |
| 6529 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6530 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6531 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6532 | -s "found fragmented DTLS handshake message" \ |
| 6533 | -c "found fragmented DTLS handshake message" \ |
| 6534 | -C "error" |
| 6535 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6536 | # 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] | 6537 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6538 | requires_config_enabled MBEDTLS_RSA_C |
| 6539 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6540 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6541 | requires_config_enabled MBEDTLS_AES_C |
| 6542 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6543 | client_needs_more_time 2 |
| 6544 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6545 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6546 | "$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] | 6547 | crt_file=data_files/server7_int-ca.crt \ |
| 6548 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6549 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6550 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6551 | crt_file=data_files/server8_int-ca2.crt \ |
| 6552 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6553 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6554 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6555 | 0 \ |
| 6556 | -s "found fragmented DTLS handshake message" \ |
| 6557 | -c "found fragmented DTLS handshake message" \ |
| 6558 | -C "error" |
| 6559 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6560 | # 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] | 6561 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6562 | requires_config_enabled MBEDTLS_RSA_C |
| 6563 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6564 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6565 | requires_config_enabled MBEDTLS_AES_C |
| 6566 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6567 | client_needs_more_time 2 |
| 6568 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6569 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 6570 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6571 | crt_file=data_files/server7_int-ca.crt \ |
| 6572 | key_file=data_files/server7.key \ |
| 6573 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6574 | "$P_CLI dtls=1 debug_level=2 \ |
| 6575 | crt_file=data_files/server8_int-ca2.crt \ |
| 6576 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6577 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6578 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6579 | 0 \ |
| 6580 | -s "found fragmented DTLS handshake message" \ |
| 6581 | -c "found fragmented DTLS handshake message" \ |
| 6582 | -C "error" |
| 6583 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6584 | # interop tests for DTLS fragmentating with reliable connection |
| 6585 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6586 | # here and below we just want to test that the we fragment in a way that |
| 6587 | # pleases other implementations, so we don't need the peer to fragment |
| 6588 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6589 | requires_config_enabled MBEDTLS_RSA_C |
| 6590 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6592 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6593 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6594 | "$G_SRV -u" \ |
| 6595 | "$P_CLI dtls=1 debug_level=2 \ |
| 6596 | crt_file=data_files/server8_int-ca2.crt \ |
| 6597 | key_file=data_files/server8.key \ |
| 6598 | mtu=512 force_version=dtls1_2" \ |
| 6599 | 0 \ |
| 6600 | -c "fragmenting handshake message" \ |
| 6601 | -C "error" |
| 6602 | |
| 6603 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6604 | requires_config_enabled MBEDTLS_RSA_C |
| 6605 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6607 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6608 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6609 | "$G_SRV -u" \ |
| 6610 | "$P_CLI dtls=1 debug_level=2 \ |
| 6611 | crt_file=data_files/server8_int-ca2.crt \ |
| 6612 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6613 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6614 | 0 \ |
| 6615 | -c "fragmenting handshake message" \ |
| 6616 | -C "error" |
| 6617 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6618 | # We use --insecure for the GnuTLS client because it expects |
| 6619 | # the hostname / IP it connects to to be the name used in the |
| 6620 | # certificate obtained from the server. Here, however, it |
| 6621 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6622 | # as the server name in the certificate. This will make the |
| 6623 | # certifiate validation fail, but passing --insecure makes |
| 6624 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6625 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6626 | requires_config_enabled MBEDTLS_RSA_C |
| 6627 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6628 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6629 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6630 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6631 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6632 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6633 | crt_file=data_files/server7_int-ca.crt \ |
| 6634 | key_file=data_files/server7.key \ |
| 6635 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6636 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6637 | 0 \ |
| 6638 | -s "fragmenting handshake message" |
| 6639 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6640 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6642 | requires_config_enabled MBEDTLS_RSA_C |
| 6643 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6645 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6646 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6647 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6648 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6649 | crt_file=data_files/server7_int-ca.crt \ |
| 6650 | key_file=data_files/server7.key \ |
| 6651 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6652 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6653 | 0 \ |
| 6654 | -s "fragmenting handshake message" |
| 6655 | |
| 6656 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6657 | requires_config_enabled MBEDTLS_RSA_C |
| 6658 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6659 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6660 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6661 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6662 | "$P_CLI dtls=1 debug_level=2 \ |
| 6663 | crt_file=data_files/server8_int-ca2.crt \ |
| 6664 | key_file=data_files/server8.key \ |
| 6665 | mtu=512 force_version=dtls1_2" \ |
| 6666 | 0 \ |
| 6667 | -c "fragmenting handshake message" \ |
| 6668 | -C "error" |
| 6669 | |
| 6670 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6671 | requires_config_enabled MBEDTLS_RSA_C |
| 6672 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6673 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6674 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6675 | "$O_SRV -dtls1 -verify 10" \ |
| 6676 | "$P_CLI dtls=1 debug_level=2 \ |
| 6677 | crt_file=data_files/server8_int-ca2.crt \ |
| 6678 | key_file=data_files/server8.key \ |
| 6679 | mtu=512 force_version=dtls1" \ |
| 6680 | 0 \ |
| 6681 | -c "fragmenting handshake message" \ |
| 6682 | -C "error" |
| 6683 | |
| 6684 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6685 | requires_config_enabled MBEDTLS_RSA_C |
| 6686 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6687 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6688 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6689 | "$P_SRV dtls=1 debug_level=2 \ |
| 6690 | crt_file=data_files/server7_int-ca.crt \ |
| 6691 | key_file=data_files/server7.key \ |
| 6692 | mtu=512 force_version=dtls1_2" \ |
| 6693 | "$O_CLI -dtls1_2" \ |
| 6694 | 0 \ |
| 6695 | -s "fragmenting handshake message" |
| 6696 | |
| 6697 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6698 | requires_config_enabled MBEDTLS_RSA_C |
| 6699 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6700 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6701 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6702 | "$P_SRV dtls=1 debug_level=2 \ |
| 6703 | crt_file=data_files/server7_int-ca.crt \ |
| 6704 | key_file=data_files/server7.key \ |
| 6705 | mtu=512 force_version=dtls1" \ |
| 6706 | "$O_CLI -dtls1" \ |
| 6707 | 0 \ |
| 6708 | -s "fragmenting handshake message" |
| 6709 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6710 | # interop tests for DTLS fragmentating with unreliable connection |
| 6711 | # |
| 6712 | # again we just want to test that the we fragment in a way that |
| 6713 | # pleases other implementations, so we don't need the peer to fragment |
| 6714 | requires_gnutls_next |
| 6715 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6716 | requires_config_enabled MBEDTLS_RSA_C |
| 6717 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6719 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6720 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6721 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6722 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6723 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6724 | crt_file=data_files/server8_int-ca2.crt \ |
| 6725 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6726 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6727 | 0 \ |
| 6728 | -c "fragmenting handshake message" \ |
| 6729 | -C "error" |
| 6730 | |
| 6731 | requires_gnutls_next |
| 6732 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6733 | requires_config_enabled MBEDTLS_RSA_C |
| 6734 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6736 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6737 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6738 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6739 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6740 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6741 | crt_file=data_files/server8_int-ca2.crt \ |
| 6742 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6743 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6744 | 0 \ |
| 6745 | -c "fragmenting handshake message" \ |
| 6746 | -C "error" |
| 6747 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6748 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6749 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6750 | requires_config_enabled MBEDTLS_RSA_C |
| 6751 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6753 | client_needs_more_time 4 |
| 6754 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 6755 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6756 | "$P_SRV dtls=1 debug_level=2 \ |
| 6757 | crt_file=data_files/server7_int-ca.crt \ |
| 6758 | key_file=data_files/server7.key \ |
| 6759 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6760 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6761 | 0 \ |
| 6762 | -s "fragmenting handshake message" |
| 6763 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6764 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6766 | requires_config_enabled MBEDTLS_RSA_C |
| 6767 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6769 | client_needs_more_time 4 |
| 6770 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 6771 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6772 | "$P_SRV dtls=1 debug_level=2 \ |
| 6773 | crt_file=data_files/server7_int-ca.crt \ |
| 6774 | key_file=data_files/server7.key \ |
| 6775 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6776 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6777 | 0 \ |
| 6778 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6779 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6780 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 6781 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6782 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6783 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 6784 | ## (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] | 6785 | skip_next_test |
| 6786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6787 | requires_config_enabled MBEDTLS_RSA_C |
| 6788 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6789 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6790 | client_needs_more_time 4 |
| 6791 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 6792 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6793 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6794 | "$P_CLI dtls=1 debug_level=2 \ |
| 6795 | crt_file=data_files/server8_int-ca2.crt \ |
| 6796 | key_file=data_files/server8.key \ |
| 6797 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6798 | 0 \ |
| 6799 | -c "fragmenting handshake message" \ |
| 6800 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6801 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6802 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6803 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6804 | requires_config_enabled MBEDTLS_RSA_C |
| 6805 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6806 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6807 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6808 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 6809 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6810 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6811 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6812 | crt_file=data_files/server8_int-ca2.crt \ |
| 6813 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6814 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6815 | 0 \ |
| 6816 | -c "fragmenting handshake message" \ |
| 6817 | -C "error" |
| 6818 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6819 | skip_next_test |
| 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6821 | requires_config_enabled MBEDTLS_RSA_C |
| 6822 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6824 | client_needs_more_time 4 |
| 6825 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 6826 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6827 | "$P_SRV dtls=1 debug_level=2 \ |
| 6828 | crt_file=data_files/server7_int-ca.crt \ |
| 6829 | key_file=data_files/server7.key \ |
| 6830 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6831 | "$O_CLI -dtls1_2" \ |
| 6832 | 0 \ |
| 6833 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6834 | |
| 6835 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 6836 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6837 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6839 | requires_config_enabled MBEDTLS_RSA_C |
| 6840 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6841 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6842 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6843 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 6844 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6845 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6846 | crt_file=data_files/server7_int-ca.crt \ |
| 6847 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6848 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6849 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6850 | 0 \ |
| 6851 | -s "fragmenting handshake message" |
| 6852 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6853 | # Tests for specific things with "unreliable" UDP connection |
| 6854 | |
| 6855 | not_with_valgrind # spurious resend due to timeout |
| 6856 | run_test "DTLS proxy: reference" \ |
| 6857 | -p "$P_PXY" \ |
| 6858 | "$P_SRV dtls=1 debug_level=2" \ |
| 6859 | "$P_CLI dtls=1 debug_level=2" \ |
| 6860 | 0 \ |
| 6861 | -C "replayed record" \ |
| 6862 | -S "replayed record" \ |
| 6863 | -C "record from another epoch" \ |
| 6864 | -S "record from another epoch" \ |
| 6865 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6866 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 6867 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6868 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 6869 | -c "HTTP/1.0 200 OK" |
| 6870 | |
| 6871 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6872 | run_test "DTLS proxy: duplicate every packet" \ |
| 6873 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6874 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 6875 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6876 | 0 \ |
| 6877 | -c "replayed record" \ |
| 6878 | -s "replayed record" \ |
| 6879 | -c "record from another epoch" \ |
| 6880 | -s "record from another epoch" \ |
| 6881 | -S "resend" \ |
| 6882 | -s "Extra-header:" \ |
| 6883 | -c "HTTP/1.0 200 OK" |
| 6884 | |
| 6885 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 6886 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6887 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 6888 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6889 | 0 \ |
| 6890 | -c "replayed record" \ |
| 6891 | -S "replayed record" \ |
| 6892 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6893 | -s "record from another epoch" \ |
| 6894 | -c "resend" \ |
| 6895 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6896 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6897 | -c "HTTP/1.0 200 OK" |
| 6898 | |
| 6899 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 6900 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6901 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 6902 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6903 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6904 | -c "next record in same datagram" \ |
| 6905 | -s "next record in same datagram" |
| 6906 | |
| 6907 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 6908 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6909 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 6910 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6911 | 0 \ |
| 6912 | -c "next record in same datagram" \ |
| 6913 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6914 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6915 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 6916 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6917 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 6918 | "$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] | 6919 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6920 | -c "discarding invalid record (mac)" \ |
| 6921 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6922 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6923 | -c "HTTP/1.0 200 OK" \ |
| 6924 | -S "too many records with bad MAC" \ |
| 6925 | -S "Verification of the message MAC failed" |
| 6926 | |
| 6927 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 6928 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6929 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 6930 | "$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] | 6931 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6932 | -C "discarding invalid record (mac)" \ |
| 6933 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6934 | -S "Extra-header:" \ |
| 6935 | -C "HTTP/1.0 200 OK" \ |
| 6936 | -s "too many records with bad MAC" \ |
| 6937 | -s "Verification of the message MAC failed" |
| 6938 | |
| 6939 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 6940 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6941 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 6942 | "$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] | 6943 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6944 | -c "discarding invalid record (mac)" \ |
| 6945 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6946 | -s "Extra-header:" \ |
| 6947 | -c "HTTP/1.0 200 OK" \ |
| 6948 | -S "too many records with bad MAC" \ |
| 6949 | -S "Verification of the message MAC failed" |
| 6950 | |
| 6951 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 6952 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6953 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 6954 | "$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] | 6955 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6956 | -c "discarding invalid record (mac)" \ |
| 6957 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6958 | -s "Extra-header:" \ |
| 6959 | -c "HTTP/1.0 200 OK" \ |
| 6960 | -s "too many records with bad MAC" \ |
| 6961 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6962 | |
| 6963 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 6964 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 6965 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 6966 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6967 | 0 \ |
| 6968 | -c "record from another epoch" \ |
| 6969 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6970 | -s "Extra-header:" \ |
| 6971 | -c "HTTP/1.0 200 OK" |
| 6972 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 6973 | # Tests for reordering support with DTLS |
| 6974 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6975 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 6976 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6977 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 6978 | hs_timeout=2500-60000" \ |
| 6979 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 6980 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 6981 | 0 \ |
| 6982 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6983 | -c "Next handshake message has been buffered - load"\ |
| 6984 | -S "Buffering HS message" \ |
| 6985 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6986 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6987 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6988 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6989 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 6990 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 6991 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 6992 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6993 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 6994 | hs_timeout=2500-60000" \ |
| 6995 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 6996 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 6997 | 0 \ |
| 6998 | -c "Buffering HS message" \ |
| 6999 | -c "found fragmented DTLS handshake message"\ |
| 7000 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7001 | -c "Next handshake message has been buffered - load"\ |
| 7002 | -S "Buffering HS message" \ |
| 7003 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7004 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7005 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7006 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7007 | -S "Remember CCS message" |
| 7008 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7009 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7010 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7011 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7012 | # while keeping the ServerKeyExchange. |
| 7013 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7014 | 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] | 7015 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7016 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7017 | hs_timeout=2500-60000" \ |
| 7018 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7019 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7020 | 0 \ |
| 7021 | -c "Buffering HS message" \ |
| 7022 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7023 | -C "attempt to make space by freeing buffered messages" \ |
| 7024 | -S "Buffering HS message" \ |
| 7025 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7026 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7027 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7028 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7029 | -S "Remember CCS message" |
| 7030 | |
| 7031 | # The size constraints ensure that the delayed certificate message can't |
| 7032 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7033 | # when dropping it first. |
| 7034 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7035 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7036 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7037 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7038 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7039 | hs_timeout=2500-60000" \ |
| 7040 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7041 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7042 | 0 \ |
| 7043 | -c "Buffering HS message" \ |
| 7044 | -c "attempt to make space by freeing buffered future messages" \ |
| 7045 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7046 | -S "Buffering HS message" \ |
| 7047 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7048 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7049 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7050 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7051 | -S "Remember CCS message" |
| 7052 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7053 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7054 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7055 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7056 | hs_timeout=2500-60000" \ |
| 7057 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7058 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7059 | 0 \ |
| 7060 | -C "Buffering HS message" \ |
| 7061 | -C "Next handshake message has been buffered - load"\ |
| 7062 | -s "Buffering HS message" \ |
| 7063 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7064 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7065 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7066 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7067 | -S "Remember CCS message" |
| 7068 | |
| 7069 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7070 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7071 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7072 | hs_timeout=2500-60000" \ |
| 7073 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7074 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7075 | 0 \ |
| 7076 | -C "Buffering HS message" \ |
| 7077 | -C "Next handshake message has been buffered - load"\ |
| 7078 | -S "Buffering HS message" \ |
| 7079 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7080 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7081 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7082 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7083 | -S "Remember CCS message" |
| 7084 | |
| 7085 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7086 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7087 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7088 | hs_timeout=2500-60000" \ |
| 7089 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7090 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7091 | 0 \ |
| 7092 | -C "Buffering HS message" \ |
| 7093 | -C "Next handshake message has been buffered - load"\ |
| 7094 | -S "Buffering HS message" \ |
| 7095 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7096 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7097 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7098 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7099 | -s "Remember CCS message" |
| 7100 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7101 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7102 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7103 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7104 | hs_timeout=2500-60000" \ |
| 7105 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7106 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7107 | 0 \ |
| 7108 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7109 | -s "Found buffered record from current epoch - load" \ |
| 7110 | -c "Buffer record from epoch 1" \ |
| 7111 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7112 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7113 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7114 | # from the server are delayed, so that the encrypted Finished message |
| 7115 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7116 | # in afterwards, the encrypted Finished message must be freed in order |
| 7117 | # to make space for the NewSessionTicket to be reassembled. |
| 7118 | # This works only in very particular circumstances: |
| 7119 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7120 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7121 | # the encrypted Finished message. |
| 7122 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7123 | # needs to be fragmented. |
| 7124 | # - All messages sent by the server must be small enough to be either sent |
| 7125 | # without fragmentation or be reassembled within the bounds of |
| 7126 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7127 | # handshake, omitting CRTs. |
| 7128 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7129 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7130 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7131 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7132 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7133 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7134 | 0 \ |
| 7135 | -s "Buffer record from epoch 1" \ |
| 7136 | -s "Found buffered record from current epoch - load" \ |
| 7137 | -c "Buffer record from epoch 1" \ |
| 7138 | -C "Found buffered record from current epoch - load" \ |
| 7139 | -c "Enough space available after freeing future epoch record" |
| 7140 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7141 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7142 | |
| 7143 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7144 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7145 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7146 | "$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] | 7147 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7148 | "$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] | 7149 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7150 | 0 \ |
| 7151 | -s "Extra-header:" \ |
| 7152 | -c "HTTP/1.0 200 OK" |
| 7153 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7154 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7155 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7156 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7157 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7158 | "$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] | 7159 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7160 | 0 \ |
| 7161 | -s "Extra-header:" \ |
| 7162 | -c "HTTP/1.0 200 OK" |
| 7163 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7164 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7165 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7166 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7167 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7168 | "$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] | 7169 | 0 \ |
| 7170 | -s "Extra-header:" \ |
| 7171 | -c "HTTP/1.0 200 OK" |
| 7172 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7173 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7174 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7175 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7176 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7177 | "$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] | 7178 | 0 \ |
| 7179 | -s "Extra-header:" \ |
| 7180 | -c "HTTP/1.0 200 OK" |
| 7181 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7182 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7183 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7184 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7185 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7186 | "$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] | 7187 | 0 \ |
| 7188 | -s "Extra-header:" \ |
| 7189 | -c "HTTP/1.0 200 OK" |
| 7190 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7191 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7192 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7193 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7194 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7195 | "$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] | 7196 | 0 \ |
| 7197 | -s "Extra-header:" \ |
| 7198 | -c "HTTP/1.0 200 OK" |
| 7199 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7200 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7201 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7202 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7203 | "$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] | 7204 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7205 | "$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] | 7206 | 0 \ |
| 7207 | -s "Extra-header:" \ |
| 7208 | -c "HTTP/1.0 200 OK" |
| 7209 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7210 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7211 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7212 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7213 | "$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] | 7214 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7215 | "$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] | 7216 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7217 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7218 | 0 \ |
| 7219 | -s "a session has been resumed" \ |
| 7220 | -c "a session has been resumed" \ |
| 7221 | -s "Extra-header:" \ |
| 7222 | -c "HTTP/1.0 200 OK" |
| 7223 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7224 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7225 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7227 | "$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] | 7228 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7229 | "$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] | 7230 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7231 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7232 | 0 \ |
| 7233 | -s "a session has been resumed" \ |
| 7234 | -c "a session has been resumed" \ |
| 7235 | -s "Extra-header:" \ |
| 7236 | -c "HTTP/1.0 200 OK" |
| 7237 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7238 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7240 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7241 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7242 | "$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] | 7243 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7244 | "$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] | 7245 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7246 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7247 | 0 \ |
| 7248 | -c "=> renegotiate" \ |
| 7249 | -s "=> renegotiate" \ |
| 7250 | -s "Extra-header:" \ |
| 7251 | -c "HTTP/1.0 200 OK" |
| 7252 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7253 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7254 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7255 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7256 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7257 | "$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] | 7258 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7259 | "$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] | 7260 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7261 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7262 | 0 \ |
| 7263 | -c "=> renegotiate" \ |
| 7264 | -s "=> renegotiate" \ |
| 7265 | -s "Extra-header:" \ |
| 7266 | -c "HTTP/1.0 200 OK" |
| 7267 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7268 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7270 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7271 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7272 | "$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] | 7273 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7274 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7275 | "$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] | 7276 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7277 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7278 | 0 \ |
| 7279 | -c "=> renegotiate" \ |
| 7280 | -s "=> renegotiate" \ |
| 7281 | -s "Extra-header:" \ |
| 7282 | -c "HTTP/1.0 200 OK" |
| 7283 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7284 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7285 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7286 | 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] | 7287 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7288 | "$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] | 7289 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7290 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7291 | "$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] | 7292 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7293 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7294 | 0 \ |
| 7295 | -c "=> renegotiate" \ |
| 7296 | -s "=> renegotiate" \ |
| 7297 | -s "Extra-header:" \ |
| 7298 | -c "HTTP/1.0 200 OK" |
| 7299 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7300 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7301 | ## all versions installed on the CI machines), reported here: |
| 7302 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7303 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7304 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7305 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7306 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7307 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7308 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7309 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7310 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7311 | "$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] | 7312 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7313 | -c "HTTP/1.0 200 OK" |
| 7314 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7315 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7316 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7317 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7318 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7319 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7320 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7321 | "$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] | 7322 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7323 | -c "HTTP/1.0 200 OK" |
| 7324 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7325 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7326 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7327 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7328 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7329 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7330 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7331 | "$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] | 7332 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7333 | -c "HTTP/1.0 200 OK" |
| 7334 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7335 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7336 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7337 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7338 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7339 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7340 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7341 | "$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] | 7342 | 0 \ |
| 7343 | -s "Extra-header:" \ |
| 7344 | -c "Extra-header:" |
| 7345 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7346 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7347 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7348 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7349 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7350 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7351 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7352 | "$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] | 7353 | 0 \ |
| 7354 | -s "Extra-header:" \ |
| 7355 | -c "Extra-header:" |
| 7356 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7357 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7358 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7359 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7360 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7361 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7362 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7363 | "$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] | 7364 | 0 \ |
| 7365 | -s "Extra-header:" \ |
| 7366 | -c "Extra-header:" |
| 7367 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7368 | # Final report |
| 7369 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7370 | echo "------------------------------------------------------------------------" |
| 7371 | |
| 7372 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7373 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7374 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7375 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7376 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7377 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7378 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7379 | |
| 7380 | exit $FAILS |