Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else |
| 25 | echo "cd $( dirname $0 ) failed" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 29 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 30 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 31 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} |
| 35 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 39 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 41 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 44 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 45 | |
| 46 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 47 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 48 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 49 | else |
| 50 | O_LEGACY_SRV=false |
| 51 | O_LEGACY_CLI=false |
| 52 | fi |
| 53 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 54 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 55 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 56 | else |
| 57 | G_NEXT_SRV=false |
| 58 | fi |
| 59 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 60 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 61 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 62 | else |
| 63 | G_NEXT_CLI=false |
| 64 | fi |
| 65 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 66 | TESTS=0 |
| 67 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 68 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 70 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 72 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 73 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 74 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 75 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 76 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 77 | RUN_TEST_NUMBER='' |
| 78 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 79 | PRESERVE_LOGS=0 |
| 80 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 81 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 82 | # port which is this plus 10000. Each port number may be independently |
| 83 | # overridden by a command line option. |
| 84 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 85 | PXY_PORT=$((SRV_PORT + 10000)) |
| 86 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | print_usage() { |
| 88 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 89 | printf " -h|--help\tPrint this help.\n" |
| 90 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 91 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 92 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 93 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 94 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 95 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 97 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 98 | printf " --seed\tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | get_options() { |
| 102 | while [ $# -gt 0 ]; do |
| 103 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 104 | -f|--filter) |
| 105 | shift; FILTER=$1 |
| 106 | ;; |
| 107 | -e|--exclude) |
| 108 | shift; EXCLUDE=$1 |
| 109 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | -m|--memcheck) |
| 111 | MEMCHECK=1 |
| 112 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 113 | -n|--number) |
| 114 | shift; RUN_TEST_NUMBER=$1 |
| 115 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 116 | -s|--show-numbers) |
| 117 | SHOW_TEST_NUMBER=1 |
| 118 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 119 | -p|--preserve-logs) |
| 120 | PRESERVE_LOGS=1 |
| 121 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | --port) |
| 123 | shift; SRV_PORT=$1 |
| 124 | ;; |
| 125 | --proxy-port) |
| 126 | shift; PXY_PORT=$1 |
| 127 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 128 | --seed) |
| 129 | shift; SEED="$1" |
| 130 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | -h|--help) |
| 132 | print_usage |
| 133 | exit 0 |
| 134 | ;; |
| 135 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 136 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage |
| 138 | exit 1 |
| 139 | ;; |
| 140 | esac |
| 141 | shift |
| 142 | done |
| 143 | } |
| 144 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate |
| 146 | # in theory and expected to be re-introduced at some point, but |
| 147 | # aren't expected to succeed at the moment due to problems outside |
| 148 | # our control (such as bugs in other TLS implementations). |
| 149 | skip_next_test() { |
| 150 | SKIP_NEXT="YES" |
| 151 | } |
| 152 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h |
| 154 | requires_config_enabled() { |
| 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 156 | SKIP_NEXT="YES" |
| 157 | fi |
| 158 | } |
| 159 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h |
| 161 | requires_config_disabled() { |
| 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 163 | SKIP_NEXT="YES" |
| 164 | fi |
| 165 | } |
| 166 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 168 | # This function uses the query_config command line option to query the |
| 169 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 170 | # program. The command will always return a success value if the |
| 171 | # configuration is defined and the value will be printed to stdout. |
| 172 | # |
| 173 | # Note that if the configuration is not defined or is defined to nothing, |
| 174 | # the output of this function will be an empty string. |
| 175 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 179 | VAL="$( get_config_value_or_default "$1" )" |
| 180 | if [ -z "$VAL" ]; then |
| 181 | # Should never happen |
| 182 | echo "Mbed TLS configuration $1 is not defined" |
| 183 | exit 1 |
| 184 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 185 | SKIP_NEXT="YES" |
| 186 | fi |
| 187 | } |
| 188 | |
| 189 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 190 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 191 | if [ -z "$VAL" ]; then |
| 192 | # Should never happen |
| 193 | echo "Mbed TLS configuration $1 is not defined" |
| 194 | exit 1 |
| 195 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 196 | SKIP_NEXT="YES" |
| 197 | fi |
| 198 | } |
| 199 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 200 | requires_ciphersuite_enabled() { |
Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 201 | if [ -z "$($P_CLI --help | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 202 | SKIP_NEXT="YES" |
| 203 | fi |
| 204 | } |
| 205 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 206 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 207 | requires_openssl_with_fallback_scsv() { |
| 208 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 209 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 210 | then |
| 211 | OPENSSL_HAS_FBSCSV="YES" |
| 212 | else |
| 213 | OPENSSL_HAS_FBSCSV="NO" |
| 214 | fi |
| 215 | fi |
| 216 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 217 | SKIP_NEXT="YES" |
| 218 | fi |
| 219 | } |
| 220 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 221 | # skip next test if GnuTLS isn't available |
| 222 | requires_gnutls() { |
| 223 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 224 | 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] | 225 | GNUTLS_AVAILABLE="YES" |
| 226 | else |
| 227 | GNUTLS_AVAILABLE="NO" |
| 228 | fi |
| 229 | fi |
| 230 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 231 | SKIP_NEXT="YES" |
| 232 | fi |
| 233 | } |
| 234 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 235 | # skip next test if GnuTLS-next isn't available |
| 236 | requires_gnutls_next() { |
| 237 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 238 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 239 | GNUTLS_NEXT_AVAILABLE="YES" |
| 240 | else |
| 241 | GNUTLS_NEXT_AVAILABLE="NO" |
| 242 | fi |
| 243 | fi |
| 244 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 245 | SKIP_NEXT="YES" |
| 246 | fi |
| 247 | } |
| 248 | |
| 249 | # skip next test if OpenSSL-legacy isn't available |
| 250 | requires_openssl_legacy() { |
| 251 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 252 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 253 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 254 | else |
| 255 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 256 | fi |
| 257 | fi |
| 258 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 259 | SKIP_NEXT="YES" |
| 260 | fi |
| 261 | } |
| 262 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 263 | # skip next test if IPv6 isn't available on this host |
| 264 | requires_ipv6() { |
| 265 | if [ -z "${HAS_IPV6:-}" ]; then |
| 266 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 267 | SRV_PID=$! |
| 268 | sleep 1 |
| 269 | kill $SRV_PID >/dev/null 2>&1 |
| 270 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 271 | HAS_IPV6="NO" |
| 272 | else |
| 273 | HAS_IPV6="YES" |
| 274 | fi |
| 275 | rm -r $SRV_OUT |
| 276 | fi |
| 277 | |
| 278 | if [ "$HAS_IPV6" = "NO" ]; then |
| 279 | SKIP_NEXT="YES" |
| 280 | fi |
| 281 | } |
| 282 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 283 | # skip next test if it's i686 or uname is not available |
| 284 | requires_not_i686() { |
| 285 | if [ -z "${IS_I686:-}" ]; then |
| 286 | IS_I686="YES" |
| 287 | if which "uname" >/dev/null 2>&1; then |
| 288 | if [ -z "$(uname -a | grep i686)" ]; then |
| 289 | IS_I686="NO" |
| 290 | fi |
| 291 | fi |
| 292 | fi |
| 293 | if [ "$IS_I686" = "YES" ]; then |
| 294 | SKIP_NEXT="YES" |
| 295 | fi |
| 296 | } |
| 297 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 298 | # Calculate the input & output maximum content lengths set in the config |
| 299 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 300 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 301 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 302 | |
| 303 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 304 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 305 | fi |
| 306 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 307 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 308 | fi |
| 309 | |
| 310 | # skip the next test if the SSL output buffer is less than 16KB |
| 311 | requires_full_size_output_buffer() { |
| 312 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 313 | SKIP_NEXT="YES" |
| 314 | fi |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 317 | # skip the next test if valgrind is in use |
| 318 | not_with_valgrind() { |
| 319 | if [ "$MEMCHECK" -gt 0 ]; then |
| 320 | SKIP_NEXT="YES" |
| 321 | fi |
| 322 | } |
| 323 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 324 | # skip the next test if valgrind is NOT in use |
| 325 | only_with_valgrind() { |
| 326 | if [ "$MEMCHECK" -eq 0 ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 331 | # 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] | 332 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 333 | CLI_DELAY_FACTOR=$1 |
| 334 | } |
| 335 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 336 | # wait for the given seconds after the client finished in the next test |
| 337 | server_needs_more_time() { |
| 338 | SRV_DELAY_SECONDS=$1 |
| 339 | } |
| 340 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 341 | # print_name <name> |
| 342 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 343 | TESTS=$(( $TESTS + 1 )) |
| 344 | LINE="" |
| 345 | |
| 346 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 347 | LINE="$TESTS " |
| 348 | fi |
| 349 | |
| 350 | LINE="$LINE$1" |
| 351 | printf "$LINE " |
| 352 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 353 | for i in `seq 1 $LEN`; do printf '.'; done |
| 354 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 355 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | # fail <message> |
| 359 | fail() { |
| 360 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 361 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 362 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 363 | mv $SRV_OUT o-srv-${TESTS}.log |
| 364 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 365 | if [ -n "$PXY_CMD" ]; then |
| 366 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 367 | fi |
| 368 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 369 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 370 | 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] | 371 | echo " ! server output:" |
| 372 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 373 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 374 | echo " ! client output:" |
| 375 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 376 | if [ -n "$PXY_CMD" ]; then |
| 377 | echo " ! ========================================================" |
| 378 | echo " ! proxy output:" |
| 379 | cat o-pxy-${TESTS}.log |
| 380 | fi |
| 381 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 382 | fi |
| 383 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 384 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 385 | } |
| 386 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 387 | # is_polar <cmd_line> |
| 388 | is_polar() { |
| 389 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 390 | } |
| 391 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 392 | # openssl s_server doesn't have -www with DTLS |
| 393 | check_osrv_dtls() { |
| 394 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 395 | NEEDS_INPUT=1 |
| 396 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 397 | else |
| 398 | NEEDS_INPUT=0 |
| 399 | fi |
| 400 | } |
| 401 | |
| 402 | # provide input to commands that need it |
| 403 | provide_input() { |
| 404 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 405 | return |
| 406 | fi |
| 407 | |
| 408 | while true; do |
| 409 | echo "HTTP/1.0 200 OK" |
| 410 | sleep 1 |
| 411 | done |
| 412 | } |
| 413 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 414 | # has_mem_err <log_file_name> |
| 415 | has_mem_err() { |
| 416 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 417 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 418 | then |
| 419 | return 1 # false: does not have errors |
| 420 | else |
| 421 | return 0 # true: has errors |
| 422 | fi |
| 423 | } |
| 424 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 425 | # Wait for process $2 to be listening on port $1 |
| 426 | if type lsof >/dev/null 2>/dev/null; then |
| 427 | wait_server_start() { |
| 428 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 429 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 430 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 431 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 432 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 433 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 434 | # Make a tight loop, server normally takes less than 1s to start. |
| 435 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 436 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 437 | echo "SERVERSTART TIMEOUT" |
| 438 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 439 | break |
| 440 | fi |
| 441 | # Linux and *BSD support decimal arguments to sleep. On other |
| 442 | # OSes this may be a tight loop. |
| 443 | sleep 0.1 2>/dev/null || true |
| 444 | done |
| 445 | } |
| 446 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 447 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 448 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 449 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 450 | } |
| 451 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 452 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 453 | # 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] | 454 | # 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] | 455 | # acceptable bounds |
| 456 | check_server_hello_time() { |
| 457 | # 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] | 458 | 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] | 459 | # Get the Unix timestamp for now |
| 460 | CUR_TIME=$(date +'%s') |
| 461 | THRESHOLD_IN_SECS=300 |
| 462 | |
| 463 | # Check if the ServerHello time was printed |
| 464 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 465 | return 1 |
| 466 | fi |
| 467 | |
| 468 | # Check the time in ServerHello is within acceptable bounds |
| 469 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 470 | # The time in ServerHello is at least 5 minutes before now |
| 471 | return 1 |
| 472 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 473 | # 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] | 474 | return 1 |
| 475 | else |
| 476 | return 0 |
| 477 | fi |
| 478 | } |
| 479 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 480 | # wait for client to terminate and set CLI_EXIT |
| 481 | # must be called right after starting the client |
| 482 | wait_client_done() { |
| 483 | CLI_PID=$! |
| 484 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 485 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 486 | CLI_DELAY_FACTOR=1 |
| 487 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 488 | ( 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] | 489 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 490 | |
| 491 | wait $CLI_PID |
| 492 | CLI_EXIT=$? |
| 493 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 494 | kill $DOG_PID >/dev/null 2>&1 |
| 495 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 496 | |
| 497 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 498 | |
| 499 | sleep $SRV_DELAY_SECONDS |
| 500 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 503 | # check if the given command uses dtls and sets global variable DTLS |
| 504 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 505 | 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] | 506 | DTLS=1 |
| 507 | else |
| 508 | DTLS=0 |
| 509 | fi |
| 510 | } |
| 511 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 512 | # 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] | 513 | # Options: -s pattern pattern that must be present in server output |
| 514 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 515 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 516 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 517 | # -S pattern pattern that must be absent in server output |
| 518 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 519 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 520 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 521 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 522 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 523 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 524 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 525 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 526 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 527 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 528 | return |
| 529 | fi |
| 530 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 531 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 532 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 533 | # Do we only run numbered tests? |
| 534 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 535 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 536 | else |
| 537 | SKIP_NEXT="YES" |
| 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 540 | # does this test use a proxy? |
| 541 | if [ "X$1" = "X-p" ]; then |
| 542 | PXY_CMD="$2" |
| 543 | shift 2 |
| 544 | else |
| 545 | PXY_CMD="" |
| 546 | fi |
| 547 | |
| 548 | # get commands and client output |
| 549 | SRV_CMD="$1" |
| 550 | CLI_CMD="$2" |
| 551 | CLI_EXPECT="$3" |
| 552 | shift 3 |
| 553 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 554 | # Check if server forces ciphersuite |
| 555 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 556 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 557 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 558 | fi |
| 559 | |
| 560 | # Check if client forces ciphersuite |
| 561 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 562 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 563 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 564 | fi |
| 565 | |
| 566 | # should we skip? |
| 567 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 568 | SKIP_NEXT="NO" |
| 569 | echo "SKIP" |
| 570 | SKIPS=$(( $SKIPS + 1 )) |
| 571 | return |
| 572 | fi |
| 573 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 574 | # fix client port |
| 575 | if [ -n "$PXY_CMD" ]; then |
| 576 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 577 | else |
| 578 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 579 | fi |
| 580 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 581 | # update DTLS variable |
| 582 | detect_dtls "$SRV_CMD" |
| 583 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 584 | # prepend valgrind to our commands if active |
| 585 | if [ "$MEMCHECK" -gt 0 ]; then |
| 586 | if is_polar "$SRV_CMD"; then |
| 587 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 588 | fi |
| 589 | if is_polar "$CLI_CMD"; then |
| 590 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 591 | fi |
| 592 | fi |
| 593 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 594 | TIMES_LEFT=2 |
| 595 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 596 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 597 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 598 | # run the commands |
| 599 | if [ -n "$PXY_CMD" ]; then |
| 600 | echo "$PXY_CMD" > $PXY_OUT |
| 601 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 602 | PXY_PID=$! |
| 603 | # assume proxy starts faster than server |
| 604 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 605 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 606 | check_osrv_dtls |
| 607 | echo "$SRV_CMD" > $SRV_OUT |
| 608 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 609 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 610 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 611 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 612 | echo "$CLI_CMD" > $CLI_OUT |
| 613 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 614 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 615 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 616 | sleep 0.05 |
| 617 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 618 | # terminate the server (and the proxy) |
| 619 | kill $SRV_PID |
| 620 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 621 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 622 | if [ -n "$PXY_CMD" ]; then |
| 623 | kill $PXY_PID >/dev/null 2>&1 |
| 624 | wait $PXY_PID |
| 625 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 626 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 627 | # retry only on timeouts |
| 628 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 629 | printf "RETRY " |
| 630 | else |
| 631 | TIMES_LEFT=0 |
| 632 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 633 | done |
| 634 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 635 | # 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] | 636 | # (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] | 637 | # expected client exit to incorrectly succeed in case of catastrophic |
| 638 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 639 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 640 | 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] | 641 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 642 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 643 | return |
| 644 | fi |
| 645 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 646 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 647 | 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] | 648 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 649 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 650 | return |
| 651 | fi |
| 652 | fi |
| 653 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 654 | # check server exit code |
| 655 | if [ $? != 0 ]; then |
| 656 | fail "server fail" |
| 657 | return |
| 658 | fi |
| 659 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 661 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 662 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 663 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 664 | 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] | 665 | return |
| 666 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 667 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 668 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 669 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 670 | # 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] | 671 | while [ $# -gt 0 ] |
| 672 | do |
| 673 | case $1 in |
| 674 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 675 | 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] | 676 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 677 | return |
| 678 | fi |
| 679 | ;; |
| 680 | |
| 681 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 682 | 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] | 683 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 684 | return |
| 685 | fi |
| 686 | ;; |
| 687 | |
| 688 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 689 | 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] | 690 | 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] | 691 | return |
| 692 | fi |
| 693 | ;; |
| 694 | |
| 695 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 696 | 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] | 697 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 698 | return |
| 699 | fi |
| 700 | ;; |
| 701 | |
| 702 | # The filtering in the following two options (-u and -U) do the following |
| 703 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 704 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 705 | # - keep one of each non-unique line |
| 706 | # - count how many lines remain |
| 707 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 708 | # if there were no duplicates. |
| 709 | "-U") |
| 710 | 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 |
| 711 | fail "lines following pattern '$2' must be unique in Server output" |
| 712 | return |
| 713 | fi |
| 714 | ;; |
| 715 | |
| 716 | "-u") |
| 717 | 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 |
| 718 | 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] | 719 | return |
| 720 | fi |
| 721 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 722 | "-F") |
| 723 | if ! $2 "$SRV_OUT"; then |
| 724 | fail "function call to '$2' failed on Server output" |
| 725 | return |
| 726 | fi |
| 727 | ;; |
| 728 | "-f") |
| 729 | if ! $2 "$CLI_OUT"; then |
| 730 | fail "function call to '$2' failed on Client output" |
| 731 | return |
| 732 | fi |
| 733 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 734 | |
| 735 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 736 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 737 | exit 1 |
| 738 | esac |
| 739 | shift 2 |
| 740 | done |
| 741 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 742 | # check valgrind's results |
| 743 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 744 | 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] | 745 | fail "Server has memory errors" |
| 746 | return |
| 747 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 748 | 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] | 749 | fail "Client has memory errors" |
| 750 | return |
| 751 | fi |
| 752 | fi |
| 753 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 754 | # if we're here, everything is ok |
| 755 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 756 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 757 | mv $SRV_OUT o-srv-${TESTS}.log |
| 758 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 759 | if [ -n "$PXY_CMD" ]; then |
| 760 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 761 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 762 | fi |
| 763 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 764 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 765 | } |
| 766 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 767 | run_test_psa() { |
| 768 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 769 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 770 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 771 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 772 | 0 \ |
| 773 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 774 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 775 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 776 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 777 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 778 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 779 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 780 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 781 | -C "Failed to setup PSA-based cipher context"\ |
| 782 | -S "Failed to setup PSA-based cipher context"\ |
| 783 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 784 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 785 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 786 | -S "error" \ |
| 787 | -C "error" |
| 788 | } |
| 789 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 790 | run_test_psa_force_curve() { |
| 791 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 792 | run_test "PSA - ECDH with $1" \ |
| 793 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 794 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 795 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 796 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 797 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 798 | -c "PSA calc verify" \ |
| 799 | -c "calc PSA finished" \ |
| 800 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 801 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 802 | -s "PSA calc verify" \ |
| 803 | -s "calc PSA finished" \ |
| 804 | -C "Failed to setup PSA-based cipher context"\ |
| 805 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 806 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 807 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 808 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 809 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 810 | -C "error" |
| 811 | } |
| 812 | |
| 813 | cleanup() { |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 814 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
| 815 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 816 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 817 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 818 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
| 819 | exit 1 |
| 820 | } |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 821 | |
| 822 | # |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 823 | # MAIN |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 824 | # |
| 825 | |
| 826 | get_options "$@" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 827 | |
| 828 | # sanity checks, avoid an avalanche of errors |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 829 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 830 | P_CLI_BIN="${P_CLI%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 831 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 832 | if [ ! -x "$P_SRV_BIN" ]; then |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 833 | echo "Command '$P_SRV_BIN' is not an executable file" |
| 834 | exit 1 |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 835 | fi |
| 836 | if [ ! -x "$P_CLI_BIN" ]; then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 837 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 838 | exit 1 |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 839 | fi |
| 840 | if [ ! -x "$P_PXY_BIN" ]; then |
| 841 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 842 | exit 1 |
| 843 | fi |
| 844 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 845 | if which valgrind >/dev/null 2>&1; then :; else |
| 846 | echo "Memcheck not possible. Valgrind not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 847 | exit 1 |
| 848 | fi |
| 849 | fi |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 850 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 851 | echo "Command '$OPENSSL_CMD' not found" |
| 852 | exit 1 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 853 | fi |
| 854 | |
| 855 | # used by watchdog |
| 856 | MAIN_PID="$$" |
| 857 | |
| 858 | # We use somewhat arbitrary delays for tests: |
| 859 | # - how long do we wait for the server to start (when lsof not available)? |
| 860 | # - how long do we allow for the client to finish? |
| 861 | # (not to check performance, just to avoid waiting indefinitely) |
| 862 | # Things are slower with valgrind, so give extra time here. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 863 | # |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 864 | # Note: without lsof, there is a trade-off between the running time of this |
| 865 | # script and the risk of spurious errors because we didn't wait long enough. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 866 | # The watchdog delay on the other hand doesn't affect normal running time of |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 867 | # the script, only the case where a client or server gets stuck. |
| 868 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 869 | START_DELAY=6 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 870 | DOG_DELAY=60 |
| 871 | else |
| 872 | START_DELAY=2 |
| 873 | DOG_DELAY=20 |
| 874 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 875 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 876 | # some particular tests need more time: |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 877 | # - for the client, we multiply the usual watchdog limit by a factor |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 878 | # - for the server, we sleep for a number of seconds after the client exits |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 879 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 880 | CLI_DELAY_FACTOR=1 |
| 881 | SRV_DELAY_SECONDS=0 |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 882 | |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 883 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 884 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 885 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 886 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 887 | 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 | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 888 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 889 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 890 | G_SRV="$G_SRV -p $SRV_PORT" |
| 891 | G_CLI="$G_CLI -p +SRV_PORT" |
| 892 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 893 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 894 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 895 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 896 | fi |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 897 | |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 898 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 899 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 900 | fi |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 901 | |
| 902 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 903 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 904 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 905 | |
| 906 | # Allow SHA-1, because many of our test certificates use it |
| 907 | P_SRV="$P_SRV allow_sha1=1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 908 | P_CLI="$P_CLI allow_sha1=1" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 909 | |
| 910 | # Also pick a unique name for intermediate files |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 911 | SRV_OUT="srv_out.$$" |
| 912 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 913 | PXY_OUT="pxy_out.$$" |
| 914 | SESSION="session.$$" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 915 | |
| 916 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 917 | |
| 918 | trap cleanup INT TERM HUP |
| 919 | |
| 920 | # Basic test |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 921 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 922 | # Checks that: |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 923 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 924 | # - the expected (highest security) parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 925 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 926 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 927 | "$P_SRV debug_level=3" \ |
| 928 | "$P_CLI" \ |
| 929 | 0 \ |
| 930 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 931 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 932 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 933 | -s "ECDHE curve: secp521r1" \ |
| 934 | -S "error" \ |
| 935 | -C "error" |
| 936 | |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 937 | run_test "Default, DTLS" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 938 | "$P_SRV dtls=1" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 939 | "$P_CLI dtls=1" \ |
| 940 | 0 \ |
| 941 | -s "Protocol is DTLSv1.2" \ |
| 942 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 943 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 944 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 945 | run_test "CA callback on client" \ |
| 946 | "$P_SRV debug_level=3" \ |
| 947 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 948 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 949 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 950 | -S "error" \ |
| 951 | -C "error" |
| 952 | |
| 953 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 954 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 955 | requires_config_enabled MBEDTLS_ECDSA_C |
| 956 | requires_config_enabled MBEDTLS_SHA256_C |
| 957 | run_test "CA callback on server" \ |
| 958 | "$P_SRV auth_mode=required" \ |
| 959 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 960 | key_file=data_files/server5.key" \ |
| 961 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 962 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 963 | -s "Verifying peer X.509 certificate... ok" \ |
| 964 | -S "error" \ |
| 965 | -C "error" |
| 966 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 967 | # Test using an opaque private key for client authentication |
| 968 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 969 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 970 | requires_config_enabled MBEDTLS_ECDSA_C |
| 971 | requires_config_enabled MBEDTLS_SHA256_C |
| 972 | run_test "Opaque key for client authentication" \ |
| 973 | "$P_SRV auth_mode=required" \ |
| 974 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 975 | key_file=data_files/server5.key" \ |
| 976 | 0 \ |
| 977 | -c "key type: Opaque" \ |
| 978 | -s "Verifying peer X.509 certificate... ok" \ |
| 979 | -S "error" \ |
| 980 | -C "error" |
| 981 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 982 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 983 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 984 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 985 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 986 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 987 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 988 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 989 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 990 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 991 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 992 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 993 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 994 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 995 | run_test_psa_force_curve "secp521r1" |
| 996 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 997 | run_test_psa_force_curve "brainpoolP512r1" |
| 998 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 999 | run_test_psa_force_curve "secp384r1" |
| 1000 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1001 | run_test_psa_force_curve "brainpoolP384r1" |
| 1002 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1003 | run_test_psa_force_curve "secp256r1" |
| 1004 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1005 | run_test_psa_force_curve "secp256k1" |
| 1006 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1007 | run_test_psa_force_curve "brainpoolP256r1" |
| 1008 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1009 | run_test_psa_force_curve "secp224r1" |
| 1010 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1011 | run_test_psa_force_curve "secp224k1" |
| 1012 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1013 | run_test_psa_force_curve "secp192r1" |
| 1014 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1015 | run_test_psa_force_curve "secp192k1" |
| 1016 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1017 | # Test current time in ServerHello |
| 1018 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1019 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1020 | "$P_SRV debug_level=3" \ |
| 1021 | "$P_CLI debug_level=3" \ |
| 1022 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1023 | -f "check_server_hello_time" \ |
| 1024 | -F "check_server_hello_time" |
| 1025 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1026 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1027 | run_test "Unique IV in GCM" \ |
| 1028 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1029 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1030 | 0 \ |
| 1031 | -u "IV used" \ |
| 1032 | -U "IV used" |
| 1033 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1034 | # Tests for certificate verification callback |
| 1035 | run_test "Configuration-specific CRT verification callback" \ |
| 1036 | "$P_SRV debug_level=3" \ |
| 1037 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1038 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1039 | -S "error" \ |
| 1040 | -c "Verify requested for " \ |
| 1041 | -c "Use configuration-specific verification callback" \ |
| 1042 | -C "Use context-specific verification callback" \ |
| 1043 | -C "error" |
| 1044 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1045 | run_test "Context-specific CRT verification callback" \ |
| 1046 | "$P_SRV debug_level=3" \ |
| 1047 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1048 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1049 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1050 | -c "Verify requested for " \ |
| 1051 | -c "Use context-specific verification callback" \ |
| 1052 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1053 | -C "error" |
| 1054 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1055 | # Tests for rc4 option |
| 1056 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1057 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1058 | run_test "RC4: server disabled, client enabled" \ |
| 1059 | "$P_SRV" \ |
| 1060 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1061 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1062 | -s "SSL - The server has no ciphersuites in common" |
| 1063 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1064 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1065 | run_test "RC4: server half, client enabled" \ |
| 1066 | "$P_SRV arc4=1" \ |
| 1067 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1068 | 1 \ |
| 1069 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1070 | |
| 1071 | run_test "RC4: server enabled, client disabled" \ |
| 1072 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1073 | "$P_CLI" \ |
| 1074 | 1 \ |
| 1075 | -s "SSL - The server has no ciphersuites in common" |
| 1076 | |
| 1077 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1078 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1079 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1080 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1081 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1082 | -S "SSL - The server has no ciphersuites in common" |
| 1083 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1084 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1085 | |
| 1086 | requires_gnutls |
| 1087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1088 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1089 | "$G_SRV"\ |
| 1090 | "$P_CLI force_version=tls1_1" \ |
| 1091 | 0 |
| 1092 | |
| 1093 | requires_gnutls |
| 1094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1095 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1096 | "$G_SRV"\ |
| 1097 | "$P_CLI force_version=tls1" \ |
| 1098 | 0 |
| 1099 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1100 | # Tests for SHA-1 support |
| 1101 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1102 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1103 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1104 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1105 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1106 | 1 \ |
| 1107 | -c "The certificate is signed with an unacceptable hash" |
| 1108 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1109 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1110 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1111 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1112 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1113 | 0 |
| 1114 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1115 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1116 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1117 | "$P_CLI allow_sha1=1" \ |
| 1118 | 0 |
| 1119 | |
| 1120 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1121 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1122 | "$P_CLI allow_sha1=0" \ |
| 1123 | 0 |
| 1124 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1125 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1126 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1127 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1128 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1129 | 1 \ |
| 1130 | -s "The certificate is signed with an unacceptable hash" |
| 1131 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1132 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1133 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1134 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1135 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1136 | 0 |
| 1137 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1138 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1139 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1140 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1141 | 0 |
| 1142 | |
| 1143 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1144 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1145 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1146 | 0 |
| 1147 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1148 | # Tests for datagram packing |
| 1149 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1150 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1151 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1152 | 0 \ |
| 1153 | -c "next record in same datagram" \ |
| 1154 | -s "next record in same datagram" |
| 1155 | |
| 1156 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1157 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1158 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1159 | 0 \ |
| 1160 | -s "next record in same datagram" \ |
| 1161 | -C "next record in same datagram" |
| 1162 | |
| 1163 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1164 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1165 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1166 | 0 \ |
| 1167 | -S "next record in same datagram" \ |
| 1168 | -c "next record in same datagram" |
| 1169 | |
| 1170 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1171 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1172 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1173 | 0 \ |
| 1174 | -S "next record in same datagram" \ |
| 1175 | -C "next record in same datagram" |
| 1176 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1177 | # Tests for Truncated HMAC extension |
| 1178 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1179 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1180 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1181 | "$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] | 1182 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1183 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1184 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1185 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1187 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1188 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1189 | "$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] | 1190 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1191 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1192 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1193 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1194 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1195 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1196 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1197 | "$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] | 1198 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1199 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1200 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1201 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1203 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1204 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1205 | "$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] | 1206 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1207 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1208 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1209 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1210 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1211 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1212 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1213 | "$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] | 1214 | 0 \ |
| 1215 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1216 | -S "dumping 'expected mac' (10 bytes)" |
| 1217 | |
| 1218 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1219 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1220 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1221 | "$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] | 1222 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1223 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1224 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1225 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1226 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1227 | "$P_SRV dtls=1 debug_level=4" \ |
| 1228 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1229 | 0 \ |
| 1230 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1231 | -S "dumping 'expected mac' (10 bytes)" |
| 1232 | |
| 1233 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1234 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1235 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1236 | "$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] | 1237 | 0 \ |
| 1238 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1239 | -S "dumping 'expected mac' (10 bytes)" |
| 1240 | |
| 1241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1242 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1243 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1244 | "$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] | 1245 | 0 \ |
| 1246 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1247 | -S "dumping 'expected mac' (10 bytes)" |
| 1248 | |
| 1249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1250 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1251 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1252 | "$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] | 1253 | 0 \ |
| 1254 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1255 | -S "dumping 'expected mac' (10 bytes)" |
| 1256 | |
| 1257 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1258 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1259 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1260 | "$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] | 1261 | 0 \ |
| 1262 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1263 | -S "dumping 'expected mac' (10 bytes)" |
| 1264 | |
| 1265 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1266 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1267 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1268 | "$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] | 1269 | 0 \ |
| 1270 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1271 | -s "dumping 'expected mac' (10 bytes)" |
| 1272 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1273 | # Tests for DTLS Connection ID extension |
| 1274 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1275 | # So far, the CID API isn't implemented, so we can't |
| 1276 | # grep for output witnessing its use. This needs to be |
| 1277 | # changed once the CID extension is implemented. |
| 1278 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1279 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1280 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1281 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1282 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1283 | 0 \ |
| 1284 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1285 | -s "found CID extension" \ |
| 1286 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1287 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1288 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1289 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1290 | -C "found CID extension" \ |
| 1291 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1292 | -C "Copy CIDs into SSL transform" \ |
| 1293 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1296 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1297 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1298 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1299 | 0 \ |
| 1300 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1301 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1302 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1303 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1304 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1305 | -C "found CID extension" \ |
| 1306 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1307 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1308 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1309 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1311 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1312 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1313 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1314 | 0 \ |
| 1315 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1316 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1317 | -c "client hello, adding CID extension" \ |
| 1318 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1319 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1320 | -s "server hello, adding CID extension" \ |
| 1321 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1322 | -c "Use of CID extension negotiated" \ |
| 1323 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1324 | -c "Copy CIDs into SSL transform" \ |
| 1325 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1326 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1327 | -s "Use of Connection ID has been negotiated" \ |
| 1328 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1329 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1330 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1331 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1332 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1333 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1334 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1335 | 0 \ |
| 1336 | -c "Enable use of CID extension." \ |
| 1337 | -s "Enable use of CID extension." \ |
| 1338 | -c "client hello, adding CID extension" \ |
| 1339 | -s "found CID extension" \ |
| 1340 | -s "Use of CID extension negotiated" \ |
| 1341 | -s "server hello, adding CID extension" \ |
| 1342 | -c "found CID extension" \ |
| 1343 | -c "Use of CID extension negotiated" \ |
| 1344 | -s "Copy CIDs into SSL transform" \ |
| 1345 | -c "Copy CIDs into SSL transform" \ |
| 1346 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1347 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1348 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1349 | -c "Use of Connection ID has been negotiated" \ |
| 1350 | -c "ignoring unexpected CID" \ |
| 1351 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1352 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1354 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1355 | -p "$P_PXY mtu=800" \ |
| 1356 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1357 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1358 | 0 \ |
| 1359 | -c "Enable use of CID extension." \ |
| 1360 | -s "Enable use of CID extension." \ |
| 1361 | -c "client hello, adding CID extension" \ |
| 1362 | -s "found CID extension" \ |
| 1363 | -s "Use of CID extension negotiated" \ |
| 1364 | -s "server hello, adding CID extension" \ |
| 1365 | -c "found CID extension" \ |
| 1366 | -c "Use of CID extension negotiated" \ |
| 1367 | -s "Copy CIDs into SSL transform" \ |
| 1368 | -c "Copy CIDs into SSL transform" \ |
| 1369 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1370 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1371 | -s "Use of Connection ID has been negotiated" \ |
| 1372 | -c "Use of Connection ID has been negotiated" |
| 1373 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1374 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1375 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1376 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1377 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1378 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1379 | 0 \ |
| 1380 | -c "Enable use of CID extension." \ |
| 1381 | -s "Enable use of CID extension." \ |
| 1382 | -c "client hello, adding CID extension" \ |
| 1383 | -s "found CID extension" \ |
| 1384 | -s "Use of CID extension negotiated" \ |
| 1385 | -s "server hello, adding CID extension" \ |
| 1386 | -c "found CID extension" \ |
| 1387 | -c "Use of CID extension negotiated" \ |
| 1388 | -s "Copy CIDs into SSL transform" \ |
| 1389 | -c "Copy CIDs into SSL transform" \ |
| 1390 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1391 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1392 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1393 | -c "Use of Connection ID has been negotiated" \ |
| 1394 | -c "ignoring unexpected CID" \ |
| 1395 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1396 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1397 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1398 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1399 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1400 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1401 | 0 \ |
| 1402 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1403 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1404 | -c "client hello, adding CID extension" \ |
| 1405 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1406 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1407 | -s "server hello, adding CID extension" \ |
| 1408 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1409 | -c "Use of CID extension negotiated" \ |
| 1410 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1411 | -c "Copy CIDs into SSL transform" \ |
| 1412 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1413 | -s "Peer CID (length 0 Bytes):" \ |
| 1414 | -s "Use of Connection ID has been negotiated" \ |
| 1415 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1416 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1417 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1418 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1419 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1420 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1421 | 0 \ |
| 1422 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1423 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1424 | -c "client hello, adding CID extension" \ |
| 1425 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1426 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1427 | -s "server hello, adding CID extension" \ |
| 1428 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1429 | -c "Use of CID extension negotiated" \ |
| 1430 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1431 | -c "Copy CIDs into SSL transform" \ |
| 1432 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1433 | -c "Peer CID (length 0 Bytes):" \ |
| 1434 | -s "Use of Connection ID has been negotiated" \ |
| 1435 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1436 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1437 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1438 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1439 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1440 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1441 | 0 \ |
| 1442 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1443 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1444 | -c "client hello, adding CID extension" \ |
| 1445 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1446 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1447 | -s "server hello, adding CID extension" \ |
| 1448 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1449 | -c "Use of CID extension negotiated" \ |
| 1450 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1451 | -c "Copy CIDs into SSL transform" \ |
| 1452 | -S "Use of Connection ID has been negotiated" \ |
| 1453 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1454 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1455 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1456 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1457 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1458 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1459 | 0 \ |
| 1460 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1461 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1462 | -c "client hello, adding CID extension" \ |
| 1463 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1464 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1465 | -s "server hello, adding CID extension" \ |
| 1466 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1467 | -c "Use of CID extension negotiated" \ |
| 1468 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1469 | -c "Copy CIDs into SSL transform" \ |
| 1470 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1471 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1472 | -s "Use of Connection ID has been negotiated" \ |
| 1473 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1474 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1476 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1477 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1478 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1479 | 0 \ |
| 1480 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1481 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1482 | -c "client hello, adding CID extension" \ |
| 1483 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1484 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1485 | -s "server hello, adding CID extension" \ |
| 1486 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1487 | -c "Use of CID extension negotiated" \ |
| 1488 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1489 | -c "Copy CIDs into SSL transform" \ |
| 1490 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1491 | -s "Peer CID (length 0 Bytes):" \ |
| 1492 | -s "Use of Connection ID has been negotiated" \ |
| 1493 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1494 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1495 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1496 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1497 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1498 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1499 | 0 \ |
| 1500 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1501 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1502 | -c "client hello, adding CID extension" \ |
| 1503 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1504 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1505 | -s "server hello, adding CID extension" \ |
| 1506 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1507 | -c "Use of CID extension negotiated" \ |
| 1508 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1509 | -c "Copy CIDs into SSL transform" \ |
| 1510 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1511 | -c "Peer CID (length 0 Bytes):" \ |
| 1512 | -s "Use of Connection ID has been negotiated" \ |
| 1513 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1514 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1515 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1516 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1517 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1518 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1519 | 0 \ |
| 1520 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1521 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1522 | -c "client hello, adding CID extension" \ |
| 1523 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1524 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1525 | -s "server hello, adding CID extension" \ |
| 1526 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1527 | -c "Use of CID extension negotiated" \ |
| 1528 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1529 | -c "Copy CIDs into SSL transform" \ |
| 1530 | -S "Use of Connection ID has been negotiated" \ |
| 1531 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1532 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1534 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1535 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1536 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1537 | 0 \ |
| 1538 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1539 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1540 | -c "client hello, adding CID extension" \ |
| 1541 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1542 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1543 | -s "server hello, adding CID extension" \ |
| 1544 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1545 | -c "Use of CID extension negotiated" \ |
| 1546 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1547 | -c "Copy CIDs into SSL transform" \ |
| 1548 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1549 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1550 | -s "Use of Connection ID has been negotiated" \ |
| 1551 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1552 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1553 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1554 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1555 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1556 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1557 | 0 \ |
| 1558 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1559 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1560 | -c "client hello, adding CID extension" \ |
| 1561 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1562 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1563 | -s "server hello, adding CID extension" \ |
| 1564 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1565 | -c "Use of CID extension negotiated" \ |
| 1566 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1567 | -c "Copy CIDs into SSL transform" \ |
| 1568 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1569 | -s "Peer CID (length 0 Bytes):" \ |
| 1570 | -s "Use of Connection ID has been negotiated" \ |
| 1571 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1572 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1573 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1574 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1575 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1576 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1577 | 0 \ |
| 1578 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1579 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1580 | -c "client hello, adding CID extension" \ |
| 1581 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1582 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1583 | -s "server hello, adding CID extension" \ |
| 1584 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1585 | -c "Use of CID extension negotiated" \ |
| 1586 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1587 | -c "Copy CIDs into SSL transform" \ |
| 1588 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1589 | -c "Peer CID (length 0 Bytes):" \ |
| 1590 | -s "Use of Connection ID has been negotiated" \ |
| 1591 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1592 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1594 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1595 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1596 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1597 | 0 \ |
| 1598 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1599 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1600 | -c "client hello, adding CID extension" \ |
| 1601 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1602 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1603 | -s "server hello, adding CID extension" \ |
| 1604 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1605 | -c "Use of CID extension negotiated" \ |
| 1606 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1607 | -c "Copy CIDs into SSL transform" \ |
| 1608 | -S "Use of Connection ID has been negotiated" \ |
| 1609 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1610 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1611 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1613 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1614 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1615 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1616 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1617 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1618 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1619 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1620 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1621 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1622 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1623 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1624 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1625 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1626 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1627 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1628 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1629 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1630 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1631 | 0 \ |
| 1632 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1633 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1634 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1635 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1636 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1637 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1638 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1639 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1640 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1641 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1643 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 1644 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1645 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1646 | 0 \ |
| 1647 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1648 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1649 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1650 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1651 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1652 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1653 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1654 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1655 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1656 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1657 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1658 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1659 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1660 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1661 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1662 | 0 \ |
| 1663 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1664 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1665 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1666 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1667 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1668 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1669 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1670 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1671 | -c "ignoring unexpected CID" \ |
| 1672 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1673 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1674 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1676 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1677 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1678 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1679 | 0 \ |
| 1680 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1681 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1682 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1683 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1684 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1685 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1686 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1687 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1688 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1689 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1690 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1691 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 1692 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1693 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1694 | 0 \ |
| 1695 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1696 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1697 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1698 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1699 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1700 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1701 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1702 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1703 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1705 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1706 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1707 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1708 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1709 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1710 | 0 \ |
| 1711 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1712 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1713 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1714 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1715 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1716 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1717 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1718 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1719 | -c "ignoring unexpected CID" \ |
| 1720 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1721 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1722 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1724 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1725 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1726 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1727 | 0 \ |
| 1728 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1729 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1730 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1731 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1732 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1733 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1734 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1735 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1736 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1737 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 1738 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1739 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1740 | 0 \ |
| 1741 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1742 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1743 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1744 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1745 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1746 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1747 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1748 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1750 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1751 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1752 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1753 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1754 | 0 \ |
| 1755 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1756 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1757 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1758 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1759 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1760 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1761 | -c "ignoring unexpected CID" \ |
| 1762 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1763 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1764 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1765 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1766 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1767 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1768 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1769 | 0 \ |
| 1770 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1771 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1772 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1773 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1774 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1775 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1776 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1777 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1778 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 1779 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1780 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1781 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1782 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1783 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1784 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1785 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1786 | 0 \ |
| 1787 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1788 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1789 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1790 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1791 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1792 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1793 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1794 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1795 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 1796 | -c "ignoring unexpected CID" \ |
| 1797 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1798 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1799 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1801 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 1802 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1803 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1804 | 0 \ |
| 1805 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1806 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1807 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1808 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1809 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1810 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1811 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1812 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1813 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 1814 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1815 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1816 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1817 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1818 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1819 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1820 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1821 | 0 \ |
| 1822 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1823 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1824 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1825 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1826 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1827 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1828 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1829 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1830 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 1831 | -c "ignoring unexpected CID" \ |
| 1832 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1833 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1834 | # Tests for Encrypt-then-MAC extension |
| 1835 | |
| 1836 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1837 | "$P_SRV debug_level=3 \ |
| 1838 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1839 | "$P_CLI debug_level=3" \ |
| 1840 | 0 \ |
| 1841 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1842 | -s "found encrypt then mac extension" \ |
| 1843 | -s "server hello, adding encrypt then mac extension" \ |
| 1844 | -c "found encrypt_then_mac extension" \ |
| 1845 | -c "using encrypt then mac" \ |
| 1846 | -s "using encrypt then mac" |
| 1847 | |
| 1848 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1849 | "$P_SRV debug_level=3 etm=0 \ |
| 1850 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1851 | "$P_CLI debug_level=3 etm=1" \ |
| 1852 | 0 \ |
| 1853 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1854 | -s "found encrypt then mac extension" \ |
| 1855 | -S "server hello, adding encrypt then mac extension" \ |
| 1856 | -C "found encrypt_then_mac extension" \ |
| 1857 | -C "using encrypt then mac" \ |
| 1858 | -S "using encrypt then mac" |
| 1859 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1860 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1861 | "$P_SRV debug_level=3 etm=1 \ |
| 1862 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1863 | "$P_CLI debug_level=3 etm=1" \ |
| 1864 | 0 \ |
| 1865 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1866 | -s "found encrypt then mac extension" \ |
| 1867 | -S "server hello, adding encrypt then mac extension" \ |
| 1868 | -C "found encrypt_then_mac extension" \ |
| 1869 | -C "using encrypt then mac" \ |
| 1870 | -S "using encrypt then mac" |
| 1871 | |
| 1872 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1873 | "$P_SRV debug_level=3 etm=1 \ |
| 1874 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1875 | "$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] | 1876 | 0 \ |
| 1877 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1878 | -s "found encrypt then mac extension" \ |
| 1879 | -S "server hello, adding encrypt then mac extension" \ |
| 1880 | -C "found encrypt_then_mac extension" \ |
| 1881 | -C "using encrypt then mac" \ |
| 1882 | -S "using encrypt then mac" |
| 1883 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1884 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1885 | "$P_SRV debug_level=3 etm=1 \ |
| 1886 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1887 | "$P_CLI debug_level=3 etm=0" \ |
| 1888 | 0 \ |
| 1889 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1890 | -S "found encrypt then mac extension" \ |
| 1891 | -S "server hello, adding encrypt then mac extension" \ |
| 1892 | -C "found encrypt_then_mac extension" \ |
| 1893 | -C "using encrypt then mac" \ |
| 1894 | -S "using encrypt then mac" |
| 1895 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1896 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1897 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1898 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1899 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1900 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1901 | 0 \ |
| 1902 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1903 | -S "found encrypt then mac extension" \ |
| 1904 | -S "server hello, adding encrypt then mac extension" \ |
| 1905 | -C "found encrypt_then_mac extension" \ |
| 1906 | -C "using encrypt then mac" \ |
| 1907 | -S "using encrypt then mac" |
| 1908 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1909 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1910 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1911 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1912 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1913 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1914 | 0 \ |
| 1915 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1916 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1917 | -S "server hello, adding encrypt then mac extension" \ |
| 1918 | -C "found encrypt_then_mac extension" \ |
| 1919 | -C "using encrypt then mac" \ |
| 1920 | -S "using encrypt then mac" |
| 1921 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1922 | # Tests for Extended Master Secret extension |
| 1923 | |
| 1924 | run_test "Extended Master Secret: default" \ |
| 1925 | "$P_SRV debug_level=3" \ |
| 1926 | "$P_CLI debug_level=3" \ |
| 1927 | 0 \ |
| 1928 | -c "client hello, adding extended_master_secret extension" \ |
| 1929 | -s "found extended master secret extension" \ |
| 1930 | -s "server hello, adding extended master secret extension" \ |
| 1931 | -c "found extended_master_secret extension" \ |
| 1932 | -c "using extended master secret" \ |
| 1933 | -s "using extended master secret" |
| 1934 | |
| 1935 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1936 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1937 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1938 | 0 \ |
| 1939 | -c "client hello, adding extended_master_secret extension" \ |
| 1940 | -s "found extended master secret extension" \ |
| 1941 | -S "server hello, adding extended master secret extension" \ |
| 1942 | -C "found extended_master_secret extension" \ |
| 1943 | -C "using extended master secret" \ |
| 1944 | -S "using extended master secret" |
| 1945 | |
| 1946 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1947 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1948 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1949 | 0 \ |
| 1950 | -C "client hello, adding extended_master_secret extension" \ |
| 1951 | -S "found extended master secret extension" \ |
| 1952 | -S "server hello, adding extended master secret extension" \ |
| 1953 | -C "found extended_master_secret extension" \ |
| 1954 | -C "using extended master secret" \ |
| 1955 | -S "using extended master secret" |
| 1956 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1958 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1959 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1960 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1961 | 0 \ |
| 1962 | -C "client hello, adding extended_master_secret extension" \ |
| 1963 | -S "found extended master secret extension" \ |
| 1964 | -S "server hello, adding extended master secret extension" \ |
| 1965 | -C "found extended_master_secret extension" \ |
| 1966 | -C "using extended master secret" \ |
| 1967 | -S "using extended master secret" |
| 1968 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1970 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1971 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1972 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1973 | 0 \ |
| 1974 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1975 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1976 | -S "server hello, adding extended master secret extension" \ |
| 1977 | -C "found extended_master_secret extension" \ |
| 1978 | -C "using extended master secret" \ |
| 1979 | -S "using extended master secret" |
| 1980 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1981 | # Tests for FALLBACK_SCSV |
| 1982 | |
| 1983 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1984 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1985 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1986 | 0 \ |
| 1987 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1988 | -S "received FALLBACK_SCSV" \ |
| 1989 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1990 | -C "is a fatal alert message (msg 86)" |
| 1991 | |
| 1992 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1993 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1994 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1995 | 0 \ |
| 1996 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1997 | -S "received FALLBACK_SCSV" \ |
| 1998 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1999 | -C "is a fatal alert message (msg 86)" |
| 2000 | |
| 2001 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2002 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2003 | "$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] | 2004 | 1 \ |
| 2005 | -c "adding FALLBACK_SCSV" \ |
| 2006 | -s "received FALLBACK_SCSV" \ |
| 2007 | -s "inapropriate fallback" \ |
| 2008 | -c "is a fatal alert message (msg 86)" |
| 2009 | |
| 2010 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2011 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2012 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2013 | 0 \ |
| 2014 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2015 | -s "received FALLBACK_SCSV" \ |
| 2016 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2017 | -C "is a fatal alert message (msg 86)" |
| 2018 | |
| 2019 | requires_openssl_with_fallback_scsv |
| 2020 | run_test "Fallback SCSV: default, openssl server" \ |
| 2021 | "$O_SRV" \ |
| 2022 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2023 | 0 \ |
| 2024 | -C "adding FALLBACK_SCSV" \ |
| 2025 | -C "is a fatal alert message (msg 86)" |
| 2026 | |
| 2027 | requires_openssl_with_fallback_scsv |
| 2028 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2029 | "$O_SRV" \ |
| 2030 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2031 | 1 \ |
| 2032 | -c "adding FALLBACK_SCSV" \ |
| 2033 | -c "is a fatal alert message (msg 86)" |
| 2034 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2035 | requires_openssl_with_fallback_scsv |
| 2036 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2037 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2038 | "$O_CLI -tls1_1" \ |
| 2039 | 0 \ |
| 2040 | -S "received FALLBACK_SCSV" \ |
| 2041 | -S "inapropriate fallback" |
| 2042 | |
| 2043 | requires_openssl_with_fallback_scsv |
| 2044 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2045 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2046 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2047 | 1 \ |
| 2048 | -s "received FALLBACK_SCSV" \ |
| 2049 | -s "inapropriate fallback" |
| 2050 | |
| 2051 | requires_openssl_with_fallback_scsv |
| 2052 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2053 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2054 | "$O_CLI -fallback_scsv" \ |
| 2055 | 0 \ |
| 2056 | -s "received FALLBACK_SCSV" \ |
| 2057 | -S "inapropriate fallback" |
| 2058 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2059 | # Test sending and receiving empty application data records |
| 2060 | |
| 2061 | run_test "Encrypt then MAC: empty application data record" \ |
| 2062 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2063 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2064 | 0 \ |
| 2065 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2066 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2067 | -c "0 bytes written in 1 fragments" |
| 2068 | |
| 2069 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2070 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2071 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2072 | 0 \ |
| 2073 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2074 | -c "0 bytes written in 1 fragments" |
| 2075 | |
| 2076 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2077 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2078 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2079 | 0 \ |
| 2080 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2081 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2082 | -c "0 bytes written in 1 fragments" |
| 2083 | |
| 2084 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2085 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2086 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2087 | 0 \ |
| 2088 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2089 | -c "0 bytes written in 1 fragments" |
| 2090 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2091 | ## ClientHello generated with |
| 2092 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2093 | ## then manually twiddling the ciphersuite list. |
| 2094 | ## The ClientHello content is spelled out below as a hex string as |
| 2095 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2096 | ## The expected response is an inappropriate_fallback alert. |
| 2097 | requires_openssl_with_fallback_scsv |
| 2098 | run_test "Fallback SCSV: beginning of list" \ |
| 2099 | "$P_SRV debug_level=2" \ |
| 2100 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2101 | 0 \ |
| 2102 | -s "received FALLBACK_SCSV" \ |
| 2103 | -s "inapropriate fallback" |
| 2104 | |
| 2105 | requires_openssl_with_fallback_scsv |
| 2106 | run_test "Fallback SCSV: end of list" \ |
| 2107 | "$P_SRV debug_level=2" \ |
| 2108 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2109 | 0 \ |
| 2110 | -s "received FALLBACK_SCSV" \ |
| 2111 | -s "inapropriate fallback" |
| 2112 | |
| 2113 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2114 | requires_openssl_with_fallback_scsv |
| 2115 | run_test "Fallback SCSV: not in list" \ |
| 2116 | "$P_SRV debug_level=2" \ |
| 2117 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2118 | 0 \ |
| 2119 | -S "received FALLBACK_SCSV" \ |
| 2120 | -S "inapropriate fallback" |
| 2121 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2122 | # Tests for CBC 1/n-1 record splitting |
| 2123 | |
| 2124 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2125 | "$P_SRV" \ |
| 2126 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2127 | request_size=123 force_version=tls1_2" \ |
| 2128 | 0 \ |
| 2129 | -s "Read from client: 123 bytes read" \ |
| 2130 | -S "Read from client: 1 bytes read" \ |
| 2131 | -S "122 bytes read" |
| 2132 | |
| 2133 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2134 | "$P_SRV" \ |
| 2135 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2136 | request_size=123 force_version=tls1_1" \ |
| 2137 | 0 \ |
| 2138 | -s "Read from client: 123 bytes read" \ |
| 2139 | -S "Read from client: 1 bytes read" \ |
| 2140 | -S "122 bytes read" |
| 2141 | |
| 2142 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2143 | "$P_SRV" \ |
| 2144 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2145 | request_size=123 force_version=tls1" \ |
| 2146 | 0 \ |
| 2147 | -S "Read from client: 123 bytes read" \ |
| 2148 | -s "Read from client: 1 bytes read" \ |
| 2149 | -s "122 bytes read" |
| 2150 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2152 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2153 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2154 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2155 | request_size=123 force_version=ssl3" \ |
| 2156 | 0 \ |
| 2157 | -S "Read from client: 123 bytes read" \ |
| 2158 | -s "Read from client: 1 bytes read" \ |
| 2159 | -s "122 bytes read" |
| 2160 | |
| 2161 | 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] | 2162 | "$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] | 2163 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2164 | request_size=123 force_version=tls1" \ |
| 2165 | 0 \ |
| 2166 | -s "Read from client: 123 bytes read" \ |
| 2167 | -S "Read from client: 1 bytes read" \ |
| 2168 | -S "122 bytes read" |
| 2169 | |
| 2170 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2171 | "$P_SRV" \ |
| 2172 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2173 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2174 | 0 \ |
| 2175 | -s "Read from client: 123 bytes read" \ |
| 2176 | -S "Read from client: 1 bytes read" \ |
| 2177 | -S "122 bytes read" |
| 2178 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2179 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2180 | "$P_SRV nbio=2" \ |
| 2181 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2182 | request_size=123 force_version=tls1" \ |
| 2183 | 0 \ |
| 2184 | -S "Read from client: 123 bytes read" \ |
| 2185 | -s "Read from client: 1 bytes read" \ |
| 2186 | -s "122 bytes read" |
| 2187 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2188 | # Tests for Session Tickets |
| 2189 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2190 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2191 | "$P_SRV debug_level=3 tickets=1" \ |
| 2192 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2193 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2194 | -c "client hello, adding session ticket extension" \ |
| 2195 | -s "found session ticket extension" \ |
| 2196 | -s "server hello, adding session ticket extension" \ |
| 2197 | -c "found session_ticket extension" \ |
| 2198 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2199 | -S "session successfully restored from cache" \ |
| 2200 | -s "session successfully restored from ticket" \ |
| 2201 | -s "a session has been resumed" \ |
| 2202 | -c "a session has been resumed" |
| 2203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2204 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2205 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2206 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2207 | 0 \ |
| 2208 | -c "client hello, adding session ticket extension" \ |
| 2209 | -s "found session ticket extension" \ |
| 2210 | -s "server hello, adding session ticket extension" \ |
| 2211 | -c "found session_ticket extension" \ |
| 2212 | -c "parse new session ticket" \ |
| 2213 | -S "session successfully restored from cache" \ |
| 2214 | -s "session successfully restored from ticket" \ |
| 2215 | -s "a session has been resumed" \ |
| 2216 | -c "a session has been resumed" |
| 2217 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2218 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2219 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2220 | "$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] | 2221 | 0 \ |
| 2222 | -c "client hello, adding session ticket extension" \ |
| 2223 | -s "found session ticket extension" \ |
| 2224 | -s "server hello, adding session ticket extension" \ |
| 2225 | -c "found session_ticket extension" \ |
| 2226 | -c "parse new session ticket" \ |
| 2227 | -S "session successfully restored from cache" \ |
| 2228 | -S "session successfully restored from ticket" \ |
| 2229 | -S "a session has been resumed" \ |
| 2230 | -C "a session has been resumed" |
| 2231 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2232 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2233 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2234 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2235 | 0 \ |
| 2236 | -c "client hello, adding session ticket extension" \ |
| 2237 | -c "found session_ticket extension" \ |
| 2238 | -c "parse new session ticket" \ |
| 2239 | -c "a session has been resumed" |
| 2240 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2241 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2242 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2243 | "( $O_CLI -sess_out $SESSION; \ |
| 2244 | $O_CLI -sess_in $SESSION; \ |
| 2245 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2246 | 0 \ |
| 2247 | -s "found session ticket extension" \ |
| 2248 | -s "server hello, adding session ticket extension" \ |
| 2249 | -S "session successfully restored from cache" \ |
| 2250 | -s "session successfully restored from ticket" \ |
| 2251 | -s "a session has been resumed" |
| 2252 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2253 | # Tests for Session Tickets with DTLS |
| 2254 | |
| 2255 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2256 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2257 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2258 | 0 \ |
| 2259 | -c "client hello, adding session ticket extension" \ |
| 2260 | -s "found session ticket extension" \ |
| 2261 | -s "server hello, adding session ticket extension" \ |
| 2262 | -c "found session_ticket extension" \ |
| 2263 | -c "parse new session ticket" \ |
| 2264 | -S "session successfully restored from cache" \ |
| 2265 | -s "session successfully restored from ticket" \ |
| 2266 | -s "a session has been resumed" \ |
| 2267 | -c "a session has been resumed" |
| 2268 | |
| 2269 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2270 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2271 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2272 | 0 \ |
| 2273 | -c "client hello, adding session ticket extension" \ |
| 2274 | -s "found session ticket extension" \ |
| 2275 | -s "server hello, adding session ticket extension" \ |
| 2276 | -c "found session_ticket extension" \ |
| 2277 | -c "parse new session ticket" \ |
| 2278 | -S "session successfully restored from cache" \ |
| 2279 | -s "session successfully restored from ticket" \ |
| 2280 | -s "a session has been resumed" \ |
| 2281 | -c "a session has been resumed" |
| 2282 | |
| 2283 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2284 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2285 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2286 | 0 \ |
| 2287 | -c "client hello, adding session ticket extension" \ |
| 2288 | -s "found session ticket extension" \ |
| 2289 | -s "server hello, adding session ticket extension" \ |
| 2290 | -c "found session_ticket extension" \ |
| 2291 | -c "parse new session ticket" \ |
| 2292 | -S "session successfully restored from cache" \ |
| 2293 | -S "session successfully restored from ticket" \ |
| 2294 | -S "a session has been resumed" \ |
| 2295 | -C "a session has been resumed" |
| 2296 | |
| 2297 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2298 | "$O_SRV -dtls1" \ |
| 2299 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2300 | 0 \ |
| 2301 | -c "client hello, adding session ticket extension" \ |
| 2302 | -c "found session_ticket extension" \ |
| 2303 | -c "parse new session ticket" \ |
| 2304 | -c "a session has been resumed" |
| 2305 | |
| 2306 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2307 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2308 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2309 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2310 | rm -f $SESSION )" \ |
| 2311 | 0 \ |
| 2312 | -s "found session ticket extension" \ |
| 2313 | -s "server hello, adding session ticket extension" \ |
| 2314 | -S "session successfully restored from cache" \ |
| 2315 | -s "session successfully restored from ticket" \ |
| 2316 | -s "a session has been resumed" |
| 2317 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2318 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2319 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2320 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2321 | "$P_SRV debug_level=3 tickets=0" \ |
| 2322 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2323 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2324 | -c "client hello, adding session ticket extension" \ |
| 2325 | -s "found session ticket extension" \ |
| 2326 | -S "server hello, adding session ticket extension" \ |
| 2327 | -C "found session_ticket extension" \ |
| 2328 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2329 | -s "session successfully restored from cache" \ |
| 2330 | -S "session successfully restored from ticket" \ |
| 2331 | -s "a session has been resumed" \ |
| 2332 | -c "a session has been resumed" |
| 2333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2334 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2335 | "$P_SRV debug_level=3 tickets=1" \ |
| 2336 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2337 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2338 | -C "client hello, adding session ticket extension" \ |
| 2339 | -S "found session ticket extension" \ |
| 2340 | -S "server hello, adding session ticket extension" \ |
| 2341 | -C "found session_ticket extension" \ |
| 2342 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2343 | -s "session successfully restored from cache" \ |
| 2344 | -S "session successfully restored from ticket" \ |
| 2345 | -s "a session has been resumed" \ |
| 2346 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2347 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2348 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2349 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2350 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2351 | 0 \ |
| 2352 | -S "session successfully restored from cache" \ |
| 2353 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2354 | -S "a session has been resumed" \ |
| 2355 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2356 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2357 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2358 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2359 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2360 | 0 \ |
| 2361 | -s "session successfully restored from cache" \ |
| 2362 | -S "session successfully restored from ticket" \ |
| 2363 | -s "a session has been resumed" \ |
| 2364 | -c "a session has been resumed" |
| 2365 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2366 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2367 | "$P_SRV debug_level=3 tickets=0" \ |
| 2368 | "$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] | 2369 | 0 \ |
| 2370 | -s "session successfully restored from cache" \ |
| 2371 | -S "session successfully restored from ticket" \ |
| 2372 | -s "a session has been resumed" \ |
| 2373 | -c "a session has been resumed" |
| 2374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2375 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2376 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2377 | "$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] | 2378 | 0 \ |
| 2379 | -S "session successfully restored from cache" \ |
| 2380 | -S "session successfully restored from ticket" \ |
| 2381 | -S "a session has been resumed" \ |
| 2382 | -C "a session has been resumed" |
| 2383 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2384 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2385 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2386 | "$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] | 2387 | 0 \ |
| 2388 | -s "session successfully restored from cache" \ |
| 2389 | -S "session successfully restored from ticket" \ |
| 2390 | -s "a session has been resumed" \ |
| 2391 | -c "a session has been resumed" |
| 2392 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2393 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2394 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2395 | "( $O_CLI -sess_out $SESSION; \ |
| 2396 | $O_CLI -sess_in $SESSION; \ |
| 2397 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2398 | 0 \ |
| 2399 | -s "found session ticket extension" \ |
| 2400 | -S "server hello, adding session ticket extension" \ |
| 2401 | -s "session successfully restored from cache" \ |
| 2402 | -S "session successfully restored from ticket" \ |
| 2403 | -s "a session has been resumed" |
| 2404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2405 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2406 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2407 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2408 | 0 \ |
| 2409 | -C "found session_ticket extension" \ |
| 2410 | -C "parse new session ticket" \ |
| 2411 | -c "a session has been resumed" |
| 2412 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2413 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2414 | |
| 2415 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2416 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2417 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2418 | 0 \ |
| 2419 | -c "client hello, adding session ticket extension" \ |
| 2420 | -s "found session ticket extension" \ |
| 2421 | -S "server hello, adding session ticket extension" \ |
| 2422 | -C "found session_ticket extension" \ |
| 2423 | -C "parse new session ticket" \ |
| 2424 | -s "session successfully restored from cache" \ |
| 2425 | -S "session successfully restored from ticket" \ |
| 2426 | -s "a session has been resumed" \ |
| 2427 | -c "a session has been resumed" |
| 2428 | |
| 2429 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2430 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2431 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2432 | 0 \ |
| 2433 | -C "client hello, adding session ticket extension" \ |
| 2434 | -S "found session ticket extension" \ |
| 2435 | -S "server hello, adding session ticket extension" \ |
| 2436 | -C "found session_ticket extension" \ |
| 2437 | -C "parse new session ticket" \ |
| 2438 | -s "session successfully restored from cache" \ |
| 2439 | -S "session successfully restored from ticket" \ |
| 2440 | -s "a session has been resumed" \ |
| 2441 | -c "a session has been resumed" |
| 2442 | |
| 2443 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2444 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2445 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2446 | 0 \ |
| 2447 | -S "session successfully restored from cache" \ |
| 2448 | -S "session successfully restored from ticket" \ |
| 2449 | -S "a session has been resumed" \ |
| 2450 | -C "a session has been resumed" |
| 2451 | |
| 2452 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2453 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2454 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2455 | 0 \ |
| 2456 | -s "session successfully restored from cache" \ |
| 2457 | -S "session successfully restored from ticket" \ |
| 2458 | -s "a session has been resumed" \ |
| 2459 | -c "a session has been resumed" |
| 2460 | |
| 2461 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2462 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2463 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2464 | 0 \ |
| 2465 | -s "session successfully restored from cache" \ |
| 2466 | -S "session successfully restored from ticket" \ |
| 2467 | -s "a session has been resumed" \ |
| 2468 | -c "a session has been resumed" |
| 2469 | |
| 2470 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2471 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2472 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2473 | 0 \ |
| 2474 | -S "session successfully restored from cache" \ |
| 2475 | -S "session successfully restored from ticket" \ |
| 2476 | -S "a session has been resumed" \ |
| 2477 | -C "a session has been resumed" |
| 2478 | |
| 2479 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2480 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2481 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2482 | 0 \ |
| 2483 | -s "session successfully restored from cache" \ |
| 2484 | -S "session successfully restored from ticket" \ |
| 2485 | -s "a session has been resumed" \ |
| 2486 | -c "a session has been resumed" |
| 2487 | |
| 2488 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2489 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2490 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2491 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2492 | rm -f $SESSION )" \ |
| 2493 | 0 \ |
| 2494 | -s "found session ticket extension" \ |
| 2495 | -S "server hello, adding session ticket extension" \ |
| 2496 | -s "session successfully restored from cache" \ |
| 2497 | -S "session successfully restored from ticket" \ |
| 2498 | -s "a session has been resumed" |
| 2499 | |
| 2500 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2501 | "$O_SRV -dtls1" \ |
| 2502 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2503 | 0 \ |
| 2504 | -C "found session_ticket extension" \ |
| 2505 | -C "parse new session ticket" \ |
| 2506 | -c "a session has been resumed" |
| 2507 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2508 | # Tests for Max Fragment Length extension |
| 2509 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2510 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2511 | 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] | 2512 | exit 1 |
| 2513 | fi |
| 2514 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2515 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2516 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2517 | fi |
| 2518 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2520 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2521 | "$P_SRV debug_level=3" \ |
| 2522 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2523 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2524 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2525 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2526 | -C "client hello, adding max_fragment_length extension" \ |
| 2527 | -S "found max fragment length extension" \ |
| 2528 | -S "server hello, max_fragment_length extension" \ |
| 2529 | -C "found max_fragment_length extension" |
| 2530 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2532 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2533 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2534 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2535 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2536 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2537 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2538 | -C "client hello, adding max_fragment_length extension" \ |
| 2539 | -S "found max fragment length extension" \ |
| 2540 | -S "server hello, max_fragment_length extension" \ |
| 2541 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2542 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2543 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2544 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2545 | |
| 2546 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2547 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2548 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2549 | "$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] | 2550 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2551 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2552 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2553 | -C "client hello, adding max_fragment_length extension" \ |
| 2554 | -S "found max fragment length extension" \ |
| 2555 | -S "server hello, max_fragment_length extension" \ |
| 2556 | -C "found max_fragment_length extension" \ |
| 2557 | -c "fragment larger than.*maximum " |
| 2558 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2559 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2560 | # (session fragment length will be 16384 regardless of mbedtls |
| 2561 | # content length configuration.) |
| 2562 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2563 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2564 | run_test "Max fragment length: disabled, larger message" \ |
| 2565 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2566 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2567 | 0 \ |
| 2568 | -C "Maximum fragment length is 16384" \ |
| 2569 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2570 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2571 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2572 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2573 | |
| 2574 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2575 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2576 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2577 | "$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] | 2578 | 1 \ |
| 2579 | -C "Maximum fragment length is 16384" \ |
| 2580 | -S "Maximum fragment length is 16384" \ |
| 2581 | -c "fragment larger than.*maximum " |
| 2582 | |
| 2583 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2584 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2585 | "$P_SRV debug_level=3" \ |
| 2586 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2587 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2588 | -c "Maximum fragment length is 4096" \ |
| 2589 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2590 | -c "client hello, adding max_fragment_length extension" \ |
| 2591 | -s "found max fragment length extension" \ |
| 2592 | -s "server hello, max_fragment_length extension" \ |
| 2593 | -c "found max_fragment_length extension" |
| 2594 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2595 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2596 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2597 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2598 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2599 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2600 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2601 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2602 | -C "client hello, adding max_fragment_length extension" \ |
| 2603 | -S "found max fragment length extension" \ |
| 2604 | -S "server hello, max_fragment_length extension" \ |
| 2605 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2606 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2607 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2608 | requires_gnutls |
| 2609 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2610 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2611 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2612 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2613 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2614 | -c "client hello, adding max_fragment_length extension" \ |
| 2615 | -c "found max_fragment_length extension" |
| 2616 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2617 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2618 | run_test "Max fragment length: client, message just fits" \ |
| 2619 | "$P_SRV debug_level=3" \ |
| 2620 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2621 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2622 | -c "Maximum fragment length is 2048" \ |
| 2623 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2624 | -c "client hello, adding max_fragment_length extension" \ |
| 2625 | -s "found max fragment length extension" \ |
| 2626 | -s "server hello, max_fragment_length extension" \ |
| 2627 | -c "found max_fragment_length extension" \ |
| 2628 | -c "2048 bytes written in 1 fragments" \ |
| 2629 | -s "2048 bytes read" |
| 2630 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2631 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2632 | run_test "Max fragment length: client, larger message" \ |
| 2633 | "$P_SRV debug_level=3" \ |
| 2634 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2635 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2636 | -c "Maximum fragment length is 2048" \ |
| 2637 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2638 | -c "client hello, adding max_fragment_length extension" \ |
| 2639 | -s "found max fragment length extension" \ |
| 2640 | -s "server hello, max_fragment_length extension" \ |
| 2641 | -c "found max_fragment_length extension" \ |
| 2642 | -c "2345 bytes written in 2 fragments" \ |
| 2643 | -s "2048 bytes read" \ |
| 2644 | -s "297 bytes read" |
| 2645 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2646 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2647 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2648 | "$P_SRV debug_level=3 dtls=1" \ |
| 2649 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2650 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2651 | -c "Maximum fragment length is 2048" \ |
| 2652 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2653 | -c "client hello, adding max_fragment_length extension" \ |
| 2654 | -s "found max fragment length extension" \ |
| 2655 | -s "server hello, max_fragment_length extension" \ |
| 2656 | -c "found max_fragment_length extension" \ |
| 2657 | -c "fragment larger than.*maximum" |
| 2658 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2659 | # Tests for renegotiation |
| 2660 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2661 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2662 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2663 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2664 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2665 | 0 \ |
| 2666 | -C "client hello, adding renegotiation extension" \ |
| 2667 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2668 | -S "found renegotiation extension" \ |
| 2669 | -s "server hello, secure renegotiation extension" \ |
| 2670 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2671 | -C "=> renegotiate" \ |
| 2672 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2673 | -S "write hello request" |
| 2674 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2675 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2676 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2677 | "$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] | 2678 | "$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] | 2679 | 0 \ |
| 2680 | -c "client hello, adding renegotiation extension" \ |
| 2681 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2682 | -s "found renegotiation extension" \ |
| 2683 | -s "server hello, secure renegotiation extension" \ |
| 2684 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2685 | -c "=> renegotiate" \ |
| 2686 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2687 | -S "write hello request" |
| 2688 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2689 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2690 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2691 | "$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] | 2692 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2693 | 0 \ |
| 2694 | -c "client hello, adding renegotiation extension" \ |
| 2695 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2696 | -s "found renegotiation extension" \ |
| 2697 | -s "server hello, secure renegotiation extension" \ |
| 2698 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2699 | -c "=> renegotiate" \ |
| 2700 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2701 | -s "write hello request" |
| 2702 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2703 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2704 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2705 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2706 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2707 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2708 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2709 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2710 | 0 \ |
| 2711 | -c "client hello, adding renegotiation extension" \ |
| 2712 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2713 | -s "found renegotiation extension" \ |
| 2714 | -s "server hello, secure renegotiation extension" \ |
| 2715 | -c "found renegotiation extension" \ |
| 2716 | -c "=> renegotiate" \ |
| 2717 | -s "=> renegotiate" \ |
| 2718 | -S "write hello request" \ |
| 2719 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2720 | |
| 2721 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2722 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2723 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2724 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2725 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2726 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2727 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2728 | 0 \ |
| 2729 | -c "client hello, adding renegotiation extension" \ |
| 2730 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2731 | -s "found renegotiation extension" \ |
| 2732 | -s "server hello, secure renegotiation extension" \ |
| 2733 | -c "found renegotiation extension" \ |
| 2734 | -c "=> renegotiate" \ |
| 2735 | -s "=> renegotiate" \ |
| 2736 | -s "write hello request" \ |
| 2737 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2738 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2740 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2741 | "$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] | 2742 | "$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] | 2743 | 0 \ |
| 2744 | -c "client hello, adding renegotiation extension" \ |
| 2745 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2746 | -s "found renegotiation extension" \ |
| 2747 | -s "server hello, secure renegotiation extension" \ |
| 2748 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2749 | -c "=> renegotiate" \ |
| 2750 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2751 | -s "write hello request" |
| 2752 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2753 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2754 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2755 | "$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] | 2756 | "$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] | 2757 | 1 \ |
| 2758 | -c "client hello, adding renegotiation extension" \ |
| 2759 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2760 | -S "found renegotiation extension" \ |
| 2761 | -s "server hello, secure renegotiation extension" \ |
| 2762 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2763 | -c "=> renegotiate" \ |
| 2764 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2765 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2766 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2767 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2768 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2770 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2771 | "$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] | 2772 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2773 | 0 \ |
| 2774 | -C "client hello, adding renegotiation extension" \ |
| 2775 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2776 | -S "found renegotiation extension" \ |
| 2777 | -s "server hello, secure renegotiation extension" \ |
| 2778 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2779 | -C "=> renegotiate" \ |
| 2780 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2781 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2782 | -S "SSL - An unexpected message was received from our peer" \ |
| 2783 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2784 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2786 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2787 | "$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] | 2788 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2789 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2790 | 0 \ |
| 2791 | -C "client hello, adding renegotiation extension" \ |
| 2792 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2793 | -S "found renegotiation extension" \ |
| 2794 | -s "server hello, secure renegotiation extension" \ |
| 2795 | -c "found renegotiation extension" \ |
| 2796 | -C "=> renegotiate" \ |
| 2797 | -S "=> renegotiate" \ |
| 2798 | -s "write hello request" \ |
| 2799 | -S "SSL - An unexpected message was received from our peer" \ |
| 2800 | -S "failed" |
| 2801 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2802 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2804 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2805 | "$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] | 2806 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2807 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2808 | 0 \ |
| 2809 | -C "client hello, adding renegotiation extension" \ |
| 2810 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2811 | -S "found renegotiation extension" \ |
| 2812 | -s "server hello, secure renegotiation extension" \ |
| 2813 | -c "found renegotiation extension" \ |
| 2814 | -C "=> renegotiate" \ |
| 2815 | -S "=> renegotiate" \ |
| 2816 | -s "write hello request" \ |
| 2817 | -S "SSL - An unexpected message was received from our peer" \ |
| 2818 | -S "failed" |
| 2819 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2820 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2821 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2822 | "$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] | 2823 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2824 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2825 | 0 \ |
| 2826 | -C "client hello, adding renegotiation extension" \ |
| 2827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2828 | -S "found renegotiation extension" \ |
| 2829 | -s "server hello, secure renegotiation extension" \ |
| 2830 | -c "found renegotiation extension" \ |
| 2831 | -C "=> renegotiate" \ |
| 2832 | -S "=> renegotiate" \ |
| 2833 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2834 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2835 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2836 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2837 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2838 | "$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] | 2839 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2840 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2841 | 0 \ |
| 2842 | -c "client hello, adding renegotiation extension" \ |
| 2843 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2844 | -s "found renegotiation extension" \ |
| 2845 | -s "server hello, secure renegotiation extension" \ |
| 2846 | -c "found renegotiation extension" \ |
| 2847 | -c "=> renegotiate" \ |
| 2848 | -s "=> renegotiate" \ |
| 2849 | -s "write hello request" \ |
| 2850 | -S "SSL - An unexpected message was received from our peer" \ |
| 2851 | -S "failed" |
| 2852 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2854 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2855 | "$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] | 2856 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2857 | 0 \ |
| 2858 | -C "client hello, adding renegotiation extension" \ |
| 2859 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2860 | -S "found renegotiation extension" \ |
| 2861 | -s "server hello, secure renegotiation extension" \ |
| 2862 | -c "found renegotiation extension" \ |
| 2863 | -S "record counter limit reached: renegotiate" \ |
| 2864 | -C "=> renegotiate" \ |
| 2865 | -S "=> renegotiate" \ |
| 2866 | -S "write hello request" \ |
| 2867 | -S "SSL - An unexpected message was received from our peer" \ |
| 2868 | -S "failed" |
| 2869 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2870 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2872 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2873 | "$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] | 2874 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2875 | 0 \ |
| 2876 | -c "client hello, adding renegotiation extension" \ |
| 2877 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2878 | -s "found renegotiation extension" \ |
| 2879 | -s "server hello, secure renegotiation extension" \ |
| 2880 | -c "found renegotiation extension" \ |
| 2881 | -s "record counter limit reached: renegotiate" \ |
| 2882 | -c "=> renegotiate" \ |
| 2883 | -s "=> renegotiate" \ |
| 2884 | -s "write hello request" \ |
| 2885 | -S "SSL - An unexpected message was received from our peer" \ |
| 2886 | -S "failed" |
| 2887 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2888 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2889 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2890 | "$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] | 2891 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2892 | 0 \ |
| 2893 | -c "client hello, adding renegotiation extension" \ |
| 2894 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2895 | -s "found renegotiation extension" \ |
| 2896 | -s "server hello, secure renegotiation extension" \ |
| 2897 | -c "found renegotiation extension" \ |
| 2898 | -s "record counter limit reached: renegotiate" \ |
| 2899 | -c "=> renegotiate" \ |
| 2900 | -s "=> renegotiate" \ |
| 2901 | -s "write hello request" \ |
| 2902 | -S "SSL - An unexpected message was received from our peer" \ |
| 2903 | -S "failed" |
| 2904 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2906 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2907 | "$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] | 2908 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2909 | 0 \ |
| 2910 | -C "client hello, adding renegotiation extension" \ |
| 2911 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2912 | -S "found renegotiation extension" \ |
| 2913 | -s "server hello, secure renegotiation extension" \ |
| 2914 | -c "found renegotiation extension" \ |
| 2915 | -S "record counter limit reached: renegotiate" \ |
| 2916 | -C "=> renegotiate" \ |
| 2917 | -S "=> renegotiate" \ |
| 2918 | -S "write hello request" \ |
| 2919 | -S "SSL - An unexpected message was received from our peer" \ |
| 2920 | -S "failed" |
| 2921 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2922 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2923 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2924 | "$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] | 2925 | "$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] | 2926 | 0 \ |
| 2927 | -c "client hello, adding renegotiation extension" \ |
| 2928 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2929 | -s "found renegotiation extension" \ |
| 2930 | -s "server hello, secure renegotiation extension" \ |
| 2931 | -c "found renegotiation extension" \ |
| 2932 | -c "=> renegotiate" \ |
| 2933 | -s "=> renegotiate" \ |
| 2934 | -S "write hello request" |
| 2935 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2936 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2937 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2938 | "$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] | 2939 | "$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] | 2940 | 0 \ |
| 2941 | -c "client hello, adding renegotiation extension" \ |
| 2942 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2943 | -s "found renegotiation extension" \ |
| 2944 | -s "server hello, secure renegotiation extension" \ |
| 2945 | -c "found renegotiation extension" \ |
| 2946 | -c "=> renegotiate" \ |
| 2947 | -s "=> renegotiate" \ |
| 2948 | -s "write hello request" |
| 2949 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2951 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2952 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2953 | "$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] | 2954 | 0 \ |
| 2955 | -c "client hello, adding renegotiation extension" \ |
| 2956 | -c "found renegotiation extension" \ |
| 2957 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2958 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2959 | -C "error" \ |
| 2960 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2961 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2962 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2964 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2965 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2966 | "$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] | 2967 | 0 \ |
| 2968 | -c "client hello, adding renegotiation extension" \ |
| 2969 | -c "found renegotiation extension" \ |
| 2970 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2971 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2972 | -C "error" \ |
| 2973 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2974 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2975 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2977 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2978 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2979 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2980 | 1 \ |
| 2981 | -c "client hello, adding renegotiation extension" \ |
| 2982 | -C "found renegotiation extension" \ |
| 2983 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2984 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2985 | -c "error" \ |
| 2986 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2987 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2988 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2989 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2990 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2991 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2992 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2993 | allow_legacy=0" \ |
| 2994 | 1 \ |
| 2995 | -c "client hello, adding renegotiation extension" \ |
| 2996 | -C "found renegotiation extension" \ |
| 2997 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2998 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2999 | -c "error" \ |
| 3000 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3001 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3002 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3003 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3004 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3005 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3006 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3007 | allow_legacy=1" \ |
| 3008 | 0 \ |
| 3009 | -c "client hello, adding renegotiation extension" \ |
| 3010 | -C "found renegotiation extension" \ |
| 3011 | -c "=> renegotiate" \ |
| 3012 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3013 | -C "error" \ |
| 3014 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3015 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3017 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3018 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3019 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3020 | 0 \ |
| 3021 | -c "client hello, adding renegotiation extension" \ |
| 3022 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3023 | -s "found renegotiation extension" \ |
| 3024 | -s "server hello, secure renegotiation extension" \ |
| 3025 | -c "found renegotiation extension" \ |
| 3026 | -c "=> renegotiate" \ |
| 3027 | -s "=> renegotiate" \ |
| 3028 | -S "write hello request" |
| 3029 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3031 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3032 | "$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] | 3033 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3034 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3035 | 0 \ |
| 3036 | -c "client hello, adding renegotiation extension" \ |
| 3037 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3038 | -s "found renegotiation extension" \ |
| 3039 | -s "server hello, secure renegotiation extension" \ |
| 3040 | -c "found renegotiation extension" \ |
| 3041 | -c "=> renegotiate" \ |
| 3042 | -s "=> renegotiate" \ |
| 3043 | -s "write hello request" |
| 3044 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3046 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3047 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3048 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3049 | 0 \ |
| 3050 | -c "client hello, adding renegotiation extension" \ |
| 3051 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3052 | -s "found renegotiation extension" \ |
| 3053 | -s "server hello, secure renegotiation extension" \ |
| 3054 | -s "record counter limit reached: renegotiate" \ |
| 3055 | -c "=> renegotiate" \ |
| 3056 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3057 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3058 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3059 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3060 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3061 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3062 | "$G_SRV -u --mtu 4096" \ |
| 3063 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3064 | 0 \ |
| 3065 | -c "client hello, adding renegotiation extension" \ |
| 3066 | -c "found renegotiation extension" \ |
| 3067 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3068 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3069 | -C "error" \ |
| 3070 | -s "Extra-header:" |
| 3071 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3072 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3073 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3074 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3075 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3076 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3077 | "$P_CLI debug_level=3" \ |
| 3078 | 0 \ |
| 3079 | -c "found renegotiation extension" \ |
| 3080 | -C "error" \ |
| 3081 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3082 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3083 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3084 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3085 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3086 | "$P_CLI debug_level=3" \ |
| 3087 | 0 \ |
| 3088 | -C "found renegotiation extension" \ |
| 3089 | -C "error" \ |
| 3090 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3091 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3092 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3093 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3094 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3095 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3096 | 1 \ |
| 3097 | -C "found renegotiation extension" \ |
| 3098 | -c "error" \ |
| 3099 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3100 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3101 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3102 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3103 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3104 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3105 | 0 \ |
| 3106 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3107 | -s "server hello, secure renegotiation extension" |
| 3108 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3109 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3110 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3111 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3112 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3113 | 0 \ |
| 3114 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3115 | -S "server hello, secure renegotiation extension" |
| 3116 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3117 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3118 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3119 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3120 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3121 | 1 \ |
| 3122 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3123 | -S "server hello, secure renegotiation extension" |
| 3124 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3125 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3126 | |
| 3127 | requires_gnutls |
| 3128 | run_test "DER format: no trailing bytes" \ |
| 3129 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3130 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3131 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3132 | 0 \ |
| 3133 | -c "Handshake was completed" \ |
| 3134 | |
| 3135 | requires_gnutls |
| 3136 | run_test "DER format: with a trailing zero byte" \ |
| 3137 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3138 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3139 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3140 | 0 \ |
| 3141 | -c "Handshake was completed" \ |
| 3142 | |
| 3143 | requires_gnutls |
| 3144 | run_test "DER format: with a trailing random byte" \ |
| 3145 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3146 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3147 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3148 | 0 \ |
| 3149 | -c "Handshake was completed" \ |
| 3150 | |
| 3151 | requires_gnutls |
| 3152 | run_test "DER format: with 2 trailing random bytes" \ |
| 3153 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3154 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3155 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3156 | 0 \ |
| 3157 | -c "Handshake was completed" \ |
| 3158 | |
| 3159 | requires_gnutls |
| 3160 | run_test "DER format: with 4 trailing random bytes" \ |
| 3161 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3162 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3163 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3164 | 0 \ |
| 3165 | -c "Handshake was completed" \ |
| 3166 | |
| 3167 | requires_gnutls |
| 3168 | run_test "DER format: with 8 trailing random bytes" \ |
| 3169 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3170 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3171 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3172 | 0 \ |
| 3173 | -c "Handshake was completed" \ |
| 3174 | |
| 3175 | requires_gnutls |
| 3176 | run_test "DER format: with 9 trailing random bytes" \ |
| 3177 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3178 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3179 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3180 | 0 \ |
| 3181 | -c "Handshake was completed" \ |
| 3182 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3183 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3184 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3185 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3186 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3187 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3188 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3189 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3190 | 1 \ |
| 3191 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3192 | -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] | 3193 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3194 | -c "X509 - Certificate verification failed" |
| 3195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3196 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3197 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3198 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3199 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3200 | 0 \ |
| 3201 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3202 | -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] | 3203 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3204 | -C "X509 - Certificate verification failed" |
| 3205 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3206 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3207 | "$P_SRV" \ |
| 3208 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3209 | 0 \ |
| 3210 | -c "x509_verify_cert() returned" \ |
| 3211 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3212 | -c "! Certificate verification flags"\ |
| 3213 | -C "! mbedtls_ssl_handshake returned" \ |
| 3214 | -C "X509 - Certificate verification failed" \ |
| 3215 | -C "SSL - No CA Chain is set, but required to operate" |
| 3216 | |
| 3217 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3218 | "$P_SRV" \ |
| 3219 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3220 | 1 \ |
| 3221 | -c "x509_verify_cert() returned" \ |
| 3222 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3223 | -c "! Certificate verification flags"\ |
| 3224 | -c "! mbedtls_ssl_handshake returned" \ |
| 3225 | -c "SSL - No CA Chain is set, but required to operate" |
| 3226 | |
| 3227 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3228 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3229 | # the client informs the server about the supported curves - it does, though, in the |
| 3230 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3231 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3232 | # different means to have the server ignoring the client's supported curve list. |
| 3233 | |
| 3234 | requires_config_enabled MBEDTLS_ECP_C |
| 3235 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3236 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3237 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3238 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3239 | 1 \ |
| 3240 | -c "bad certificate (EC key curve)"\ |
| 3241 | -c "! Certificate verification flags"\ |
| 3242 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3243 | |
| 3244 | requires_config_enabled MBEDTLS_ECP_C |
| 3245 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3246 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3247 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3248 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3249 | 1 \ |
| 3250 | -c "bad certificate (EC key curve)"\ |
| 3251 | -c "! Certificate verification flags"\ |
| 3252 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3254 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3255 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3256 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3257 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3258 | 0 \ |
| 3259 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3260 | -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] | 3261 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3262 | -C "X509 - Certificate verification failed" |
| 3263 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3264 | run_test "Authentication: client SHA256, server required" \ |
| 3265 | "$P_SRV auth_mode=required" \ |
| 3266 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3267 | key_file=data_files/server6.key \ |
| 3268 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3269 | 0 \ |
| 3270 | -c "Supported Signature Algorithm found: 4," \ |
| 3271 | -c "Supported Signature Algorithm found: 5," |
| 3272 | |
| 3273 | run_test "Authentication: client SHA384, server required" \ |
| 3274 | "$P_SRV auth_mode=required" \ |
| 3275 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3276 | key_file=data_files/server6.key \ |
| 3277 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3278 | 0 \ |
| 3279 | -c "Supported Signature Algorithm found: 4," \ |
| 3280 | -c "Supported Signature Algorithm found: 5," |
| 3281 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3283 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3284 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3285 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3286 | key_file=data_files/server5.key" \ |
| 3287 | 1 \ |
| 3288 | -S "skip write certificate request" \ |
| 3289 | -C "skip parse certificate request" \ |
| 3290 | -c "got a certificate request" \ |
| 3291 | -c "got no certificate to send" \ |
| 3292 | -S "x509_verify_cert() returned" \ |
| 3293 | -s "client has no certificate" \ |
| 3294 | -s "! mbedtls_ssl_handshake returned" \ |
| 3295 | -c "! mbedtls_ssl_handshake returned" \ |
| 3296 | -s "No client certification received from the client, but required by the authentication mode" |
| 3297 | |
| 3298 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3299 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3300 | "$P_CLI debug_level=3 crt_file=none \ |
| 3301 | key_file=data_files/server5.key" \ |
| 3302 | 1 \ |
| 3303 | -S "skip write certificate request" \ |
| 3304 | -C "skip parse certificate request" \ |
| 3305 | -c "got a certificate request" \ |
| 3306 | -c "= write certificate$" \ |
| 3307 | -C "skip write certificate$" \ |
| 3308 | -S "x509_verify_cert() returned" \ |
| 3309 | -s "client has no certificate" \ |
| 3310 | -s "! mbedtls_ssl_handshake returned" \ |
| 3311 | -c "! mbedtls_ssl_handshake returned" \ |
| 3312 | -s "No client certification received from the client, but required by the authentication mode" |
| 3313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3314 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3315 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3316 | "$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] | 3317 | key_file=data_files/server5.key" \ |
| 3318 | 1 \ |
| 3319 | -S "skip write certificate request" \ |
| 3320 | -C "skip parse certificate request" \ |
| 3321 | -c "got a certificate request" \ |
| 3322 | -C "skip write certificate" \ |
| 3323 | -C "skip write certificate verify" \ |
| 3324 | -S "skip parse certificate verify" \ |
| 3325 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3326 | -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] | 3327 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3328 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3329 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3330 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3331 | # We don't check that the client receives the alert because it might |
| 3332 | # detect that its write end of the connection is closed and abort |
| 3333 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3334 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3335 | run_test "Authentication: client cert not trusted, server required" \ |
| 3336 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3337 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3338 | key_file=data_files/server5.key" \ |
| 3339 | 1 \ |
| 3340 | -S "skip write certificate request" \ |
| 3341 | -C "skip parse certificate request" \ |
| 3342 | -c "got a certificate request" \ |
| 3343 | -C "skip write certificate" \ |
| 3344 | -C "skip write certificate verify" \ |
| 3345 | -S "skip parse certificate verify" \ |
| 3346 | -s "x509_verify_cert() returned" \ |
| 3347 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3348 | -s "! mbedtls_ssl_handshake returned" \ |
| 3349 | -c "! mbedtls_ssl_handshake returned" \ |
| 3350 | -s "X509 - Certificate verification failed" |
| 3351 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3352 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3353 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3354 | "$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] | 3355 | key_file=data_files/server5.key" \ |
| 3356 | 0 \ |
| 3357 | -S "skip write certificate request" \ |
| 3358 | -C "skip parse certificate request" \ |
| 3359 | -c "got a certificate request" \ |
| 3360 | -C "skip write certificate" \ |
| 3361 | -C "skip write certificate verify" \ |
| 3362 | -S "skip parse certificate verify" \ |
| 3363 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3364 | -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] | 3365 | -S "! mbedtls_ssl_handshake returned" \ |
| 3366 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3367 | -S "X509 - Certificate verification failed" |
| 3368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3369 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3370 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3371 | "$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] | 3372 | key_file=data_files/server5.key" \ |
| 3373 | 0 \ |
| 3374 | -s "skip write certificate request" \ |
| 3375 | -C "skip parse certificate request" \ |
| 3376 | -c "got no certificate request" \ |
| 3377 | -c "skip write certificate" \ |
| 3378 | -c "skip write certificate verify" \ |
| 3379 | -s "skip parse certificate verify" \ |
| 3380 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3381 | -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] | 3382 | -S "! mbedtls_ssl_handshake returned" \ |
| 3383 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3384 | -S "X509 - Certificate verification failed" |
| 3385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3386 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3387 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3388 | "$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] | 3389 | 0 \ |
| 3390 | -S "skip write certificate request" \ |
| 3391 | -C "skip parse certificate request" \ |
| 3392 | -c "got a certificate request" \ |
| 3393 | -C "skip write certificate$" \ |
| 3394 | -C "got no certificate to send" \ |
| 3395 | -S "SSLv3 client has no certificate" \ |
| 3396 | -c "skip write certificate verify" \ |
| 3397 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3398 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3399 | -S "! mbedtls_ssl_handshake returned" \ |
| 3400 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3401 | -S "X509 - Certificate verification failed" |
| 3402 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3403 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3404 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3405 | "$O_CLI" \ |
| 3406 | 0 \ |
| 3407 | -S "skip write certificate request" \ |
| 3408 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3409 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3410 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3411 | -S "X509 - Certificate verification failed" |
| 3412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3413 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3414 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3415 | "$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] | 3416 | 0 \ |
| 3417 | -C "skip parse certificate request" \ |
| 3418 | -c "got a certificate request" \ |
| 3419 | -C "skip write certificate$" \ |
| 3420 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3421 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3422 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3423 | run_test "Authentication: client no cert, openssl server required" \ |
| 3424 | "$O_SRV -Verify 10" \ |
| 3425 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3426 | 1 \ |
| 3427 | -C "skip parse certificate request" \ |
| 3428 | -c "got a certificate request" \ |
| 3429 | -C "skip write certificate$" \ |
| 3430 | -c "skip write certificate verify" \ |
| 3431 | -c "! mbedtls_ssl_handshake returned" |
| 3432 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3434 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3435 | "$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] | 3436 | "$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] | 3437 | 0 \ |
| 3438 | -S "skip write certificate request" \ |
| 3439 | -C "skip parse certificate request" \ |
| 3440 | -c "got a certificate request" \ |
| 3441 | -C "skip write certificate$" \ |
| 3442 | -c "skip write certificate verify" \ |
| 3443 | -c "got no certificate to send" \ |
| 3444 | -s "SSLv3 client has no certificate" \ |
| 3445 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3446 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3447 | -S "! mbedtls_ssl_handshake returned" \ |
| 3448 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3449 | -S "X509 - Certificate verification failed" |
| 3450 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3451 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3452 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3453 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3454 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3455 | 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] | 3456 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3457 | 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] | 3458 | 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] | 3459 | 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] | 3460 | printf "test value of ${MAX_IM_CA}. \n" |
| 3461 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3462 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3463 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3464 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3465 | |
| 3466 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3467 | fi |
| 3468 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3469 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3470 | run_test "Authentication: server max_int chain, client default" \ |
| 3471 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3472 | key_file=data_files/dir-maxpath/09.key" \ |
| 3473 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3474 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3475 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3476 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3477 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3478 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3479 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3480 | key_file=data_files/dir-maxpath/10.key" \ |
| 3481 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3482 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3483 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3484 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3485 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3486 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3487 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3488 | key_file=data_files/dir-maxpath/10.key" \ |
| 3489 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3490 | auth_mode=optional" \ |
| 3491 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3492 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3493 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3494 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3495 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3496 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3497 | key_file=data_files/dir-maxpath/10.key" \ |
| 3498 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3499 | auth_mode=none" \ |
| 3500 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3501 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3502 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3503 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3504 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3505 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3506 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3507 | key_file=data_files/dir-maxpath/10.key" \ |
| 3508 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3509 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3510 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3511 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3512 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3513 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3514 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3515 | key_file=data_files/dir-maxpath/10.key" \ |
| 3516 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3517 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3518 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3519 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3520 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3521 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3522 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3523 | key_file=data_files/dir-maxpath/10.key" \ |
| 3524 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3525 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3526 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3527 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3528 | run_test "Authentication: client max_int chain, server required" \ |
| 3529 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3530 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3531 | key_file=data_files/dir-maxpath/09.key" \ |
| 3532 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3533 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3534 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3535 | # Tests for CA list in CertificateRequest messages |
| 3536 | |
| 3537 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3538 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3539 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3540 | key_file=data_files/server6.key" \ |
| 3541 | 0 \ |
| 3542 | -s "requested DN" |
| 3543 | |
| 3544 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3545 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3546 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3547 | key_file=data_files/server6.key" \ |
| 3548 | 0 \ |
| 3549 | -S "requested DN" |
| 3550 | |
| 3551 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3552 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3553 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3554 | key_file=data_files/server5.key" \ |
| 3555 | 1 \ |
| 3556 | -S "requested DN" \ |
| 3557 | -s "x509_verify_cert() returned" \ |
| 3558 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3559 | -s "! mbedtls_ssl_handshake returned" \ |
| 3560 | -c "! mbedtls_ssl_handshake returned" \ |
| 3561 | -s "X509 - Certificate verification failed" |
| 3562 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3563 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3564 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3565 | |
| 3566 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3567 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3568 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3569 | key_file=data_files/server5.key" \ |
| 3570 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3571 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3572 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3573 | -c "x509_verify_cert() returned" \ |
| 3574 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3575 | -c "! mbedtls_ssl_handshake returned" \ |
| 3576 | -c "X509 - Certificate verification failed" |
| 3577 | |
| 3578 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3579 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3580 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3581 | key_file=data_files/server5.key" \ |
| 3582 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3583 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3584 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3585 | -c "x509_verify_cert() returned" \ |
| 3586 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3587 | -C "! mbedtls_ssl_handshake returned" \ |
| 3588 | -C "X509 - Certificate verification failed" |
| 3589 | |
| 3590 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3591 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3592 | # the client informs the server about the supported curves - it does, though, in the |
| 3593 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3594 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3595 | # different means to have the server ignoring the client's supported curve list. |
| 3596 | |
| 3597 | requires_config_enabled MBEDTLS_ECP_C |
| 3598 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3599 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3600 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3601 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3602 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3603 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3604 | -c "use CA callback for X.509 CRT verification" \ |
| 3605 | -c "bad certificate (EC key curve)" \ |
| 3606 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3607 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3608 | |
| 3609 | requires_config_enabled MBEDTLS_ECP_C |
| 3610 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3611 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3612 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3613 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3614 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3615 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3616 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3617 | -c "bad certificate (EC key curve)"\ |
| 3618 | -c "! Certificate verification flags"\ |
| 3619 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3620 | |
| 3621 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3622 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 3623 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3624 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3625 | key_file=data_files/server6.key \ |
| 3626 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3627 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3628 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3629 | -c "Supported Signature Algorithm found: 4," \ |
| 3630 | -c "Supported Signature Algorithm found: 5," |
| 3631 | |
| 3632 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3633 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 3634 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3635 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3636 | key_file=data_files/server6.key \ |
| 3637 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3638 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3639 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3640 | -c "Supported Signature Algorithm found: 4," \ |
| 3641 | -c "Supported Signature Algorithm found: 5," |
| 3642 | |
| 3643 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3644 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 3645 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3646 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3647 | key_file=data_files/server5.key" \ |
| 3648 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3649 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3650 | -S "skip write certificate request" \ |
| 3651 | -C "skip parse certificate request" \ |
| 3652 | -c "got a certificate request" \ |
| 3653 | -C "skip write certificate" \ |
| 3654 | -C "skip write certificate verify" \ |
| 3655 | -S "skip parse certificate verify" \ |
| 3656 | -s "x509_verify_cert() returned" \ |
| 3657 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3658 | -s "! mbedtls_ssl_handshake returned" \ |
| 3659 | -s "send alert level=2 message=48" \ |
| 3660 | -c "! mbedtls_ssl_handshake returned" \ |
| 3661 | -s "X509 - Certificate verification failed" |
| 3662 | # We don't check that the client receives the alert because it might |
| 3663 | # detect that its write end of the connection is closed and abort |
| 3664 | # before reading the alert message. |
| 3665 | |
| 3666 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3667 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 3668 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3669 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3670 | key_file=data_files/server5.key" \ |
| 3671 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3672 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3673 | -S "skip write certificate request" \ |
| 3674 | -C "skip parse certificate request" \ |
| 3675 | -c "got a certificate request" \ |
| 3676 | -C "skip write certificate" \ |
| 3677 | -C "skip write certificate verify" \ |
| 3678 | -S "skip parse certificate verify" \ |
| 3679 | -s "x509_verify_cert() returned" \ |
| 3680 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3681 | -s "! mbedtls_ssl_handshake returned" \ |
| 3682 | -c "! mbedtls_ssl_handshake returned" \ |
| 3683 | -s "X509 - Certificate verification failed" |
| 3684 | |
| 3685 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3686 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 3687 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3688 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3689 | key_file=data_files/server5.key" \ |
| 3690 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3691 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3692 | -S "skip write certificate request" \ |
| 3693 | -C "skip parse certificate request" \ |
| 3694 | -c "got a certificate request" \ |
| 3695 | -C "skip write certificate" \ |
| 3696 | -C "skip write certificate verify" \ |
| 3697 | -S "skip parse certificate verify" \ |
| 3698 | -s "x509_verify_cert() returned" \ |
| 3699 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3700 | -S "! mbedtls_ssl_handshake returned" \ |
| 3701 | -C "! mbedtls_ssl_handshake returned" \ |
| 3702 | -S "X509 - Certificate verification failed" |
| 3703 | |
| 3704 | requires_full_size_output_buffer |
| 3705 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3706 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 3707 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3708 | key_file=data_files/dir-maxpath/09.key" \ |
| 3709 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3710 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3711 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3712 | -C "X509 - A fatal error occurred" |
| 3713 | |
| 3714 | requires_full_size_output_buffer |
| 3715 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3716 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 3717 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3718 | key_file=data_files/dir-maxpath/10.key" \ |
| 3719 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3720 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3721 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3722 | -c "X509 - A fatal error occurred" |
| 3723 | |
| 3724 | requires_full_size_output_buffer |
| 3725 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3726 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 3727 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3728 | key_file=data_files/dir-maxpath/10.key" \ |
| 3729 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3730 | debug_level=3 auth_mode=optional" \ |
| 3731 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3732 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3733 | -c "X509 - A fatal error occurred" |
| 3734 | |
| 3735 | requires_full_size_output_buffer |
| 3736 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3737 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 3738 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3739 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3740 | key_file=data_files/dir-maxpath/10.key" \ |
| 3741 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3742 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3743 | -s "X509 - A fatal error occurred" |
| 3744 | |
| 3745 | requires_full_size_output_buffer |
| 3746 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3747 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 3748 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3749 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3750 | key_file=data_files/dir-maxpath/10.key" \ |
| 3751 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3752 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3753 | -s "X509 - A fatal error occurred" |
| 3754 | |
| 3755 | requires_full_size_output_buffer |
| 3756 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3757 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 3758 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3759 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3760 | key_file=data_files/dir-maxpath/09.key" \ |
| 3761 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3762 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3763 | -S "X509 - A fatal error occurred" |
| 3764 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3765 | # Tests for certificate selection based on SHA verson |
| 3766 | |
| 3767 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3768 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3769 | key_file=data_files/server5.key \ |
| 3770 | crt_file2=data_files/server5-sha1.crt \ |
| 3771 | key_file2=data_files/server5.key" \ |
| 3772 | "$P_CLI force_version=tls1_2" \ |
| 3773 | 0 \ |
| 3774 | -c "signed using.*ECDSA with SHA256" \ |
| 3775 | -C "signed using.*ECDSA with SHA1" |
| 3776 | |
| 3777 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3778 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3779 | key_file=data_files/server5.key \ |
| 3780 | crt_file2=data_files/server5-sha1.crt \ |
| 3781 | key_file2=data_files/server5.key" \ |
| 3782 | "$P_CLI force_version=tls1_1" \ |
| 3783 | 0 \ |
| 3784 | -C "signed using.*ECDSA with SHA256" \ |
| 3785 | -c "signed using.*ECDSA with SHA1" |
| 3786 | |
| 3787 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3788 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3789 | key_file=data_files/server5.key \ |
| 3790 | crt_file2=data_files/server5-sha1.crt \ |
| 3791 | key_file2=data_files/server5.key" \ |
| 3792 | "$P_CLI force_version=tls1" \ |
| 3793 | 0 \ |
| 3794 | -C "signed using.*ECDSA with SHA256" \ |
| 3795 | -c "signed using.*ECDSA with SHA1" |
| 3796 | |
| 3797 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3798 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3799 | key_file=data_files/server5.key \ |
| 3800 | crt_file2=data_files/server6.crt \ |
| 3801 | key_file2=data_files/server6.key" \ |
| 3802 | "$P_CLI force_version=tls1_1" \ |
| 3803 | 0 \ |
| 3804 | -c "serial number.*09" \ |
| 3805 | -c "signed using.*ECDSA with SHA256" \ |
| 3806 | -C "signed using.*ECDSA with SHA1" |
| 3807 | |
| 3808 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3809 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3810 | key_file=data_files/server6.key \ |
| 3811 | crt_file2=data_files/server5.crt \ |
| 3812 | key_file2=data_files/server5.key" \ |
| 3813 | "$P_CLI force_version=tls1_1" \ |
| 3814 | 0 \ |
| 3815 | -c "serial number.*0A" \ |
| 3816 | -c "signed using.*ECDSA with SHA256" \ |
| 3817 | -C "signed using.*ECDSA with SHA1" |
| 3818 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3819 | # tests for SNI |
| 3820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3821 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3822 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3823 | 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] | 3824 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3825 | 0 \ |
| 3826 | -S "parse ServerName extension" \ |
| 3827 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3828 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3829 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3830 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3831 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3832 | 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] | 3833 | 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] | 3834 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3835 | 0 \ |
| 3836 | -s "parse ServerName extension" \ |
| 3837 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3838 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3840 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3841 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3842 | 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] | 3843 | 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] | 3844 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3845 | 0 \ |
| 3846 | -s "parse ServerName extension" \ |
| 3847 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3848 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3849 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3850 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3851 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3852 | 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] | 3853 | 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] | 3854 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3855 | 1 \ |
| 3856 | -s "parse ServerName extension" \ |
| 3857 | -s "ssl_sni_wrapper() returned" \ |
| 3858 | -s "mbedtls_ssl_handshake returned" \ |
| 3859 | -c "mbedtls_ssl_handshake returned" \ |
| 3860 | -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] | 3861 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3862 | run_test "SNI: client auth no override: optional" \ |
| 3863 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3864 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3865 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3866 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3867 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3868 | -S "skip write certificate request" \ |
| 3869 | -C "skip parse certificate request" \ |
| 3870 | -c "got a certificate request" \ |
| 3871 | -C "skip write certificate" \ |
| 3872 | -C "skip write certificate verify" \ |
| 3873 | -S "skip parse certificate verify" |
| 3874 | |
| 3875 | run_test "SNI: client auth override: none -> optional" \ |
| 3876 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3877 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3878 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3879 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3880 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3881 | -S "skip write certificate request" \ |
| 3882 | -C "skip parse certificate request" \ |
| 3883 | -c "got a certificate request" \ |
| 3884 | -C "skip write certificate" \ |
| 3885 | -C "skip write certificate verify" \ |
| 3886 | -S "skip parse certificate verify" |
| 3887 | |
| 3888 | run_test "SNI: client auth override: optional -> none" \ |
| 3889 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3890 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3891 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3892 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3893 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3894 | -s "skip write certificate request" \ |
| 3895 | -C "skip parse certificate request" \ |
| 3896 | -c "got no certificate request" \ |
| 3897 | -c "skip write certificate" \ |
| 3898 | -c "skip write certificate verify" \ |
| 3899 | -s "skip parse certificate verify" |
| 3900 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3901 | run_test "SNI: CA no override" \ |
| 3902 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3903 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3904 | ca_file=data_files/test-ca.crt \ |
| 3905 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3906 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3907 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3908 | 1 \ |
| 3909 | -S "skip write certificate request" \ |
| 3910 | -C "skip parse certificate request" \ |
| 3911 | -c "got a certificate request" \ |
| 3912 | -C "skip write certificate" \ |
| 3913 | -C "skip write certificate verify" \ |
| 3914 | -S "skip parse certificate verify" \ |
| 3915 | -s "x509_verify_cert() returned" \ |
| 3916 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3917 | -S "The certificate has been revoked (is on a CRL)" |
| 3918 | |
| 3919 | run_test "SNI: CA override" \ |
| 3920 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3921 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3922 | ca_file=data_files/test-ca.crt \ |
| 3923 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3924 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3925 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3926 | 0 \ |
| 3927 | -S "skip write certificate request" \ |
| 3928 | -C "skip parse certificate request" \ |
| 3929 | -c "got a certificate request" \ |
| 3930 | -C "skip write certificate" \ |
| 3931 | -C "skip write certificate verify" \ |
| 3932 | -S "skip parse certificate verify" \ |
| 3933 | -S "x509_verify_cert() returned" \ |
| 3934 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3935 | -S "The certificate has been revoked (is on a CRL)" |
| 3936 | |
| 3937 | run_test "SNI: CA override with CRL" \ |
| 3938 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3939 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3940 | ca_file=data_files/test-ca.crt \ |
| 3941 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3942 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3943 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3944 | 1 \ |
| 3945 | -S "skip write certificate request" \ |
| 3946 | -C "skip parse certificate request" \ |
| 3947 | -c "got a certificate request" \ |
| 3948 | -C "skip write certificate" \ |
| 3949 | -C "skip write certificate verify" \ |
| 3950 | -S "skip parse certificate verify" \ |
| 3951 | -s "x509_verify_cert() returned" \ |
| 3952 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3953 | -s "The certificate has been revoked (is on a CRL)" |
| 3954 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3955 | # Tests for SNI and DTLS |
| 3956 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3957 | run_test "SNI: DTLS, no SNI callback" \ |
| 3958 | "$P_SRV debug_level=3 dtls=1 \ |
| 3959 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3960 | "$P_CLI server_name=localhost dtls=1" \ |
| 3961 | 0 \ |
| 3962 | -S "parse ServerName extension" \ |
| 3963 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3964 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3965 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3966 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3967 | "$P_SRV debug_level=3 dtls=1 \ |
| 3968 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3969 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3970 | "$P_CLI server_name=localhost dtls=1" \ |
| 3971 | 0 \ |
| 3972 | -s "parse ServerName extension" \ |
| 3973 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3974 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3975 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3976 | run_test "SNI: DTLS, matching cert 2" \ |
| 3977 | "$P_SRV debug_level=3 dtls=1 \ |
| 3978 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3979 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3980 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3981 | 0 \ |
| 3982 | -s "parse ServerName extension" \ |
| 3983 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3984 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3985 | |
| 3986 | run_test "SNI: DTLS, no matching cert" \ |
| 3987 | "$P_SRV debug_level=3 dtls=1 \ |
| 3988 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3989 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3990 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3991 | 1 \ |
| 3992 | -s "parse ServerName extension" \ |
| 3993 | -s "ssl_sni_wrapper() returned" \ |
| 3994 | -s "mbedtls_ssl_handshake returned" \ |
| 3995 | -c "mbedtls_ssl_handshake returned" \ |
| 3996 | -c "SSL - A fatal alert message was received from our peer" |
| 3997 | |
| 3998 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3999 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4000 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4001 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4002 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4003 | 0 \ |
| 4004 | -S "skip write certificate request" \ |
| 4005 | -C "skip parse certificate request" \ |
| 4006 | -c "got a certificate request" \ |
| 4007 | -C "skip write certificate" \ |
| 4008 | -C "skip write certificate verify" \ |
| 4009 | -S "skip parse certificate verify" |
| 4010 | |
| 4011 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4012 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4013 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4014 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4015 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4016 | 0 \ |
| 4017 | -S "skip write certificate request" \ |
| 4018 | -C "skip parse certificate request" \ |
| 4019 | -c "got a certificate request" \ |
| 4020 | -C "skip write certificate" \ |
| 4021 | -C "skip write certificate verify" \ |
| 4022 | -S "skip parse certificate verify" |
| 4023 | |
| 4024 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4025 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4026 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4027 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4028 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4029 | 0 \ |
| 4030 | -s "skip write certificate request" \ |
| 4031 | -C "skip parse certificate request" \ |
| 4032 | -c "got no certificate request" \ |
| 4033 | -c "skip write certificate" \ |
| 4034 | -c "skip write certificate verify" \ |
| 4035 | -s "skip parse certificate verify" |
| 4036 | |
| 4037 | run_test "SNI: DTLS, CA no override" \ |
| 4038 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4039 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4040 | ca_file=data_files/test-ca.crt \ |
| 4041 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4042 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4043 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4044 | 1 \ |
| 4045 | -S "skip write certificate request" \ |
| 4046 | -C "skip parse certificate request" \ |
| 4047 | -c "got a certificate request" \ |
| 4048 | -C "skip write certificate" \ |
| 4049 | -C "skip write certificate verify" \ |
| 4050 | -S "skip parse certificate verify" \ |
| 4051 | -s "x509_verify_cert() returned" \ |
| 4052 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4053 | -S "The certificate has been revoked (is on a CRL)" |
| 4054 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4055 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4056 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4057 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4058 | ca_file=data_files/test-ca.crt \ |
| 4059 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4060 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4061 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4062 | 0 \ |
| 4063 | -S "skip write certificate request" \ |
| 4064 | -C "skip parse certificate request" \ |
| 4065 | -c "got a certificate request" \ |
| 4066 | -C "skip write certificate" \ |
| 4067 | -C "skip write certificate verify" \ |
| 4068 | -S "skip parse certificate verify" \ |
| 4069 | -S "x509_verify_cert() returned" \ |
| 4070 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4071 | -S "The certificate has been revoked (is on a CRL)" |
| 4072 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4073 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4074 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4075 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4076 | ca_file=data_files/test-ca.crt \ |
| 4077 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4078 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4079 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4080 | 1 \ |
| 4081 | -S "skip write certificate request" \ |
| 4082 | -C "skip parse certificate request" \ |
| 4083 | -c "got a certificate request" \ |
| 4084 | -C "skip write certificate" \ |
| 4085 | -C "skip write certificate verify" \ |
| 4086 | -S "skip parse certificate verify" \ |
| 4087 | -s "x509_verify_cert() returned" \ |
| 4088 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4089 | -s "The certificate has been revoked (is on a CRL)" |
| 4090 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4091 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4093 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4094 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4095 | "$P_CLI nbio=2 tickets=0" \ |
| 4096 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4097 | -S "mbedtls_ssl_handshake returned" \ |
| 4098 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4099 | -c "Read from server: .* bytes read" |
| 4100 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4101 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4102 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4103 | "$P_CLI nbio=2 tickets=0" \ |
| 4104 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4105 | -S "mbedtls_ssl_handshake returned" \ |
| 4106 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4107 | -c "Read from server: .* bytes read" |
| 4108 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4109 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4110 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4111 | "$P_CLI nbio=2 tickets=1" \ |
| 4112 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4113 | -S "mbedtls_ssl_handshake returned" \ |
| 4114 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4115 | -c "Read from server: .* bytes read" |
| 4116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4117 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4118 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4119 | "$P_CLI nbio=2 tickets=1" \ |
| 4120 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4121 | -S "mbedtls_ssl_handshake returned" \ |
| 4122 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4123 | -c "Read from server: .* bytes read" |
| 4124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4125 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4126 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4127 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4128 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4129 | -S "mbedtls_ssl_handshake returned" \ |
| 4130 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4131 | -c "Read from server: .* bytes read" |
| 4132 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4133 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4134 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4135 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4136 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4137 | -S "mbedtls_ssl_handshake returned" \ |
| 4138 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4139 | -c "Read from server: .* bytes read" |
| 4140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4141 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4142 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4143 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4144 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4145 | -S "mbedtls_ssl_handshake returned" \ |
| 4146 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4147 | -c "Read from server: .* bytes read" |
| 4148 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4149 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4150 | |
| 4151 | run_test "Event-driven I/O: basic handshake" \ |
| 4152 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4153 | "$P_CLI event=1 tickets=0" \ |
| 4154 | 0 \ |
| 4155 | -S "mbedtls_ssl_handshake returned" \ |
| 4156 | -C "mbedtls_ssl_handshake returned" \ |
| 4157 | -c "Read from server: .* bytes read" |
| 4158 | |
| 4159 | run_test "Event-driven I/O: client auth" \ |
| 4160 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4161 | "$P_CLI event=1 tickets=0" \ |
| 4162 | 0 \ |
| 4163 | -S "mbedtls_ssl_handshake returned" \ |
| 4164 | -C "mbedtls_ssl_handshake returned" \ |
| 4165 | -c "Read from server: .* bytes read" |
| 4166 | |
| 4167 | run_test "Event-driven I/O: ticket" \ |
| 4168 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4169 | "$P_CLI event=1 tickets=1" \ |
| 4170 | 0 \ |
| 4171 | -S "mbedtls_ssl_handshake returned" \ |
| 4172 | -C "mbedtls_ssl_handshake returned" \ |
| 4173 | -c "Read from server: .* bytes read" |
| 4174 | |
| 4175 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4176 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4177 | "$P_CLI event=1 tickets=1" \ |
| 4178 | 0 \ |
| 4179 | -S "mbedtls_ssl_handshake returned" \ |
| 4180 | -C "mbedtls_ssl_handshake returned" \ |
| 4181 | -c "Read from server: .* bytes read" |
| 4182 | |
| 4183 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4184 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4185 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4186 | 0 \ |
| 4187 | -S "mbedtls_ssl_handshake returned" \ |
| 4188 | -C "mbedtls_ssl_handshake returned" \ |
| 4189 | -c "Read from server: .* bytes read" |
| 4190 | |
| 4191 | run_test "Event-driven I/O: ticket + resume" \ |
| 4192 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4193 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4194 | 0 \ |
| 4195 | -S "mbedtls_ssl_handshake returned" \ |
| 4196 | -C "mbedtls_ssl_handshake returned" \ |
| 4197 | -c "Read from server: .* bytes read" |
| 4198 | |
| 4199 | run_test "Event-driven I/O: session-id resume" \ |
| 4200 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4201 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4202 | 0 \ |
| 4203 | -S "mbedtls_ssl_handshake returned" \ |
| 4204 | -C "mbedtls_ssl_handshake returned" \ |
| 4205 | -c "Read from server: .* bytes read" |
| 4206 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4207 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4208 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4209 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4210 | 0 \ |
| 4211 | -c "Read from server: .* bytes read" |
| 4212 | |
| 4213 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4214 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4215 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4216 | 0 \ |
| 4217 | -c "Read from server: .* bytes read" |
| 4218 | |
| 4219 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4220 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4221 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4222 | 0 \ |
| 4223 | -c "Read from server: .* bytes read" |
| 4224 | |
| 4225 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4226 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4227 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4228 | 0 \ |
| 4229 | -c "Read from server: .* bytes read" |
| 4230 | |
| 4231 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4232 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4233 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4234 | 0 \ |
| 4235 | -c "Read from server: .* bytes read" |
| 4236 | |
| 4237 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4238 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4239 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4240 | 0 \ |
| 4241 | -c "Read from server: .* bytes read" |
| 4242 | |
| 4243 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4244 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4245 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4246 | 0 \ |
| 4247 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4248 | |
| 4249 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4250 | # During session resumption, the client will send its ApplicationData record |
| 4251 | # within the same datagram as the Finished messages. In this situation, the |
| 4252 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4253 | # because the ApplicationData request has already been queued internally. |
| 4254 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4255 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4256 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4257 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4258 | 0 \ |
| 4259 | -c "Read from server: .* bytes read" |
| 4260 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4261 | # Tests for version negotiation |
| 4262 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4263 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4264 | "$P_SRV" \ |
| 4265 | "$P_CLI" \ |
| 4266 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4267 | -S "mbedtls_ssl_handshake returned" \ |
| 4268 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4269 | -s "Protocol is TLSv1.2" \ |
| 4270 | -c "Protocol is TLSv1.2" |
| 4271 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4272 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4273 | "$P_SRV" \ |
| 4274 | "$P_CLI max_version=tls1_1" \ |
| 4275 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4276 | -S "mbedtls_ssl_handshake returned" \ |
| 4277 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4278 | -s "Protocol is TLSv1.1" \ |
| 4279 | -c "Protocol is TLSv1.1" |
| 4280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4281 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4282 | "$P_SRV max_version=tls1_1" \ |
| 4283 | "$P_CLI" \ |
| 4284 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4285 | -S "mbedtls_ssl_handshake returned" \ |
| 4286 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4287 | -s "Protocol is TLSv1.1" \ |
| 4288 | -c "Protocol is TLSv1.1" |
| 4289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4290 | 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] | 4291 | "$P_SRV max_version=tls1_1" \ |
| 4292 | "$P_CLI max_version=tls1_1" \ |
| 4293 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4294 | -S "mbedtls_ssl_handshake returned" \ |
| 4295 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4296 | -s "Protocol is TLSv1.1" \ |
| 4297 | -c "Protocol is TLSv1.1" |
| 4298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4299 | 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] | 4300 | "$P_SRV min_version=tls1_1" \ |
| 4301 | "$P_CLI max_version=tls1_1" \ |
| 4302 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4303 | -S "mbedtls_ssl_handshake returned" \ |
| 4304 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4305 | -s "Protocol is TLSv1.1" \ |
| 4306 | -c "Protocol is TLSv1.1" |
| 4307 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4308 | 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] | 4309 | "$P_SRV max_version=tls1_1" \ |
| 4310 | "$P_CLI min_version=tls1_1" \ |
| 4311 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4312 | -S "mbedtls_ssl_handshake returned" \ |
| 4313 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4314 | -s "Protocol is TLSv1.1" \ |
| 4315 | -c "Protocol is TLSv1.1" |
| 4316 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4317 | 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] | 4318 | "$P_SRV max_version=tls1_1" \ |
| 4319 | "$P_CLI min_version=tls1_2" \ |
| 4320 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4321 | -s "mbedtls_ssl_handshake returned" \ |
| 4322 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4323 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4324 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4325 | 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] | 4326 | "$P_SRV min_version=tls1_2" \ |
| 4327 | "$P_CLI max_version=tls1_1" \ |
| 4328 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4329 | -s "mbedtls_ssl_handshake returned" \ |
| 4330 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4331 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4332 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4333 | # Tests for ALPN extension |
| 4334 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4335 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4336 | "$P_SRV debug_level=3" \ |
| 4337 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4338 | 0 \ |
| 4339 | -C "client hello, adding alpn extension" \ |
| 4340 | -S "found alpn extension" \ |
| 4341 | -C "got an alert message, type: \\[2:120]" \ |
| 4342 | -S "server hello, adding alpn extension" \ |
| 4343 | -C "found alpn extension " \ |
| 4344 | -C "Application Layer Protocol is" \ |
| 4345 | -S "Application Layer Protocol is" |
| 4346 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4347 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4348 | "$P_SRV debug_level=3" \ |
| 4349 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4350 | 0 \ |
| 4351 | -c "client hello, adding alpn extension" \ |
| 4352 | -s "found alpn extension" \ |
| 4353 | -C "got an alert message, type: \\[2:120]" \ |
| 4354 | -S "server hello, adding alpn extension" \ |
| 4355 | -C "found alpn extension " \ |
| 4356 | -c "Application Layer Protocol is (none)" \ |
| 4357 | -S "Application Layer Protocol is" |
| 4358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4359 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4360 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4361 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4362 | 0 \ |
| 4363 | -C "client hello, adding alpn extension" \ |
| 4364 | -S "found alpn extension" \ |
| 4365 | -C "got an alert message, type: \\[2:120]" \ |
| 4366 | -S "server hello, adding alpn extension" \ |
| 4367 | -C "found alpn extension " \ |
| 4368 | -C "Application Layer Protocol is" \ |
| 4369 | -s "Application Layer Protocol is (none)" |
| 4370 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4371 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4372 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4373 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4374 | 0 \ |
| 4375 | -c "client hello, adding alpn extension" \ |
| 4376 | -s "found alpn extension" \ |
| 4377 | -C "got an alert message, type: \\[2:120]" \ |
| 4378 | -s "server hello, adding alpn extension" \ |
| 4379 | -c "found alpn extension" \ |
| 4380 | -c "Application Layer Protocol is abc" \ |
| 4381 | -s "Application Layer Protocol is abc" |
| 4382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4384 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4385 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4386 | 0 \ |
| 4387 | -c "client hello, adding alpn extension" \ |
| 4388 | -s "found alpn extension" \ |
| 4389 | -C "got an alert message, type: \\[2:120]" \ |
| 4390 | -s "server hello, adding alpn extension" \ |
| 4391 | -c "found alpn extension" \ |
| 4392 | -c "Application Layer Protocol is abc" \ |
| 4393 | -s "Application Layer Protocol is abc" |
| 4394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4395 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4396 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4397 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4398 | 0 \ |
| 4399 | -c "client hello, adding alpn extension" \ |
| 4400 | -s "found alpn extension" \ |
| 4401 | -C "got an alert message, type: \\[2:120]" \ |
| 4402 | -s "server hello, adding alpn extension" \ |
| 4403 | -c "found alpn extension" \ |
| 4404 | -c "Application Layer Protocol is 1234" \ |
| 4405 | -s "Application Layer Protocol is 1234" |
| 4406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4407 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4408 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4409 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4410 | 1 \ |
| 4411 | -c "client hello, adding alpn extension" \ |
| 4412 | -s "found alpn extension" \ |
| 4413 | -c "got an alert message, type: \\[2:120]" \ |
| 4414 | -S "server hello, adding alpn extension" \ |
| 4415 | -C "found alpn extension" \ |
| 4416 | -C "Application Layer Protocol is 1234" \ |
| 4417 | -S "Application Layer Protocol is 1234" |
| 4418 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4419 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4420 | # Tests for keyUsage in leaf certificates, part 1: |
| 4421 | # server-side certificate/suite selection |
| 4422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4423 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4424 | "$P_SRV key_file=data_files/server2.key \ |
| 4425 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4426 | "$P_CLI" \ |
| 4427 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4428 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4429 | |
| 4430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4431 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4432 | "$P_SRV key_file=data_files/server2.key \ |
| 4433 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4434 | "$P_CLI" \ |
| 4435 | 0 \ |
| 4436 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4438 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4439 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4440 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4441 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4442 | 1 \ |
| 4443 | -C "Ciphersuite is " |
| 4444 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4445 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4446 | "$P_SRV key_file=data_files/server5.key \ |
| 4447 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4448 | "$P_CLI" \ |
| 4449 | 0 \ |
| 4450 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4451 | |
| 4452 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4453 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4454 | "$P_SRV key_file=data_files/server5.key \ |
| 4455 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4456 | "$P_CLI" \ |
| 4457 | 0 \ |
| 4458 | -c "Ciphersuite is TLS-ECDH-" |
| 4459 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4460 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4461 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4462 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4463 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4464 | 1 \ |
| 4465 | -C "Ciphersuite is " |
| 4466 | |
| 4467 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4468 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4469 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4470 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4471 | "$O_SRV -key data_files/server2.key \ |
| 4472 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4473 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4474 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4475 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4476 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4477 | -C "Processing of the Certificate handshake message failed" \ |
| 4478 | -c "Ciphersuite is TLS-" |
| 4479 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4480 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4481 | "$O_SRV -key data_files/server2.key \ |
| 4482 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4483 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4484 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4485 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4486 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4487 | -C "Processing of the Certificate handshake message failed" \ |
| 4488 | -c "Ciphersuite is TLS-" |
| 4489 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4490 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4491 | "$O_SRV -key data_files/server2.key \ |
| 4492 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4493 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4494 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4495 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4496 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4497 | -C "Processing of the Certificate handshake message failed" \ |
| 4498 | -c "Ciphersuite is TLS-" |
| 4499 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4500 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4501 | "$O_SRV -key data_files/server2.key \ |
| 4502 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4503 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4504 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4505 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4506 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4507 | -c "Processing of the Certificate handshake message failed" \ |
| 4508 | -C "Ciphersuite is TLS-" |
| 4509 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4510 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4511 | "$O_SRV -key data_files/server2.key \ |
| 4512 | -cert data_files/server2.ku-ke.crt" \ |
| 4513 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4514 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4515 | 0 \ |
| 4516 | -c "bad certificate (usage extensions)" \ |
| 4517 | -C "Processing of the Certificate handshake message failed" \ |
| 4518 | -c "Ciphersuite is TLS-" \ |
| 4519 | -c "! Usage does not match the keyUsage extension" |
| 4520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4521 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4522 | "$O_SRV -key data_files/server2.key \ |
| 4523 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4524 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4525 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4526 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4527 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4528 | -C "Processing of the Certificate handshake message failed" \ |
| 4529 | -c "Ciphersuite is TLS-" |
| 4530 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4531 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4532 | "$O_SRV -key data_files/server2.key \ |
| 4533 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4534 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4535 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4536 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4537 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4538 | -c "Processing of the Certificate handshake message failed" \ |
| 4539 | -C "Ciphersuite is TLS-" |
| 4540 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4541 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4542 | "$O_SRV -key data_files/server2.key \ |
| 4543 | -cert data_files/server2.ku-ds.crt" \ |
| 4544 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4545 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4546 | 0 \ |
| 4547 | -c "bad certificate (usage extensions)" \ |
| 4548 | -C "Processing of the Certificate handshake message failed" \ |
| 4549 | -c "Ciphersuite is TLS-" \ |
| 4550 | -c "! Usage does not match the keyUsage extension" |
| 4551 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4552 | # Tests for keyUsage in leaf certificates, part 3: |
| 4553 | # server-side checking of client cert |
| 4554 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4555 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4556 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4557 | "$O_CLI -key data_files/server2.key \ |
| 4558 | -cert data_files/server2.ku-ds.crt" \ |
| 4559 | 0 \ |
| 4560 | -S "bad certificate (usage extensions)" \ |
| 4561 | -S "Processing of the Certificate handshake message failed" |
| 4562 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4563 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4564 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4565 | "$O_CLI -key data_files/server2.key \ |
| 4566 | -cert data_files/server2.ku-ke.crt" \ |
| 4567 | 0 \ |
| 4568 | -s "bad certificate (usage extensions)" \ |
| 4569 | -S "Processing of the Certificate handshake message failed" |
| 4570 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4571 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4572 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4573 | "$O_CLI -key data_files/server2.key \ |
| 4574 | -cert data_files/server2.ku-ke.crt" \ |
| 4575 | 1 \ |
| 4576 | -s "bad certificate (usage extensions)" \ |
| 4577 | -s "Processing of the Certificate handshake message failed" |
| 4578 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4579 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4580 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4581 | "$O_CLI -key data_files/server5.key \ |
| 4582 | -cert data_files/server5.ku-ds.crt" \ |
| 4583 | 0 \ |
| 4584 | -S "bad certificate (usage extensions)" \ |
| 4585 | -S "Processing of the Certificate handshake message failed" |
| 4586 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4587 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4588 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4589 | "$O_CLI -key data_files/server5.key \ |
| 4590 | -cert data_files/server5.ku-ka.crt" \ |
| 4591 | 0 \ |
| 4592 | -s "bad certificate (usage extensions)" \ |
| 4593 | -S "Processing of the Certificate handshake message failed" |
| 4594 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4595 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4597 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4598 | "$P_SRV key_file=data_files/server5.key \ |
| 4599 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4600 | "$P_CLI" \ |
| 4601 | 0 |
| 4602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4603 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4604 | "$P_SRV key_file=data_files/server5.key \ |
| 4605 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4606 | "$P_CLI" \ |
| 4607 | 0 |
| 4608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4609 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4610 | "$P_SRV key_file=data_files/server5.key \ |
| 4611 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4612 | "$P_CLI" \ |
| 4613 | 0 |
| 4614 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4615 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4616 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4617 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4618 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4619 | 1 |
| 4620 | |
| 4621 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4623 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4624 | "$O_SRV -key data_files/server5.key \ |
| 4625 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4626 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4627 | 0 \ |
| 4628 | -C "bad certificate (usage extensions)" \ |
| 4629 | -C "Processing of the Certificate handshake message failed" \ |
| 4630 | -c "Ciphersuite is TLS-" |
| 4631 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4632 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4633 | "$O_SRV -key data_files/server5.key \ |
| 4634 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4635 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4636 | 0 \ |
| 4637 | -C "bad certificate (usage extensions)" \ |
| 4638 | -C "Processing of the Certificate handshake message failed" \ |
| 4639 | -c "Ciphersuite is TLS-" |
| 4640 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4641 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4642 | "$O_SRV -key data_files/server5.key \ |
| 4643 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4644 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4645 | 0 \ |
| 4646 | -C "bad certificate (usage extensions)" \ |
| 4647 | -C "Processing of the Certificate handshake message failed" \ |
| 4648 | -c "Ciphersuite is TLS-" |
| 4649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4650 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4651 | "$O_SRV -key data_files/server5.key \ |
| 4652 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4653 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4654 | 1 \ |
| 4655 | -c "bad certificate (usage extensions)" \ |
| 4656 | -c "Processing of the Certificate handshake message failed" \ |
| 4657 | -C "Ciphersuite is TLS-" |
| 4658 | |
| 4659 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4662 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4663 | "$O_CLI -key data_files/server5.key \ |
| 4664 | -cert data_files/server5.eku-cli.crt" \ |
| 4665 | 0 \ |
| 4666 | -S "bad certificate (usage extensions)" \ |
| 4667 | -S "Processing of the Certificate handshake message failed" |
| 4668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4669 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4670 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4671 | "$O_CLI -key data_files/server5.key \ |
| 4672 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4673 | 0 \ |
| 4674 | -S "bad certificate (usage extensions)" \ |
| 4675 | -S "Processing of the Certificate handshake message failed" |
| 4676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4677 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4678 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4679 | "$O_CLI -key data_files/server5.key \ |
| 4680 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4681 | 0 \ |
| 4682 | -S "bad certificate (usage extensions)" \ |
| 4683 | -S "Processing of the Certificate handshake message failed" |
| 4684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4685 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4686 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4687 | "$O_CLI -key data_files/server5.key \ |
| 4688 | -cert data_files/server5.eku-cs.crt" \ |
| 4689 | 0 \ |
| 4690 | -s "bad certificate (usage extensions)" \ |
| 4691 | -S "Processing of the Certificate handshake message failed" |
| 4692 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4693 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4694 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4695 | "$O_CLI -key data_files/server5.key \ |
| 4696 | -cert data_files/server5.eku-cs.crt" \ |
| 4697 | 1 \ |
| 4698 | -s "bad certificate (usage extensions)" \ |
| 4699 | -s "Processing of the Certificate handshake message failed" |
| 4700 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4701 | # Tests for DHM parameters loading |
| 4702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4703 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4704 | "$P_SRV" \ |
| 4705 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4706 | debug_level=3" \ |
| 4707 | 0 \ |
| 4708 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 4709 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4711 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4712 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4713 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4714 | debug_level=3" \ |
| 4715 | 0 \ |
| 4716 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4717 | -c "value of 'DHM: G ' (2 bits)" |
| 4718 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4719 | # Tests for DHM client-side size checking |
| 4720 | |
| 4721 | run_test "DHM size: server default, client default, OK" \ |
| 4722 | "$P_SRV" \ |
| 4723 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4724 | debug_level=1" \ |
| 4725 | 0 \ |
| 4726 | -C "DHM prime too short:" |
| 4727 | |
| 4728 | run_test "DHM size: server default, client 2048, OK" \ |
| 4729 | "$P_SRV" \ |
| 4730 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4731 | debug_level=1 dhmlen=2048" \ |
| 4732 | 0 \ |
| 4733 | -C "DHM prime too short:" |
| 4734 | |
| 4735 | run_test "DHM size: server 1024, client default, OK" \ |
| 4736 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4737 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4738 | debug_level=1" \ |
| 4739 | 0 \ |
| 4740 | -C "DHM prime too short:" |
| 4741 | |
| 4742 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4743 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4744 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4745 | debug_level=1" \ |
| 4746 | 1 \ |
| 4747 | -c "DHM prime too short:" |
| 4748 | |
| 4749 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4750 | "$P_SRV" \ |
| 4751 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4752 | debug_level=1 dhmlen=2049" \ |
| 4753 | 1 \ |
| 4754 | -c "DHM prime too short:" |
| 4755 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4756 | # Tests for PSK callback |
| 4757 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4758 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4759 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4760 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4761 | psk_identity=foo psk=abc123" \ |
| 4762 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4763 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4764 | -S "SSL - Unknown identity received" \ |
| 4765 | -S "SSL - Verification of the message MAC failed" |
| 4766 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4767 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4768 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 4769 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4770 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4771 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4772 | 0 \ |
| 4773 | -c "skip PMS generation for opaque PSK"\ |
| 4774 | -S "skip PMS generation for opaque PSK"\ |
| 4775 | -C "using extended master secret"\ |
| 4776 | -S "using extended master secret"\ |
| 4777 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4778 | -S "SSL - Unknown identity received" \ |
| 4779 | -S "SSL - Verification of the message MAC failed" |
| 4780 | |
| 4781 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4782 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 4783 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4784 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4785 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4786 | 0 \ |
| 4787 | -c "skip PMS generation for opaque PSK"\ |
| 4788 | -S "skip PMS generation for opaque PSK"\ |
| 4789 | -C "using extended master secret"\ |
| 4790 | -S "using extended master secret"\ |
| 4791 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4792 | -S "SSL - Unknown identity received" \ |
| 4793 | -S "SSL - Verification of the message MAC failed" |
| 4794 | |
| 4795 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4796 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 4797 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4798 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4799 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4800 | 0 \ |
| 4801 | -c "skip PMS generation for opaque PSK"\ |
| 4802 | -S "skip PMS generation for opaque PSK"\ |
| 4803 | -c "using extended master secret"\ |
| 4804 | -s "using extended master secret"\ |
| 4805 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4806 | -S "SSL - Unknown identity received" \ |
| 4807 | -S "SSL - Verification of the message MAC failed" |
| 4808 | |
| 4809 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4810 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 4811 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4812 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4813 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4814 | 0 \ |
| 4815 | -c "skip PMS generation for opaque PSK"\ |
| 4816 | -S "skip PMS generation for opaque PSK"\ |
| 4817 | -c "using extended master secret"\ |
| 4818 | -s "using extended master secret"\ |
| 4819 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4820 | -S "SSL - Unknown identity received" \ |
| 4821 | -S "SSL - Verification of the message MAC failed" |
| 4822 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4823 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4824 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4825 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4826 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4827 | psk_identity=foo psk=abc123" \ |
| 4828 | 0 \ |
| 4829 | -C "skip PMS generation for opaque PSK"\ |
| 4830 | -s "skip PMS generation for opaque PSK"\ |
| 4831 | -C "using extended master secret"\ |
| 4832 | -S "using extended master secret"\ |
| 4833 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4834 | -S "SSL - Unknown identity received" \ |
| 4835 | -S "SSL - Verification of the message MAC failed" |
| 4836 | |
| 4837 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4838 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4839 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4840 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4841 | psk_identity=foo psk=abc123" \ |
| 4842 | 0 \ |
| 4843 | -C "skip PMS generation for opaque PSK"\ |
| 4844 | -s "skip PMS generation for opaque PSK"\ |
| 4845 | -C "using extended master secret"\ |
| 4846 | -S "using extended master secret"\ |
| 4847 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4848 | -S "SSL - Unknown identity received" \ |
| 4849 | -S "SSL - Verification of the message MAC failed" |
| 4850 | |
| 4851 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4852 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4853 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4854 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4855 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4856 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4857 | 0 \ |
| 4858 | -c "using extended master secret"\ |
| 4859 | -s "using extended master secret"\ |
| 4860 | -C "skip PMS generation for opaque PSK"\ |
| 4861 | -s "skip PMS generation for opaque PSK"\ |
| 4862 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4863 | -S "SSL - Unknown identity received" \ |
| 4864 | -S "SSL - Verification of the message MAC failed" |
| 4865 | |
| 4866 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4867 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4868 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4869 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4870 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4871 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4872 | 0 \ |
| 4873 | -c "using extended master secret"\ |
| 4874 | -s "using extended master secret"\ |
| 4875 | -C "skip PMS generation for opaque PSK"\ |
| 4876 | -s "skip PMS generation for opaque PSK"\ |
| 4877 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4878 | -S "SSL - Unknown identity received" \ |
| 4879 | -S "SSL - Verification of the message MAC failed" |
| 4880 | |
| 4881 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4882 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4883 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4884 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4885 | psk_identity=def psk=beef" \ |
| 4886 | 0 \ |
| 4887 | -C "skip PMS generation for opaque PSK"\ |
| 4888 | -s "skip PMS generation for opaque PSK"\ |
| 4889 | -C "using extended master secret"\ |
| 4890 | -S "using extended master secret"\ |
| 4891 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4892 | -S "SSL - Unknown identity received" \ |
| 4893 | -S "SSL - Verification of the message MAC failed" |
| 4894 | |
| 4895 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4896 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4897 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4898 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4899 | psk_identity=def psk=beef" \ |
| 4900 | 0 \ |
| 4901 | -C "skip PMS generation for opaque PSK"\ |
| 4902 | -s "skip PMS generation for opaque PSK"\ |
| 4903 | -C "using extended master secret"\ |
| 4904 | -S "using extended master secret"\ |
| 4905 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4906 | -S "SSL - Unknown identity received" \ |
| 4907 | -S "SSL - Verification of the message MAC failed" |
| 4908 | |
| 4909 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4910 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4911 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4912 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4913 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4914 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4915 | 0 \ |
| 4916 | -c "using extended master secret"\ |
| 4917 | -s "using extended master secret"\ |
| 4918 | -C "skip PMS generation for opaque PSK"\ |
| 4919 | -s "skip PMS generation for opaque PSK"\ |
| 4920 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4921 | -S "SSL - Unknown identity received" \ |
| 4922 | -S "SSL - Verification of the message MAC failed" |
| 4923 | |
| 4924 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4925 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4926 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4927 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4928 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4929 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4930 | 0 \ |
| 4931 | -c "using extended master secret"\ |
| 4932 | -s "using extended master secret"\ |
| 4933 | -C "skip PMS generation for opaque PSK"\ |
| 4934 | -s "skip PMS generation for opaque PSK"\ |
| 4935 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4936 | -S "SSL - Unknown identity received" \ |
| 4937 | -S "SSL - Verification of the message MAC failed" |
| 4938 | |
| 4939 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4940 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4941 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4942 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4943 | psk_identity=def psk=beef" \ |
| 4944 | 0 \ |
| 4945 | -C "skip PMS generation for opaque PSK"\ |
| 4946 | -s "skip PMS generation for opaque PSK"\ |
| 4947 | -C "using extended master secret"\ |
| 4948 | -S "using extended master secret"\ |
| 4949 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4950 | -S "SSL - Unknown identity received" \ |
| 4951 | -S "SSL - Verification of the message MAC failed" |
| 4952 | |
| 4953 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4954 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4955 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4956 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4957 | psk_identity=def psk=beef" \ |
| 4958 | 0 \ |
| 4959 | -C "skip PMS generation for opaque PSK"\ |
| 4960 | -s "skip PMS generation for opaque PSK"\ |
| 4961 | -C "using extended master secret"\ |
| 4962 | -S "using extended master secret"\ |
| 4963 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4964 | -S "SSL - Unknown identity received" \ |
| 4965 | -S "SSL - Verification of the message MAC failed" |
| 4966 | |
| 4967 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4968 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4969 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4970 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4971 | psk_identity=def psk=beef" \ |
| 4972 | 0 \ |
| 4973 | -C "skip PMS generation for opaque PSK"\ |
| 4974 | -C "using extended master secret"\ |
| 4975 | -S "using extended master secret"\ |
| 4976 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4977 | -S "SSL - Unknown identity received" \ |
| 4978 | -S "SSL - Verification of the message MAC failed" |
| 4979 | |
| 4980 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4981 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4982 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4983 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4984 | psk_identity=def psk=beef" \ |
| 4985 | 0 \ |
| 4986 | -C "skip PMS generation for opaque PSK"\ |
| 4987 | -C "using extended master secret"\ |
| 4988 | -S "using extended master secret"\ |
| 4989 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4990 | -S "SSL - Unknown identity received" \ |
| 4991 | -S "SSL - Verification of the message MAC failed" |
| 4992 | |
| 4993 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4994 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4995 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4996 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4997 | psk_identity=def psk=beef" \ |
| 4998 | 1 \ |
| 4999 | -s "SSL - Verification of the message MAC failed" |
| 5000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5001 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5002 | "$P_SRV" \ |
| 5003 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5004 | psk_identity=foo psk=abc123" \ |
| 5005 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5006 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5007 | -S "SSL - Unknown identity received" \ |
| 5008 | -S "SSL - Verification of the message MAC failed" |
| 5009 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5010 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5011 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5012 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5013 | psk_identity=foo psk=abc123" \ |
| 5014 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5015 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5016 | -s "SSL - Unknown identity received" \ |
| 5017 | -S "SSL - Verification of the message MAC failed" |
| 5018 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5019 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5020 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5021 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5022 | psk_identity=abc psk=dead" \ |
| 5023 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5024 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5025 | -S "SSL - Unknown identity received" \ |
| 5026 | -S "SSL - Verification of the message MAC failed" |
| 5027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5028 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5029 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5030 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5031 | psk_identity=def psk=beef" \ |
| 5032 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5033 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5034 | -S "SSL - Unknown identity received" \ |
| 5035 | -S "SSL - Verification of the message MAC failed" |
| 5036 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5037 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5038 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5039 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5040 | psk_identity=ghi psk=beef" \ |
| 5041 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5042 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5043 | -s "SSL - Unknown identity received" \ |
| 5044 | -S "SSL - Verification of the message MAC failed" |
| 5045 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5046 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5047 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5048 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5049 | psk_identity=abc psk=beef" \ |
| 5050 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5051 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5052 | -S "SSL - Unknown identity received" \ |
| 5053 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5054 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5055 | # Tests for EC J-PAKE |
| 5056 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5057 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5058 | run_test "ECJPAKE: client not configured" \ |
| 5059 | "$P_SRV debug_level=3" \ |
| 5060 | "$P_CLI debug_level=3" \ |
| 5061 | 0 \ |
| 5062 | -C "add ciphersuite: c0ff" \ |
| 5063 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5064 | -S "found ecjpake kkpp extension" \ |
| 5065 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5066 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5067 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5068 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5069 | -S "None of the common ciphersuites is usable" |
| 5070 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5071 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5072 | run_test "ECJPAKE: server not configured" \ |
| 5073 | "$P_SRV debug_level=3" \ |
| 5074 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5075 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5076 | 1 \ |
| 5077 | -c "add ciphersuite: c0ff" \ |
| 5078 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5079 | -s "found ecjpake kkpp extension" \ |
| 5080 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5081 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5082 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5083 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5084 | -s "None of the common ciphersuites is usable" |
| 5085 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5086 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5087 | run_test "ECJPAKE: working, TLS" \ |
| 5088 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5089 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5090 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5091 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5092 | -c "add ciphersuite: c0ff" \ |
| 5093 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5094 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5095 | -s "found ecjpake kkpp extension" \ |
| 5096 | -S "skip ecjpake kkpp extension" \ |
| 5097 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5098 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5099 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5100 | -S "None of the common ciphersuites is usable" \ |
| 5101 | -S "SSL - Verification of the message MAC failed" |
| 5102 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5103 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5104 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5105 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5106 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5107 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5108 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5109 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5110 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5111 | -s "SSL - Verification of the message MAC failed" |
| 5112 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5113 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5114 | run_test "ECJPAKE: working, DTLS" \ |
| 5115 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5116 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5117 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5118 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5119 | -c "re-using cached ecjpake parameters" \ |
| 5120 | -S "SSL - Verification of the message MAC failed" |
| 5121 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5122 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5123 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5124 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5125 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5126 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5127 | 0 \ |
| 5128 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5129 | -S "SSL - Verification of the message MAC failed" |
| 5130 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5131 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5132 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5133 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5134 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5135 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5136 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5137 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5138 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5139 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5140 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5141 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5142 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5143 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5144 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5145 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5146 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5147 | 0 |
| 5148 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5149 | # Tests for ciphersuites per version |
| 5150 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5151 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5152 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5153 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5154 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5155 | "$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] | 5156 | "$P_CLI force_version=ssl3" \ |
| 5157 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5158 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5159 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5161 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5162 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5163 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5164 | "$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] | 5165 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5166 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5167 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5168 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5170 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5171 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5173 | "$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] | 5174 | "$P_CLI force_version=tls1_1" \ |
| 5175 | 0 \ |
| 5176 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5177 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5179 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5180 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5182 | "$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] | 5183 | "$P_CLI force_version=tls1_2" \ |
| 5184 | 0 \ |
| 5185 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5186 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5187 | # Test for ClientHello without extensions |
| 5188 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5189 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5190 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | 574ac57 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 5191 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5192 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5193 | 0 \ |
| 5194 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5195 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5196 | requires_gnutls |
| 5197 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 5198 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5199 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5200 | 0 \ |
| 5201 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5202 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5203 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5204 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5205 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5206 | "$P_SRV" \ |
| 5207 | "$P_CLI request_size=100" \ |
| 5208 | 0 \ |
| 5209 | -s "Read from client: 100 bytes read$" |
| 5210 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5211 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5212 | "$P_SRV" \ |
| 5213 | "$P_CLI request_size=500" \ |
| 5214 | 0 \ |
| 5215 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5216 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5217 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5218 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5219 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5220 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5221 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5222 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5223 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5224 | 0 \ |
| 5225 | -s "Read from client: 1 bytes read" |
| 5226 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5228 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5229 | "$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] | 5230 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5231 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5232 | 0 \ |
| 5233 | -s "Read from client: 1 bytes read" |
| 5234 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5235 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5236 | "$P_SRV" \ |
| 5237 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5238 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5239 | 0 \ |
| 5240 | -s "Read from client: 1 bytes read" |
| 5241 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5242 | 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] | 5243 | "$P_SRV" \ |
| 5244 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5246 | 0 \ |
| 5247 | -s "Read from client: 1 bytes read" |
| 5248 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5250 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5251 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5252 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5253 | 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] | 5254 | 0 \ |
| 5255 | -s "Read from client: 1 bytes read" |
| 5256 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5257 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5258 | 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] | 5259 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5260 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5261 | 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] | 5262 | 0 \ |
| 5263 | -s "Read from client: 1 bytes read" |
| 5264 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5265 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5266 | "$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] | 5267 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5268 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5269 | 0 \ |
| 5270 | -s "Read from client: 1 bytes read" |
| 5271 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5272 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5273 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5274 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5275 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5276 | 0 \ |
| 5277 | -s "Read from client: 1 bytes read" |
| 5278 | |
| 5279 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5280 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5281 | "$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] | 5282 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5283 | 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] | 5284 | 0 \ |
| 5285 | -s "Read from client: 1 bytes read" |
| 5286 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5287 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5288 | 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] | 5289 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5290 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5291 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5292 | 0 \ |
| 5293 | -s "Read from client: 1 bytes read" |
| 5294 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5295 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5296 | "$P_SRV" \ |
| 5297 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5298 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5299 | 0 \ |
| 5300 | -s "Read from client: 1 bytes read" |
| 5301 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5302 | 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] | 5303 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5304 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5305 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5306 | 0 \ |
| 5307 | -s "Read from client: 1 bytes read" |
| 5308 | |
| 5309 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5310 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5311 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5312 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5313 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5314 | 0 \ |
| 5315 | -s "Read from client: 1 bytes read" |
| 5316 | |
| 5317 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5318 | 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] | 5319 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5320 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5321 | 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] | 5322 | 0 \ |
| 5323 | -s "Read from client: 1 bytes read" |
| 5324 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5325 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5326 | "$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] | 5327 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5328 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5329 | 0 \ |
| 5330 | -s "Read from client: 1 bytes read" |
| 5331 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5332 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5333 | "$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] | 5334 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5335 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5336 | 0 \ |
| 5337 | -s "Read from client: 1 bytes read" |
| 5338 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5339 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5340 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5341 | "$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] | 5342 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5343 | 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] | 5344 | 0 \ |
| 5345 | -s "Read from client: 1 bytes read" |
| 5346 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5347 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5348 | 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] | 5349 | "$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] | 5350 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5351 | 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] | 5352 | 0 \ |
| 5353 | -s "Read from client: 1 bytes read" |
| 5354 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5355 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5356 | "$P_SRV" \ |
| 5357 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5358 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5359 | 0 \ |
| 5360 | -s "Read from client: 1 bytes read" |
| 5361 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5362 | 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] | 5363 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5364 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5365 | 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] | 5366 | 0 \ |
| 5367 | -s "Read from client: 1 bytes read" |
| 5368 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5369 | 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] | 5370 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5371 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5372 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5373 | 0 \ |
| 5374 | -s "Read from client: 1 bytes read" |
| 5375 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5376 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5377 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5378 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5379 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5380 | 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] | 5381 | 0 \ |
| 5382 | -s "Read from client: 1 bytes read" |
| 5383 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5384 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5385 | 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] | 5386 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5387 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5388 | 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] | 5389 | 0 \ |
| 5390 | -s "Read from client: 1 bytes read" |
| 5391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5392 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5393 | "$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] | 5394 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5395 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5396 | 0 \ |
| 5397 | -s "Read from client: 1 bytes read" |
| 5398 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5399 | 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] | 5400 | "$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] | 5401 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5402 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5403 | 0 \ |
| 5404 | -s "Read from client: 1 bytes read" |
| 5405 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5407 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5408 | "$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] | 5409 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5410 | 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] | 5411 | 0 \ |
| 5412 | -s "Read from client: 1 bytes read" |
| 5413 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5415 | 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] | 5416 | "$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] | 5417 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5418 | 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] | 5419 | 0 \ |
| 5420 | -s "Read from client: 1 bytes read" |
| 5421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5422 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5423 | "$P_SRV" \ |
| 5424 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5425 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5426 | 0 \ |
| 5427 | -s "Read from client: 1 bytes read" |
| 5428 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5429 | 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] | 5430 | "$P_SRV" \ |
| 5431 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5432 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5433 | 0 \ |
| 5434 | -s "Read from client: 1 bytes read" |
| 5435 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5436 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5437 | |
| 5438 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5439 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5440 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5441 | "$P_CLI dtls=1 request_size=1 \ |
| 5442 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5443 | 0 \ |
| 5444 | -s "Read from client: 1 bytes read" |
| 5445 | |
| 5446 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5447 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5448 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5449 | "$P_CLI dtls=1 request_size=1 \ |
| 5450 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5451 | 0 \ |
| 5452 | -s "Read from client: 1 bytes read" |
| 5453 | |
| 5454 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5455 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5456 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5457 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5458 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5459 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5460 | 0 \ |
| 5461 | -s "Read from client: 1 bytes read" |
| 5462 | |
| 5463 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5464 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5465 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5466 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5467 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5468 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5469 | 0 \ |
| 5470 | -s "Read from client: 1 bytes read" |
| 5471 | |
| 5472 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5473 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5474 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5475 | "$P_CLI dtls=1 request_size=1 \ |
| 5476 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5477 | 0 \ |
| 5478 | -s "Read from client: 1 bytes read" |
| 5479 | |
| 5480 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5481 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5482 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5483 | "$P_CLI dtls=1 request_size=1 \ |
| 5484 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5485 | 0 \ |
| 5486 | -s "Read from client: 1 bytes read" |
| 5487 | |
| 5488 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5489 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5490 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5491 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5492 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5493 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5494 | 0 \ |
| 5495 | -s "Read from client: 1 bytes read" |
| 5496 | |
| 5497 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5498 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5499 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5500 | "$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] | 5501 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5502 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5503 | 0 \ |
| 5504 | -s "Read from client: 1 bytes read" |
| 5505 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5506 | # Tests for small server packets |
| 5507 | |
| 5508 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5509 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5510 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5511 | "$P_CLI force_version=ssl3 \ |
| 5512 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5513 | 0 \ |
| 5514 | -c "Read from server: 1 bytes read" |
| 5515 | |
| 5516 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5517 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5518 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5519 | "$P_CLI force_version=ssl3 \ |
| 5520 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5521 | 0 \ |
| 5522 | -c "Read from server: 1 bytes read" |
| 5523 | |
| 5524 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5525 | "$P_SRV response_size=1" \ |
| 5526 | "$P_CLI force_version=tls1 \ |
| 5527 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5528 | 0 \ |
| 5529 | -c "Read from server: 1 bytes read" |
| 5530 | |
| 5531 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5532 | "$P_SRV response_size=1" \ |
| 5533 | "$P_CLI force_version=tls1 etm=0 \ |
| 5534 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5535 | 0 \ |
| 5536 | -c "Read from server: 1 bytes read" |
| 5537 | |
| 5538 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5539 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5540 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5541 | "$P_CLI force_version=tls1 \ |
| 5542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5543 | 0 \ |
| 5544 | -c "Read from server: 1 bytes read" |
| 5545 | |
| 5546 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5547 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5548 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5549 | "$P_CLI force_version=tls1 \ |
| 5550 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5551 | 0 \ |
| 5552 | -c "Read from server: 1 bytes read" |
| 5553 | |
| 5554 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5555 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5556 | "$P_CLI force_version=tls1 \ |
| 5557 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5558 | 0 \ |
| 5559 | -c "Read from server: 1 bytes read" |
| 5560 | |
| 5561 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5562 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5563 | "$P_CLI force_version=tls1 \ |
| 5564 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5565 | 0 \ |
| 5566 | -c "Read from server: 1 bytes read" |
| 5567 | |
| 5568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5569 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5570 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5571 | "$P_CLI force_version=tls1 \ |
| 5572 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5573 | 0 \ |
| 5574 | -c "Read from server: 1 bytes read" |
| 5575 | |
| 5576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5577 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5578 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5579 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5580 | trunc_hmac=1 etm=0" \ |
| 5581 | 0 \ |
| 5582 | -c "Read from server: 1 bytes read" |
| 5583 | |
| 5584 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5585 | "$P_SRV response_size=1" \ |
| 5586 | "$P_CLI force_version=tls1_1 \ |
| 5587 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5588 | 0 \ |
| 5589 | -c "Read from server: 1 bytes read" |
| 5590 | |
| 5591 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5592 | "$P_SRV response_size=1" \ |
| 5593 | "$P_CLI force_version=tls1_1 \ |
| 5594 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5595 | 0 \ |
| 5596 | -c "Read from server: 1 bytes read" |
| 5597 | |
| 5598 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5599 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5600 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5601 | "$P_CLI force_version=tls1_1 \ |
| 5602 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5603 | 0 \ |
| 5604 | -c "Read from server: 1 bytes read" |
| 5605 | |
| 5606 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5607 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5608 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5609 | "$P_CLI force_version=tls1_1 \ |
| 5610 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5611 | 0 \ |
| 5612 | -c "Read from server: 1 bytes read" |
| 5613 | |
| 5614 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5615 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5616 | "$P_CLI force_version=tls1_1 \ |
| 5617 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5618 | 0 \ |
| 5619 | -c "Read from server: 1 bytes read" |
| 5620 | |
| 5621 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5622 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5623 | "$P_CLI force_version=tls1_1 \ |
| 5624 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5625 | 0 \ |
| 5626 | -c "Read from server: 1 bytes read" |
| 5627 | |
| 5628 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5629 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5630 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5631 | "$P_CLI force_version=tls1_1 \ |
| 5632 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5633 | 0 \ |
| 5634 | -c "Read from server: 1 bytes read" |
| 5635 | |
| 5636 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5637 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5638 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5639 | "$P_CLI force_version=tls1_1 \ |
| 5640 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5641 | 0 \ |
| 5642 | -c "Read from server: 1 bytes read" |
| 5643 | |
| 5644 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5645 | "$P_SRV response_size=1" \ |
| 5646 | "$P_CLI force_version=tls1_2 \ |
| 5647 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5648 | 0 \ |
| 5649 | -c "Read from server: 1 bytes read" |
| 5650 | |
| 5651 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5652 | "$P_SRV response_size=1" \ |
| 5653 | "$P_CLI force_version=tls1_2 \ |
| 5654 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5655 | 0 \ |
| 5656 | -c "Read from server: 1 bytes read" |
| 5657 | |
| 5658 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5659 | "$P_SRV response_size=1" \ |
| 5660 | "$P_CLI force_version=tls1_2 \ |
| 5661 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5662 | 0 \ |
| 5663 | -c "Read from server: 1 bytes read" |
| 5664 | |
| 5665 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5666 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5667 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5668 | "$P_CLI force_version=tls1_2 \ |
| 5669 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5670 | 0 \ |
| 5671 | -c "Read from server: 1 bytes read" |
| 5672 | |
| 5673 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5674 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5675 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5676 | "$P_CLI force_version=tls1_2 \ |
| 5677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5678 | 0 \ |
| 5679 | -c "Read from server: 1 bytes read" |
| 5680 | |
| 5681 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5682 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5683 | "$P_CLI force_version=tls1_2 \ |
| 5684 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5685 | 0 \ |
| 5686 | -c "Read from server: 1 bytes read" |
| 5687 | |
| 5688 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5689 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5690 | "$P_CLI force_version=tls1_2 \ |
| 5691 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5692 | 0 \ |
| 5693 | -c "Read from server: 1 bytes read" |
| 5694 | |
| 5695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5696 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5697 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5698 | "$P_CLI force_version=tls1_2 \ |
| 5699 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5700 | 0 \ |
| 5701 | -c "Read from server: 1 bytes read" |
| 5702 | |
| 5703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5704 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5705 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5706 | "$P_CLI force_version=tls1_2 \ |
| 5707 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5708 | 0 \ |
| 5709 | -c "Read from server: 1 bytes read" |
| 5710 | |
| 5711 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5712 | "$P_SRV response_size=1" \ |
| 5713 | "$P_CLI force_version=tls1_2 \ |
| 5714 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5715 | 0 \ |
| 5716 | -c "Read from server: 1 bytes read" |
| 5717 | |
| 5718 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5719 | "$P_SRV response_size=1" \ |
| 5720 | "$P_CLI force_version=tls1_2 \ |
| 5721 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5722 | 0 \ |
| 5723 | -c "Read from server: 1 bytes read" |
| 5724 | |
| 5725 | # Tests for small server packets in DTLS |
| 5726 | |
| 5727 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5728 | run_test "Small server packet DTLS 1.0" \ |
| 5729 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5730 | "$P_CLI dtls=1 \ |
| 5731 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5732 | 0 \ |
| 5733 | -c "Read from server: 1 bytes read" |
| 5734 | |
| 5735 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5736 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 5737 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 5738 | "$P_CLI dtls=1 \ |
| 5739 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5740 | 0 \ |
| 5741 | -c "Read from server: 1 bytes read" |
| 5742 | |
| 5743 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5744 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5745 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 5746 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 5747 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 5748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5749 | 0 \ |
| 5750 | -c "Read from server: 1 bytes read" |
| 5751 | |
| 5752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5753 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5754 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 5755 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 5756 | "$P_CLI dtls=1 \ |
| 5757 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5758 | 0 \ |
| 5759 | -c "Read from server: 1 bytes read" |
| 5760 | |
| 5761 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5762 | run_test "Small server packet DTLS 1.2" \ |
| 5763 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5764 | "$P_CLI dtls=1 \ |
| 5765 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5766 | 0 \ |
| 5767 | -c "Read from server: 1 bytes read" |
| 5768 | |
| 5769 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5770 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5771 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5772 | "$P_CLI dtls=1 \ |
| 5773 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5774 | 0 \ |
| 5775 | -c "Read from server: 1 bytes read" |
| 5776 | |
| 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5778 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5779 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 5780 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 5781 | "$P_CLI dtls=1 \ |
| 5782 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5783 | 0 \ |
| 5784 | -c "Read from server: 1 bytes read" |
| 5785 | |
| 5786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5787 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5788 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 5789 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 5790 | "$P_CLI dtls=1 \ |
| 5791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5792 | 0 \ |
| 5793 | -c "Read from server: 1 bytes read" |
| 5794 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 5795 | # A test for extensions in SSLv3 |
| 5796 | |
| 5797 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5798 | run_test "SSLv3 with extensions, server side" \ |
| 5799 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 5800 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 5801 | 0 \ |
| 5802 | -S "dumping 'client hello extensions'" \ |
| 5803 | -S "server hello, total extension length:" |
| 5804 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5805 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5806 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5807 | # How many fragments do we expect to write $1 bytes? |
| 5808 | fragments_for_write() { |
| 5809 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5810 | } |
| 5811 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5812 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5813 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5814 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5815 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5816 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5817 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5818 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5819 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5820 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5821 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5822 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5823 | "$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] | 5824 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 5825 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5826 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5827 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5828 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5829 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5830 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5831 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5832 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5833 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5834 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5835 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5836 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5837 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5838 | 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] | 5839 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5840 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 5841 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5842 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5843 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5844 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5846 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5847 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5848 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5849 | 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] | 5850 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5851 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5852 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5853 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5855 | 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] | 5856 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5857 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5858 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5859 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5860 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5861 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5862 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5863 | "$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] | 5864 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5865 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5866 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5867 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5868 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5869 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5870 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5871 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5872 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5873 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5874 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5875 | |
| 5876 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5877 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5878 | "$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] | 5879 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5880 | 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] | 5881 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5882 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5883 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5884 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5885 | 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] | 5886 | "$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] | 5887 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5888 | 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] | 5889 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5890 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5891 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5892 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5893 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5894 | "$P_SRV" \ |
| 5895 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5896 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5897 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5898 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5899 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5900 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5901 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5902 | "$P_SRV" \ |
| 5903 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 5904 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5905 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5906 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5907 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5908 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5909 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5910 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5911 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5912 | 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] | 5913 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5914 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5915 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5916 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5917 | 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] | 5918 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5919 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5920 | 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] | 5921 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5922 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5923 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5924 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5925 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5926 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5927 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5928 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5929 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5930 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5931 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5932 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5933 | "$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] | 5934 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5935 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5936 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5937 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5938 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5939 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5940 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5941 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5942 | "$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] | 5943 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5944 | 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] | 5945 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5946 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5947 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5948 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5949 | 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] | 5950 | "$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] | 5951 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5952 | 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] | 5953 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5954 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5955 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5956 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5957 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5958 | "$P_SRV" \ |
| 5959 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5961 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5962 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5963 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5964 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5965 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5966 | "$P_SRV" \ |
| 5967 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5969 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5970 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5971 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5972 | 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] | 5973 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5974 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5975 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5976 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5977 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5978 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5979 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5980 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5981 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5982 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5983 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5984 | 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] | 5985 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5986 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5987 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5988 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5989 | 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] | 5990 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5991 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5992 | 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] | 5993 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5994 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5995 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5996 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5997 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5998 | "$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] | 5999 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6000 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6001 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6002 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6003 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6004 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6005 | 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] | 6006 | "$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] | 6007 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6008 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6009 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6010 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6011 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6012 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6013 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6014 | "$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] | 6015 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6016 | 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] | 6017 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6018 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6019 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6020 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6021 | 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] | 6022 | "$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] | 6023 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6024 | 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] | 6025 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6026 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6027 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6028 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6029 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6030 | "$P_SRV" \ |
| 6031 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6032 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6033 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6034 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6035 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6036 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6037 | 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] | 6038 | "$P_SRV" \ |
| 6039 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6040 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6041 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6042 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6043 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6044 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6045 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6046 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6047 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6048 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6049 | "$P_CLI force_version=ssl3 \ |
| 6050 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6051 | 0 \ |
| 6052 | -c "Read from server: 16384 bytes read" |
| 6053 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6054 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6055 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6056 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6057 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6058 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6059 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6060 | 0 \ |
| 6061 | -c "Read from server: 1 bytes read"\ |
| 6062 | -c "16383 bytes read"\ |
| 6063 | -C "Read from server: 16384 bytes read" |
| 6064 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6065 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6066 | "$P_SRV response_size=16384" \ |
| 6067 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6068 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6069 | 0 \ |
| 6070 | -c "Read from server: 1 bytes read"\ |
| 6071 | -c "16383 bytes read"\ |
| 6072 | -C "Read from server: 16384 bytes read" |
| 6073 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6074 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6075 | "$P_SRV response_size=16384" \ |
| 6076 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6077 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6078 | 0 \ |
| 6079 | -c "Read from server: 1 bytes read"\ |
| 6080 | -c "16383 bytes read"\ |
| 6081 | -C "Read from server: 16384 bytes read" |
| 6082 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6083 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6084 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6085 | "$P_SRV response_size=16384" \ |
| 6086 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6087 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6088 | trunc_hmac=1" \ |
| 6089 | 0 \ |
| 6090 | -c "Read from server: 1 bytes read"\ |
| 6091 | -c "16383 bytes read"\ |
| 6092 | -C "Read from server: 16384 bytes read" |
| 6093 | |
| 6094 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6095 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6096 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6097 | "$P_CLI force_version=tls1 \ |
| 6098 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6099 | trunc_hmac=1" \ |
| 6100 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6101 | -s "16384 bytes written in 1 fragments" \ |
| 6102 | -c "Read from server: 16384 bytes read" |
| 6103 | |
| 6104 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6105 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6106 | "$P_CLI force_version=tls1 \ |
| 6107 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6108 | 0 \ |
| 6109 | -s "16384 bytes written in 1 fragments" \ |
| 6110 | -c "Read from server: 16384 bytes read" |
| 6111 | |
| 6112 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6113 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6114 | "$P_CLI force_version=tls1 \ |
| 6115 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6116 | 0 \ |
| 6117 | -s "16384 bytes written in 1 fragments" \ |
| 6118 | -c "Read from server: 16384 bytes read" |
| 6119 | |
| 6120 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6121 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6122 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6123 | "$P_CLI force_version=tls1 \ |
| 6124 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6125 | 0 \ |
| 6126 | -s "16384 bytes written in 1 fragments" \ |
| 6127 | -c "Read from server: 16384 bytes read" |
| 6128 | |
| 6129 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6130 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6131 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6132 | "$P_CLI force_version=tls1 \ |
| 6133 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6134 | 0 \ |
| 6135 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6136 | -c "Read from server: 16384 bytes read" |
| 6137 | |
| 6138 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6139 | "$P_SRV response_size=16384" \ |
| 6140 | "$P_CLI force_version=tls1_1 \ |
| 6141 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6142 | 0 \ |
| 6143 | -c "Read from server: 16384 bytes read" |
| 6144 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6145 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6146 | "$P_SRV response_size=16384" \ |
| 6147 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6148 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6149 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6150 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6151 | -c "Read from server: 16384 bytes read" |
| 6152 | |
| 6153 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6154 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6155 | "$P_SRV response_size=16384" \ |
| 6156 | "$P_CLI force_version=tls1_1 \ |
| 6157 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6158 | trunc_hmac=1" \ |
| 6159 | 0 \ |
| 6160 | -c "Read from server: 16384 bytes read" |
| 6161 | |
| 6162 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6163 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6164 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6165 | "$P_CLI force_version=tls1_1 \ |
| 6166 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6167 | 0 \ |
| 6168 | -s "16384 bytes written in 1 fragments" \ |
| 6169 | -c "Read from server: 16384 bytes read" |
| 6170 | |
| 6171 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6172 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6173 | "$P_CLI force_version=tls1_1 \ |
| 6174 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6175 | 0 \ |
| 6176 | -c "Read from server: 16384 bytes read" |
| 6177 | |
| 6178 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6179 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6180 | "$P_CLI force_version=tls1_1 \ |
| 6181 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6182 | 0 \ |
| 6183 | -s "16384 bytes written in 1 fragments" \ |
| 6184 | -c "Read from server: 16384 bytes read" |
| 6185 | |
| 6186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6187 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6188 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6189 | "$P_CLI force_version=tls1_1 \ |
| 6190 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6191 | trunc_hmac=1" \ |
| 6192 | 0 \ |
| 6193 | -c "Read from server: 16384 bytes read" |
| 6194 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6195 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6196 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6197 | "$P_CLI force_version=tls1_1 \ |
| 6198 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6199 | 0 \ |
| 6200 | -s "16384 bytes written in 1 fragments" \ |
| 6201 | -c "Read from server: 16384 bytes read" |
| 6202 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6203 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6204 | "$P_SRV response_size=16384" \ |
| 6205 | "$P_CLI force_version=tls1_2 \ |
| 6206 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6207 | 0 \ |
| 6208 | -c "Read from server: 16384 bytes read" |
| 6209 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6210 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6211 | "$P_SRV response_size=16384" \ |
| 6212 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6213 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6214 | 0 \ |
| 6215 | -s "16384 bytes written in 1 fragments" \ |
| 6216 | -c "Read from server: 16384 bytes read" |
| 6217 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6218 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6219 | "$P_SRV response_size=16384" \ |
| 6220 | "$P_CLI force_version=tls1_2 \ |
| 6221 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6222 | 0 \ |
| 6223 | -c "Read from server: 16384 bytes read" |
| 6224 | |
| 6225 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6226 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6227 | "$P_SRV response_size=16384" \ |
| 6228 | "$P_CLI force_version=tls1_2 \ |
| 6229 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6230 | trunc_hmac=1" \ |
| 6231 | 0 \ |
| 6232 | -c "Read from server: 16384 bytes read" |
| 6233 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6234 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6235 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6236 | "$P_CLI force_version=tls1_2 \ |
| 6237 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6238 | 0 \ |
| 6239 | -s "16384 bytes written in 1 fragments" \ |
| 6240 | -c "Read from server: 16384 bytes read" |
| 6241 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6242 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6243 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6244 | "$P_CLI force_version=tls1_2 \ |
| 6245 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6246 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6247 | -s "16384 bytes written in 1 fragments" \ |
| 6248 | -c "Read from server: 16384 bytes read" |
| 6249 | |
| 6250 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6251 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6252 | "$P_CLI force_version=tls1_2 \ |
| 6253 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6254 | 0 \ |
| 6255 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6256 | -c "Read from server: 16384 bytes read" |
| 6257 | |
| 6258 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6259 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6260 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6261 | "$P_CLI force_version=tls1_2 \ |
| 6262 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6263 | trunc_hmac=1" \ |
| 6264 | 0 \ |
| 6265 | -c "Read from server: 16384 bytes read" |
| 6266 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6268 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6269 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6270 | "$P_CLI force_version=tls1_2 \ |
| 6271 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6272 | 0 \ |
| 6273 | -s "16384 bytes written in 1 fragments" \ |
| 6274 | -c "Read from server: 16384 bytes read" |
| 6275 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6276 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6277 | "$P_SRV response_size=16384" \ |
| 6278 | "$P_CLI force_version=tls1_2 \ |
| 6279 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6280 | 0 \ |
| 6281 | -c "Read from server: 16384 bytes read" |
| 6282 | |
| 6283 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6284 | "$P_SRV response_size=16384" \ |
| 6285 | "$P_CLI force_version=tls1_2 \ |
| 6286 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6287 | 0 \ |
| 6288 | -c "Read from server: 16384 bytes read" |
| 6289 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6290 | # Tests for restartable ECC |
| 6291 | |
| 6292 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6293 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6294 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6295 | "$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] | 6296 | 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] | 6297 | debug_level=1" \ |
| 6298 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6299 | -C "x509_verify_cert.*4b00" \ |
| 6300 | -C "mbedtls_pk_verify.*4b00" \ |
| 6301 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6302 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6303 | |
| 6304 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6305 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6306 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6307 | "$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] | 6308 | 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] | 6309 | debug_level=1 ec_max_ops=0" \ |
| 6310 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6311 | -C "x509_verify_cert.*4b00" \ |
| 6312 | -C "mbedtls_pk_verify.*4b00" \ |
| 6313 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6314 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6315 | |
| 6316 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6317 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6318 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6319 | "$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] | 6320 | 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] | 6321 | debug_level=1 ec_max_ops=65535" \ |
| 6322 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6323 | -C "x509_verify_cert.*4b00" \ |
| 6324 | -C "mbedtls_pk_verify.*4b00" \ |
| 6325 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6326 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6327 | |
| 6328 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6329 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6330 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6331 | "$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] | 6332 | 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] | 6333 | debug_level=1 ec_max_ops=1000" \ |
| 6334 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6335 | -c "x509_verify_cert.*4b00" \ |
| 6336 | -c "mbedtls_pk_verify.*4b00" \ |
| 6337 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6338 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6339 | |
| 6340 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6341 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6342 | "$P_SRV auth_mode=required \ |
| 6343 | crt_file=data_files/server5-badsign.crt \ |
| 6344 | key_file=data_files/server5.key" \ |
| 6345 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6346 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6347 | debug_level=1 ec_max_ops=1000" \ |
| 6348 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6349 | -c "x509_verify_cert.*4b00" \ |
| 6350 | -C "mbedtls_pk_verify.*4b00" \ |
| 6351 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6352 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6353 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6354 | -c "! mbedtls_ssl_handshake returned" \ |
| 6355 | -c "X509 - Certificate verification failed" |
| 6356 | |
| 6357 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6358 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6359 | "$P_SRV auth_mode=required \ |
| 6360 | crt_file=data_files/server5-badsign.crt \ |
| 6361 | key_file=data_files/server5.key" \ |
| 6362 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6363 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6364 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6365 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6366 | -c "x509_verify_cert.*4b00" \ |
| 6367 | -c "mbedtls_pk_verify.*4b00" \ |
| 6368 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6369 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6370 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6371 | -C "! mbedtls_ssl_handshake returned" \ |
| 6372 | -C "X509 - Certificate verification failed" |
| 6373 | |
| 6374 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6375 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6376 | "$P_SRV auth_mode=required \ |
| 6377 | crt_file=data_files/server5-badsign.crt \ |
| 6378 | key_file=data_files/server5.key" \ |
| 6379 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6380 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6381 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6382 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6383 | -C "x509_verify_cert.*4b00" \ |
| 6384 | -c "mbedtls_pk_verify.*4b00" \ |
| 6385 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6386 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6387 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6388 | -C "! mbedtls_ssl_handshake returned" \ |
| 6389 | -C "X509 - Certificate verification failed" |
| 6390 | |
| 6391 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6392 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6393 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6394 | "$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] | 6395 | 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] | 6396 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6397 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6398 | -c "x509_verify_cert.*4b00" \ |
| 6399 | -c "mbedtls_pk_verify.*4b00" \ |
| 6400 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6401 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6402 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6403 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6404 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6405 | "$P_SRV" \ |
| 6406 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6407 | debug_level=1 ec_max_ops=1000" \ |
| 6408 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6409 | -c "x509_verify_cert.*4b00" \ |
| 6410 | -c "mbedtls_pk_verify.*4b00" \ |
| 6411 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6412 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6413 | |
| 6414 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6415 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6416 | "$P_SRV psk=abc123" \ |
| 6417 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6418 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6419 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6420 | -C "x509_verify_cert.*4b00" \ |
| 6421 | -C "mbedtls_pk_verify.*4b00" \ |
| 6422 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6423 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6424 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6425 | # Tests of asynchronous private key support in SSL |
| 6426 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6427 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6428 | run_test "SSL async private: sign, delay=0" \ |
| 6429 | "$P_SRV \ |
| 6430 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6431 | "$P_CLI" \ |
| 6432 | 0 \ |
| 6433 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6434 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6435 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6436 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6437 | run_test "SSL async private: sign, delay=1" \ |
| 6438 | "$P_SRV \ |
| 6439 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6440 | "$P_CLI" \ |
| 6441 | 0 \ |
| 6442 | -s "Async sign callback: using key slot " \ |
| 6443 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6444 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6445 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6446 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6447 | run_test "SSL async private: sign, delay=2" \ |
| 6448 | "$P_SRV \ |
| 6449 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6450 | "$P_CLI" \ |
| 6451 | 0 \ |
| 6452 | -s "Async sign callback: using key slot " \ |
| 6453 | -U "Async sign callback: using key slot " \ |
| 6454 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6455 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6456 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6457 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6458 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6459 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6460 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6462 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6463 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6464 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6465 | "$P_CLI force_version=tls1_1" \ |
| 6466 | 0 \ |
| 6467 | -s "Async sign callback: using key slot " \ |
| 6468 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6469 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6470 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6471 | run_test "SSL async private: sign, SNI" \ |
| 6472 | "$P_SRV debug_level=3 \ |
| 6473 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6474 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6475 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6476 | "$P_CLI server_name=polarssl.example" \ |
| 6477 | 0 \ |
| 6478 | -s "Async sign callback: using key slot " \ |
| 6479 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6480 | -s "parse ServerName extension" \ |
| 6481 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6482 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6483 | |
| 6484 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6485 | run_test "SSL async private: decrypt, delay=0" \ |
| 6486 | "$P_SRV \ |
| 6487 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6488 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6489 | 0 \ |
| 6490 | -s "Async decrypt callback: using key slot " \ |
| 6491 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6492 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6493 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6494 | run_test "SSL async private: decrypt, delay=1" \ |
| 6495 | "$P_SRV \ |
| 6496 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6497 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6498 | 0 \ |
| 6499 | -s "Async decrypt callback: using key slot " \ |
| 6500 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6501 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6502 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6503 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6504 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6505 | "$P_SRV psk=abc123 \ |
| 6506 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6507 | "$P_CLI psk=abc123 \ |
| 6508 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6509 | 0 \ |
| 6510 | -s "Async decrypt callback: using key slot " \ |
| 6511 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6512 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6513 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6514 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6515 | "$P_SRV psk=abc123 \ |
| 6516 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6517 | "$P_CLI psk=abc123 \ |
| 6518 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6519 | 0 \ |
| 6520 | -s "Async decrypt callback: using key slot " \ |
| 6521 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6522 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6523 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6524 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6525 | run_test "SSL async private: sign callback not present" \ |
| 6526 | "$P_SRV \ |
| 6527 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6528 | "$P_CLI; [ \$? -eq 1 ] && |
| 6529 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6530 | 0 \ |
| 6531 | -S "Async sign callback" \ |
| 6532 | -s "! mbedtls_ssl_handshake returned" \ |
| 6533 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6534 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6535 | -s "Successful connection" |
| 6536 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6537 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6538 | run_test "SSL async private: decrypt callback not present" \ |
| 6539 | "$P_SRV debug_level=1 \ |
| 6540 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6541 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6542 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6543 | 0 \ |
| 6544 | -S "Async decrypt callback" \ |
| 6545 | -s "! mbedtls_ssl_handshake returned" \ |
| 6546 | -s "got no RSA private key" \ |
| 6547 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6548 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6549 | |
| 6550 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6551 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6552 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6553 | "$P_SRV \ |
| 6554 | async_operations=s async_private_delay1=1 \ |
| 6555 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6556 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6557 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6558 | 0 \ |
| 6559 | -s "Async sign callback: using key slot 0," \ |
| 6560 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6561 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6562 | |
| 6563 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6565 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6566 | "$P_SRV \ |
| 6567 | async_operations=s async_private_delay2=1 \ |
| 6568 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6569 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6570 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6571 | 0 \ |
| 6572 | -s "Async sign callback: using key slot 0," \ |
| 6573 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6574 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6575 | |
| 6576 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6577 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6578 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6579 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6580 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6581 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6582 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6583 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6584 | 0 \ |
| 6585 | -s "Async sign callback: using key slot 1," \ |
| 6586 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6587 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6588 | |
| 6589 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6590 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6591 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6592 | "$P_SRV \ |
| 6593 | async_operations=s async_private_delay1=1 \ |
| 6594 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6595 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6596 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6597 | 0 \ |
| 6598 | -s "Async sign callback: no key matches this certificate." |
| 6599 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6600 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6601 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6602 | "$P_SRV \ |
| 6603 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6604 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6605 | "$P_CLI" \ |
| 6606 | 1 \ |
| 6607 | -s "Async sign callback: injected error" \ |
| 6608 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6609 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6610 | -s "! mbedtls_ssl_handshake returned" |
| 6611 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6612 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6613 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6614 | "$P_SRV \ |
| 6615 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6616 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6617 | "$P_CLI" \ |
| 6618 | 1 \ |
| 6619 | -s "Async sign callback: using key slot " \ |
| 6620 | -S "Async resume" \ |
| 6621 | -s "Async cancel" |
| 6622 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6623 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6624 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6625 | "$P_SRV \ |
| 6626 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6627 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6628 | "$P_CLI" \ |
| 6629 | 1 \ |
| 6630 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6631 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6632 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6633 | -s "! mbedtls_ssl_handshake returned" |
| 6634 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6635 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6636 | run_test "SSL async private: decrypt, error in start" \ |
| 6637 | "$P_SRV \ |
| 6638 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6639 | async_private_error=1" \ |
| 6640 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6641 | 1 \ |
| 6642 | -s "Async decrypt callback: injected error" \ |
| 6643 | -S "Async resume" \ |
| 6644 | -S "Async cancel" \ |
| 6645 | -s "! mbedtls_ssl_handshake returned" |
| 6646 | |
| 6647 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6648 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6649 | "$P_SRV \ |
| 6650 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6651 | async_private_error=2" \ |
| 6652 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6653 | 1 \ |
| 6654 | -s "Async decrypt callback: using key slot " \ |
| 6655 | -S "Async resume" \ |
| 6656 | -s "Async cancel" |
| 6657 | |
| 6658 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6659 | run_test "SSL async private: decrypt, error in resume" \ |
| 6660 | "$P_SRV \ |
| 6661 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6662 | async_private_error=3" \ |
| 6663 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6664 | 1 \ |
| 6665 | -s "Async decrypt callback: using key slot " \ |
| 6666 | -s "Async resume callback: decrypt done but injected error" \ |
| 6667 | -S "Async cancel" \ |
| 6668 | -s "! mbedtls_ssl_handshake returned" |
| 6669 | |
| 6670 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6671 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6672 | "$P_SRV \ |
| 6673 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6674 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6675 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6676 | 0 \ |
| 6677 | -s "Async cancel" \ |
| 6678 | -s "! mbedtls_ssl_handshake returned" \ |
| 6679 | -s "Async resume" \ |
| 6680 | -s "Successful connection" |
| 6681 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6682 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6683 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6684 | "$P_SRV \ |
| 6685 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6686 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6687 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6688 | 0 \ |
| 6689 | -s "! mbedtls_ssl_handshake returned" \ |
| 6690 | -s "Async resume" \ |
| 6691 | -s "Successful connection" |
| 6692 | |
| 6693 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6694 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6695 | 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] | 6696 | "$P_SRV \ |
| 6697 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6698 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6699 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6700 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6701 | [ \$? -eq 1 ] && |
| 6702 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6703 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6704 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6705 | -S "Async resume" \ |
| 6706 | -s "Async cancel" \ |
| 6707 | -s "! mbedtls_ssl_handshake returned" \ |
| 6708 | -s "Async sign callback: no key matches this certificate." \ |
| 6709 | -s "Successful connection" |
| 6710 | |
| 6711 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6712 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6713 | 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] | 6714 | "$P_SRV \ |
| 6715 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6716 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6717 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6718 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6719 | [ \$? -eq 1 ] && |
| 6720 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6721 | 0 \ |
| 6722 | -s "Async resume" \ |
| 6723 | -s "! mbedtls_ssl_handshake returned" \ |
| 6724 | -s "Async sign callback: no key matches this certificate." \ |
| 6725 | -s "Successful connection" |
| 6726 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6727 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6729 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6730 | "$P_SRV \ |
| 6731 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6732 | exchanges=2 renegotiation=1" \ |
| 6733 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6734 | 0 \ |
| 6735 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6736 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6737 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6738 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6740 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 6741 | "$P_SRV \ |
| 6742 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6743 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6744 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6745 | 0 \ |
| 6746 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6747 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6748 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6749 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6751 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 6752 | "$P_SRV \ |
| 6753 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6754 | exchanges=2 renegotiation=1" \ |
| 6755 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6756 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6757 | 0 \ |
| 6758 | -s "Async decrypt callback: using key slot " \ |
| 6759 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6760 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6762 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6763 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 6764 | "$P_SRV \ |
| 6765 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6766 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6767 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6768 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6769 | 0 \ |
| 6770 | -s "Async decrypt callback: using key slot " \ |
| 6771 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6772 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6773 | # Tests for ECC extensions (rfc 4492) |
| 6774 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6775 | requires_config_enabled MBEDTLS_AES_C |
| 6776 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6777 | requires_config_enabled MBEDTLS_SHA256_C |
| 6778 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6779 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6780 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6781 | "$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] | 6782 | 0 \ |
| 6783 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6784 | -C "client hello, adding supported_point_formats extension" \ |
| 6785 | -S "found supported elliptic curves extension" \ |
| 6786 | -S "found supported point formats extension" |
| 6787 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6788 | requires_config_enabled MBEDTLS_AES_C |
| 6789 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6790 | requires_config_enabled MBEDTLS_SHA256_C |
| 6791 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6792 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6793 | "$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] | 6794 | "$P_CLI debug_level=3" \ |
| 6795 | 0 \ |
| 6796 | -C "found supported_point_formats extension" \ |
| 6797 | -S "server hello, supported_point_formats extension" |
| 6798 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_AES_C |
| 6800 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6801 | requires_config_enabled MBEDTLS_SHA256_C |
| 6802 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6803 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6804 | "$P_SRV debug_level=3" \ |
| 6805 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6806 | 0 \ |
| 6807 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6808 | -c "client hello, adding supported_point_formats extension" \ |
| 6809 | -s "found supported elliptic curves extension" \ |
| 6810 | -s "found supported point formats extension" |
| 6811 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6812 | requires_config_enabled MBEDTLS_AES_C |
| 6813 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6814 | requires_config_enabled MBEDTLS_SHA256_C |
| 6815 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6816 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6817 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6818 | "$P_CLI debug_level=3" \ |
| 6819 | 0 \ |
| 6820 | -c "found supported_point_formats extension" \ |
| 6821 | -s "server hello, supported_point_formats extension" |
| 6822 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6823 | # Tests for DTLS HelloVerifyRequest |
| 6824 | |
| 6825 | run_test "DTLS cookie: enabled" \ |
| 6826 | "$P_SRV dtls=1 debug_level=2" \ |
| 6827 | "$P_CLI dtls=1 debug_level=2" \ |
| 6828 | 0 \ |
| 6829 | -s "cookie verification failed" \ |
| 6830 | -s "cookie verification passed" \ |
| 6831 | -S "cookie verification skipped" \ |
| 6832 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6833 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6834 | -S "SSL - The requested feature is not available" |
| 6835 | |
| 6836 | run_test "DTLS cookie: disabled" \ |
| 6837 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6838 | "$P_CLI dtls=1 debug_level=2" \ |
| 6839 | 0 \ |
| 6840 | -S "cookie verification failed" \ |
| 6841 | -S "cookie verification passed" \ |
| 6842 | -s "cookie verification skipped" \ |
| 6843 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6844 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6845 | -S "SSL - The requested feature is not available" |
| 6846 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6847 | run_test "DTLS cookie: default (failing)" \ |
| 6848 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6849 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6850 | 1 \ |
| 6851 | -s "cookie verification failed" \ |
| 6852 | -S "cookie verification passed" \ |
| 6853 | -S "cookie verification skipped" \ |
| 6854 | -C "received hello verify request" \ |
| 6855 | -S "hello verification requested" \ |
| 6856 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6857 | |
| 6858 | requires_ipv6 |
| 6859 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6860 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6861 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6862 | 0 \ |
| 6863 | -s "cookie verification failed" \ |
| 6864 | -s "cookie verification passed" \ |
| 6865 | -S "cookie verification skipped" \ |
| 6866 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6867 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6868 | -S "SSL - The requested feature is not available" |
| 6869 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6870 | run_test "DTLS cookie: enabled, nbio" \ |
| 6871 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6872 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6873 | 0 \ |
| 6874 | -s "cookie verification failed" \ |
| 6875 | -s "cookie verification passed" \ |
| 6876 | -S "cookie verification skipped" \ |
| 6877 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6878 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6879 | -S "SSL - The requested feature is not available" |
| 6880 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6881 | # Tests for client reconnecting from the same port with DTLS |
| 6882 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6883 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6884 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6885 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6886 | "$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] | 6887 | 0 \ |
| 6888 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6889 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6890 | -S "Client initiated reconnection from same port" |
| 6891 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6892 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6893 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6894 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6895 | "$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] | 6896 | 0 \ |
| 6897 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6898 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6899 | -s "Client initiated reconnection from same port" |
| 6900 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6901 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6902 | 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] | 6903 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6904 | "$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] | 6905 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6906 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6907 | -s "Client initiated reconnection from same port" |
| 6908 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6909 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6910 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6911 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6912 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6913 | 0 \ |
| 6914 | -S "The operation timed out" \ |
| 6915 | -s "Client initiated reconnection from same port" |
| 6916 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6917 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6918 | "$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] | 6919 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6920 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6921 | -s "The operation timed out" \ |
| 6922 | -S "Client initiated reconnection from same port" |
| 6923 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6924 | # Tests for various cases of client authentication with DTLS |
| 6925 | # (focused on handshake flows and message parsing) |
| 6926 | |
| 6927 | run_test "DTLS client auth: required" \ |
| 6928 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6929 | "$P_CLI dtls=1" \ |
| 6930 | 0 \ |
| 6931 | -s "Verifying peer X.509 certificate... ok" |
| 6932 | |
| 6933 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6934 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6935 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6936 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6937 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6938 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6939 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6940 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6941 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6942 | 0 \ |
| 6943 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6944 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6945 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6946 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6947 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6948 | "$P_CLI dtls=1 psk=abc124" \ |
| 6949 | 1 \ |
| 6950 | -s "SSL - Verification of the message MAC failed" \ |
| 6951 | -c "SSL - A fatal alert message was received from our peer" |
| 6952 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6953 | # Tests for receiving fragmented handshake messages with DTLS |
| 6954 | |
| 6955 | requires_gnutls |
| 6956 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6957 | "$G_SRV -u --mtu 2048 -a" \ |
| 6958 | "$P_CLI dtls=1 debug_level=2" \ |
| 6959 | 0 \ |
| 6960 | -C "found fragmented DTLS handshake message" \ |
| 6961 | -C "error" |
| 6962 | |
| 6963 | requires_gnutls |
| 6964 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6965 | "$G_SRV -u --mtu 512" \ |
| 6966 | "$P_CLI dtls=1 debug_level=2" \ |
| 6967 | 0 \ |
| 6968 | -c "found fragmented DTLS handshake message" \ |
| 6969 | -C "error" |
| 6970 | |
| 6971 | requires_gnutls |
| 6972 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6973 | "$G_SRV -u --mtu 128" \ |
| 6974 | "$P_CLI dtls=1 debug_level=2" \ |
| 6975 | 0 \ |
| 6976 | -c "found fragmented DTLS handshake message" \ |
| 6977 | -C "error" |
| 6978 | |
| 6979 | requires_gnutls |
| 6980 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6981 | "$G_SRV -u --mtu 128" \ |
| 6982 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6983 | 0 \ |
| 6984 | -c "found fragmented DTLS handshake message" \ |
| 6985 | -C "error" |
| 6986 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6987 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6989 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6990 | "$G_SRV -u --mtu 256" \ |
| 6991 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6992 | 0 \ |
| 6993 | -c "found fragmented DTLS handshake message" \ |
| 6994 | -c "client hello, adding renegotiation extension" \ |
| 6995 | -c "found renegotiation extension" \ |
| 6996 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6997 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6998 | -C "error" \ |
| 6999 | -s "Extra-header:" |
| 7000 | |
| 7001 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7002 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7003 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7004 | "$G_SRV -u --mtu 256" \ |
| 7005 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7006 | 0 \ |
| 7007 | -c "found fragmented DTLS handshake message" \ |
| 7008 | -c "client hello, adding renegotiation extension" \ |
| 7009 | -c "found renegotiation extension" \ |
| 7010 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7011 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7012 | -C "error" \ |
| 7013 | -s "Extra-header:" |
| 7014 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7015 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7016 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7017 | "$P_CLI dtls=1 debug_level=2" \ |
| 7018 | 0 \ |
| 7019 | -C "found fragmented DTLS handshake message" \ |
| 7020 | -C "error" |
| 7021 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7022 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7023 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7024 | "$P_CLI dtls=1 debug_level=2" \ |
| 7025 | 0 \ |
| 7026 | -c "found fragmented DTLS handshake message" \ |
| 7027 | -C "error" |
| 7028 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7029 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7030 | "$O_SRV -dtls1 -mtu 256" \ |
| 7031 | "$P_CLI dtls=1 debug_level=2" \ |
| 7032 | 0 \ |
| 7033 | -c "found fragmented DTLS handshake message" \ |
| 7034 | -C "error" |
| 7035 | |
| 7036 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7037 | "$O_SRV -dtls1 -mtu 256" \ |
| 7038 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7039 | 0 \ |
| 7040 | -c "found fragmented DTLS handshake message" \ |
| 7041 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7042 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7043 | # Tests for sending fragmented handshake messages with DTLS |
| 7044 | # |
| 7045 | # Use client auth when we need the client to send large messages, |
| 7046 | # and use large cert chains on both sides too (the long chains we have all use |
| 7047 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7048 | # Sizes reached (UDP payload): |
| 7049 | # - 2037B for server certificate |
| 7050 | # - 1542B for client certificate |
| 7051 | # - 1013B for newsessionticket |
| 7052 | # - all others below 512B |
| 7053 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7054 | |
| 7055 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7056 | requires_config_enabled MBEDTLS_RSA_C |
| 7057 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7058 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7059 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7060 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7061 | crt_file=data_files/server7_int-ca.crt \ |
| 7062 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7063 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7064 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7065 | "$P_CLI dtls=1 debug_level=2 \ |
| 7066 | crt_file=data_files/server8_int-ca2.crt \ |
| 7067 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7068 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7069 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7070 | 0 \ |
| 7071 | -S "found fragmented DTLS handshake message" \ |
| 7072 | -C "found fragmented DTLS handshake message" \ |
| 7073 | -C "error" |
| 7074 | |
| 7075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7076 | requires_config_enabled MBEDTLS_RSA_C |
| 7077 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7078 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7079 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7080 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7081 | crt_file=data_files/server7_int-ca.crt \ |
| 7082 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7083 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7084 | max_frag_len=1024" \ |
| 7085 | "$P_CLI dtls=1 debug_level=2 \ |
| 7086 | crt_file=data_files/server8_int-ca2.crt \ |
| 7087 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7088 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7089 | max_frag_len=2048" \ |
| 7090 | 0 \ |
| 7091 | -S "found fragmented DTLS handshake message" \ |
| 7092 | -c "found fragmented DTLS handshake message" \ |
| 7093 | -C "error" |
| 7094 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7095 | # With the MFL extension, the server has no way of forcing |
| 7096 | # the client to not exceed a certain MTU; hence, the following |
| 7097 | # test can't be replicated with an MTU proxy such as the one |
| 7098 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7099 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7100 | requires_config_enabled MBEDTLS_RSA_C |
| 7101 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7103 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7104 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7105 | crt_file=data_files/server7_int-ca.crt \ |
| 7106 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7107 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7108 | max_frag_len=512" \ |
| 7109 | "$P_CLI dtls=1 debug_level=2 \ |
| 7110 | crt_file=data_files/server8_int-ca2.crt \ |
| 7111 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7112 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7113 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7114 | 0 \ |
| 7115 | -S "found fragmented DTLS handshake message" \ |
| 7116 | -c "found fragmented DTLS handshake message" \ |
| 7117 | -C "error" |
| 7118 | |
| 7119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7120 | requires_config_enabled MBEDTLS_RSA_C |
| 7121 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7122 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7123 | 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] | 7124 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7125 | crt_file=data_files/server7_int-ca.crt \ |
| 7126 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7127 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7128 | max_frag_len=2048" \ |
| 7129 | "$P_CLI dtls=1 debug_level=2 \ |
| 7130 | crt_file=data_files/server8_int-ca2.crt \ |
| 7131 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7132 | hs_timeout=2500-60000 \ |
| 7133 | max_frag_len=1024" \ |
| 7134 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7135 | -S "found fragmented DTLS handshake message" \ |
| 7136 | -c "found fragmented DTLS handshake message" \ |
| 7137 | -C "error" |
| 7138 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7139 | # While not required by the standard defining the MFL extension |
| 7140 | # (according to which it only applies to records, not to datagrams), |
| 7141 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7142 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7143 | # to the peer. |
| 7144 | # The next test checks that no datagrams significantly larger than the |
| 7145 | # negotiated MFL are sent. |
| 7146 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7147 | requires_config_enabled MBEDTLS_RSA_C |
| 7148 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7149 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7150 | 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] | 7151 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7152 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7153 | crt_file=data_files/server7_int-ca.crt \ |
| 7154 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7155 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7156 | max_frag_len=2048" \ |
| 7157 | "$P_CLI dtls=1 debug_level=2 \ |
| 7158 | crt_file=data_files/server8_int-ca2.crt \ |
| 7159 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7160 | hs_timeout=2500-60000 \ |
| 7161 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7162 | 0 \ |
| 7163 | -S "found fragmented DTLS handshake message" \ |
| 7164 | -c "found fragmented DTLS handshake message" \ |
| 7165 | -C "error" |
| 7166 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7168 | requires_config_enabled MBEDTLS_RSA_C |
| 7169 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7170 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7171 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7172 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7173 | crt_file=data_files/server7_int-ca.crt \ |
| 7174 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7175 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7176 | max_frag_len=2048" \ |
| 7177 | "$P_CLI dtls=1 debug_level=2 \ |
| 7178 | crt_file=data_files/server8_int-ca2.crt \ |
| 7179 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7180 | hs_timeout=2500-60000 \ |
| 7181 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7182 | 0 \ |
| 7183 | -s "found fragmented DTLS handshake message" \ |
| 7184 | -c "found fragmented DTLS handshake message" \ |
| 7185 | -C "error" |
| 7186 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7187 | # While not required by the standard defining the MFL extension |
| 7188 | # (according to which it only applies to records, not to datagrams), |
| 7189 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7190 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7191 | # to the peer. |
| 7192 | # The next test checks that no datagrams significantly larger than the |
| 7193 | # negotiated MFL are sent. |
| 7194 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7195 | requires_config_enabled MBEDTLS_RSA_C |
| 7196 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7197 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7198 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7199 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7200 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7201 | crt_file=data_files/server7_int-ca.crt \ |
| 7202 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7203 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7204 | max_frag_len=2048" \ |
| 7205 | "$P_CLI dtls=1 debug_level=2 \ |
| 7206 | crt_file=data_files/server8_int-ca2.crt \ |
| 7207 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7208 | hs_timeout=2500-60000 \ |
| 7209 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7210 | 0 \ |
| 7211 | -s "found fragmented DTLS handshake message" \ |
| 7212 | -c "found fragmented DTLS handshake message" \ |
| 7213 | -C "error" |
| 7214 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7215 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7216 | requires_config_enabled MBEDTLS_RSA_C |
| 7217 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7218 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7219 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7220 | crt_file=data_files/server7_int-ca.crt \ |
| 7221 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7222 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7223 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7224 | "$P_CLI dtls=1 debug_level=2 \ |
| 7225 | crt_file=data_files/server8_int-ca2.crt \ |
| 7226 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7227 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7228 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7229 | 0 \ |
| 7230 | -S "found fragmented DTLS handshake message" \ |
| 7231 | -C "found fragmented DTLS handshake message" \ |
| 7232 | -C "error" |
| 7233 | |
| 7234 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7235 | requires_config_enabled MBEDTLS_RSA_C |
| 7236 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7237 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7238 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7239 | crt_file=data_files/server7_int-ca.crt \ |
| 7240 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7241 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7242 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7243 | "$P_CLI dtls=1 debug_level=2 \ |
| 7244 | crt_file=data_files/server8_int-ca2.crt \ |
| 7245 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7246 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7247 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7248 | 0 \ |
| 7249 | -s "found fragmented DTLS handshake message" \ |
| 7250 | -C "found fragmented DTLS handshake message" \ |
| 7251 | -C "error" |
| 7252 | |
| 7253 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7254 | requires_config_enabled MBEDTLS_RSA_C |
| 7255 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7256 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7257 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7258 | crt_file=data_files/server7_int-ca.crt \ |
| 7259 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7260 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7261 | mtu=512" \ |
| 7262 | "$P_CLI dtls=1 debug_level=2 \ |
| 7263 | crt_file=data_files/server8_int-ca2.crt \ |
| 7264 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7265 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7266 | mtu=2048" \ |
| 7267 | 0 \ |
| 7268 | -S "found fragmented DTLS handshake message" \ |
| 7269 | -c "found fragmented DTLS handshake message" \ |
| 7270 | -C "error" |
| 7271 | |
| 7272 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7273 | requires_config_enabled MBEDTLS_RSA_C |
| 7274 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7275 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7276 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7277 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7278 | crt_file=data_files/server7_int-ca.crt \ |
| 7279 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7280 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7281 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7282 | "$P_CLI dtls=1 debug_level=2 \ |
| 7283 | crt_file=data_files/server8_int-ca2.crt \ |
| 7284 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7285 | hs_timeout=2500-60000 \ |
| 7286 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7287 | 0 \ |
| 7288 | -s "found fragmented DTLS handshake message" \ |
| 7289 | -c "found fragmented DTLS handshake message" \ |
| 7290 | -C "error" |
| 7291 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7292 | # 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] | 7293 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7294 | requires_config_enabled MBEDTLS_RSA_C |
| 7295 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7296 | requires_config_enabled MBEDTLS_SHA256_C |
| 7297 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7298 | requires_config_enabled MBEDTLS_AES_C |
| 7299 | requires_config_enabled MBEDTLS_GCM_C |
| 7300 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7301 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7302 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7303 | crt_file=data_files/server7_int-ca.crt \ |
| 7304 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7305 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7306 | mtu=512" \ |
| 7307 | "$P_CLI dtls=1 debug_level=2 \ |
| 7308 | crt_file=data_files/server8_int-ca2.crt \ |
| 7309 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7310 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7311 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7312 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7313 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7314 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7315 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7316 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7317 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7318 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7319 | # 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] | 7320 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7321 | # retransmissions, but in some cases (like both the server and client using |
| 7322 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7323 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7324 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7325 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7326 | requires_config_enabled MBEDTLS_RSA_C |
| 7327 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7328 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7329 | requires_config_enabled MBEDTLS_AES_C |
| 7330 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7331 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7332 | -p "$P_PXY mtu=508" \ |
| 7333 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7334 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7335 | key_file=data_files/server7.key \ |
| 7336 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7337 | "$P_CLI dtls=1 debug_level=2 \ |
| 7338 | crt_file=data_files/server8_int-ca2.crt \ |
| 7339 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7340 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7341 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7342 | 0 \ |
| 7343 | -s "found fragmented DTLS handshake message" \ |
| 7344 | -c "found fragmented DTLS handshake message" \ |
| 7345 | -C "error" |
| 7346 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7347 | # 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] | 7348 | only_with_valgrind |
| 7349 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7350 | requires_config_enabled MBEDTLS_RSA_C |
| 7351 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7353 | requires_config_enabled MBEDTLS_AES_C |
| 7354 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7355 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7356 | -p "$P_PXY mtu=508" \ |
| 7357 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7358 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7359 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7360 | hs_timeout=250-10000" \ |
| 7361 | "$P_CLI dtls=1 debug_level=2 \ |
| 7362 | crt_file=data_files/server8_int-ca2.crt \ |
| 7363 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7364 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7365 | hs_timeout=250-10000" \ |
| 7366 | 0 \ |
| 7367 | -s "found fragmented DTLS handshake message" \ |
| 7368 | -c "found fragmented DTLS handshake message" \ |
| 7369 | -C "error" |
| 7370 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7371 | # 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] | 7372 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7373 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7374 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7375 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7376 | requires_config_enabled MBEDTLS_RSA_C |
| 7377 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7378 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7379 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7380 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7381 | crt_file=data_files/server7_int-ca.crt \ |
| 7382 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7383 | hs_timeout=10000-60000 \ |
| 7384 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7385 | "$P_CLI dtls=1 debug_level=2 \ |
| 7386 | crt_file=data_files/server8_int-ca2.crt \ |
| 7387 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7388 | hs_timeout=10000-60000 \ |
| 7389 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7390 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7391 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7392 | -s "found fragmented DTLS handshake message" \ |
| 7393 | -c "found fragmented DTLS handshake message" \ |
| 7394 | -C "error" |
| 7395 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7396 | # 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] | 7397 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7398 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7399 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7400 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7401 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7402 | requires_config_enabled MBEDTLS_RSA_C |
| 7403 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7404 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7405 | requires_config_enabled MBEDTLS_AES_C |
| 7406 | requires_config_enabled MBEDTLS_GCM_C |
| 7407 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7408 | -p "$P_PXY mtu=512" \ |
| 7409 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7410 | crt_file=data_files/server7_int-ca.crt \ |
| 7411 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7412 | hs_timeout=10000-60000 \ |
| 7413 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7414 | "$P_CLI dtls=1 debug_level=2 \ |
| 7415 | crt_file=data_files/server8_int-ca2.crt \ |
| 7416 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7417 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7418 | hs_timeout=10000-60000 \ |
| 7419 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7420 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7421 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7422 | -s "found fragmented DTLS handshake message" \ |
| 7423 | -c "found fragmented DTLS handshake message" \ |
| 7424 | -C "error" |
| 7425 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7426 | not_with_valgrind # spurious autoreduction due to timeout |
| 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7428 | requires_config_enabled MBEDTLS_RSA_C |
| 7429 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7430 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7431 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7432 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7433 | crt_file=data_files/server7_int-ca.crt \ |
| 7434 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7435 | hs_timeout=10000-60000 \ |
| 7436 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7437 | "$P_CLI dtls=1 debug_level=2 \ |
| 7438 | crt_file=data_files/server8_int-ca2.crt \ |
| 7439 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7440 | hs_timeout=10000-60000 \ |
| 7441 | mtu=1024 nbio=2" \ |
| 7442 | 0 \ |
| 7443 | -S "autoreduction" \ |
| 7444 | -s "found fragmented DTLS handshake message" \ |
| 7445 | -c "found fragmented DTLS handshake message" \ |
| 7446 | -C "error" |
| 7447 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7448 | # 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] | 7449 | not_with_valgrind # spurious autoreduction due to timeout |
| 7450 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7451 | requires_config_enabled MBEDTLS_RSA_C |
| 7452 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7453 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7454 | requires_config_enabled MBEDTLS_AES_C |
| 7455 | requires_config_enabled MBEDTLS_GCM_C |
| 7456 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7457 | -p "$P_PXY mtu=512" \ |
| 7458 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7459 | crt_file=data_files/server7_int-ca.crt \ |
| 7460 | key_file=data_files/server7.key \ |
| 7461 | hs_timeout=10000-60000 \ |
| 7462 | mtu=512 nbio=2" \ |
| 7463 | "$P_CLI dtls=1 debug_level=2 \ |
| 7464 | crt_file=data_files/server8_int-ca2.crt \ |
| 7465 | key_file=data_files/server8.key \ |
| 7466 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7467 | hs_timeout=10000-60000 \ |
| 7468 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7469 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7470 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7471 | -s "found fragmented DTLS handshake message" \ |
| 7472 | -c "found fragmented DTLS handshake message" \ |
| 7473 | -C "error" |
| 7474 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7475 | # 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] | 7476 | # This ensures things still work after session_reset(). |
| 7477 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7478 | # Since we don't support reading fragmented ClientHello yet, |
| 7479 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7480 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7481 | # An autoreduction on the client-side might happen if the server is |
| 7482 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7483 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7484 | # resumed listening, which would result in a spurious autoreduction. |
| 7485 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7486 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7487 | requires_config_enabled MBEDTLS_RSA_C |
| 7488 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7489 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7490 | requires_config_enabled MBEDTLS_AES_C |
| 7491 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7492 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7493 | -p "$P_PXY mtu=1450" \ |
| 7494 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7495 | crt_file=data_files/server7_int-ca.crt \ |
| 7496 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7497 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7498 | mtu=1450" \ |
| 7499 | "$P_CLI dtls=1 debug_level=2 \ |
| 7500 | crt_file=data_files/server8_int-ca2.crt \ |
| 7501 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7502 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7503 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7504 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7505 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7506 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7507 | -s "found fragmented DTLS handshake message" \ |
| 7508 | -c "found fragmented DTLS handshake message" \ |
| 7509 | -C "error" |
| 7510 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7511 | # An autoreduction on the client-side might happen if the server is |
| 7512 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7513 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7515 | requires_config_enabled MBEDTLS_RSA_C |
| 7516 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7517 | requires_config_enabled MBEDTLS_SHA256_C |
| 7518 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7520 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7521 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7522 | -p "$P_PXY mtu=512" \ |
| 7523 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7524 | crt_file=data_files/server7_int-ca.crt \ |
| 7525 | key_file=data_files/server7.key \ |
| 7526 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7527 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7528 | mtu=512" \ |
| 7529 | "$P_CLI dtls=1 debug_level=2 \ |
| 7530 | crt_file=data_files/server8_int-ca2.crt \ |
| 7531 | key_file=data_files/server8.key \ |
| 7532 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7533 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7534 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7535 | mtu=512" \ |
| 7536 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7537 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7538 | -s "found fragmented DTLS handshake message" \ |
| 7539 | -c "found fragmented DTLS handshake message" \ |
| 7540 | -C "error" |
| 7541 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7542 | # An autoreduction on the client-side might happen if the server is |
| 7543 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7544 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7545 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7546 | requires_config_enabled MBEDTLS_RSA_C |
| 7547 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7548 | requires_config_enabled MBEDTLS_SHA256_C |
| 7549 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7550 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7551 | requires_config_enabled MBEDTLS_AES_C |
| 7552 | requires_config_enabled MBEDTLS_GCM_C |
| 7553 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7554 | -p "$P_PXY mtu=512" \ |
| 7555 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7556 | crt_file=data_files/server7_int-ca.crt \ |
| 7557 | key_file=data_files/server7.key \ |
| 7558 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7559 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7560 | mtu=512" \ |
| 7561 | "$P_CLI dtls=1 debug_level=2 \ |
| 7562 | crt_file=data_files/server8_int-ca2.crt \ |
| 7563 | key_file=data_files/server8.key \ |
| 7564 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7565 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7566 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7567 | mtu=512" \ |
| 7568 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7569 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7570 | -s "found fragmented DTLS handshake message" \ |
| 7571 | -c "found fragmented DTLS handshake message" \ |
| 7572 | -C "error" |
| 7573 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7574 | # An autoreduction on the client-side might happen if the server is |
| 7575 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7576 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7577 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7578 | requires_config_enabled MBEDTLS_RSA_C |
| 7579 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7580 | requires_config_enabled MBEDTLS_SHA256_C |
| 7581 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7582 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7583 | requires_config_enabled MBEDTLS_AES_C |
| 7584 | requires_config_enabled MBEDTLS_CCM_C |
| 7585 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7586 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7587 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7588 | crt_file=data_files/server7_int-ca.crt \ |
| 7589 | key_file=data_files/server7.key \ |
| 7590 | exchanges=2 renegotiation=1 \ |
| 7591 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7592 | hs_timeout=10000-60000 \ |
| 7593 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7594 | "$P_CLI dtls=1 debug_level=2 \ |
| 7595 | crt_file=data_files/server8_int-ca2.crt \ |
| 7596 | key_file=data_files/server8.key \ |
| 7597 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7598 | hs_timeout=10000-60000 \ |
| 7599 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7600 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7601 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7602 | -s "found fragmented DTLS handshake message" \ |
| 7603 | -c "found fragmented DTLS handshake message" \ |
| 7604 | -C "error" |
| 7605 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7606 | # An autoreduction on the client-side might happen if the server is |
| 7607 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7608 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7609 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7610 | requires_config_enabled MBEDTLS_RSA_C |
| 7611 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7612 | requires_config_enabled MBEDTLS_SHA256_C |
| 7613 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7614 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7615 | requires_config_enabled MBEDTLS_AES_C |
| 7616 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7617 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7618 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7619 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7620 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7621 | crt_file=data_files/server7_int-ca.crt \ |
| 7622 | key_file=data_files/server7.key \ |
| 7623 | exchanges=2 renegotiation=1 \ |
| 7624 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7625 | hs_timeout=10000-60000 \ |
| 7626 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7627 | "$P_CLI dtls=1 debug_level=2 \ |
| 7628 | crt_file=data_files/server8_int-ca2.crt \ |
| 7629 | key_file=data_files/server8.key \ |
| 7630 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7631 | hs_timeout=10000-60000 \ |
| 7632 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7633 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7634 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7635 | -s "found fragmented DTLS handshake message" \ |
| 7636 | -c "found fragmented DTLS handshake message" \ |
| 7637 | -C "error" |
| 7638 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7639 | # An autoreduction on the client-side might happen if the server is |
| 7640 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7641 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7642 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7643 | requires_config_enabled MBEDTLS_RSA_C |
| 7644 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7645 | requires_config_enabled MBEDTLS_SHA256_C |
| 7646 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7647 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7648 | requires_config_enabled MBEDTLS_AES_C |
| 7649 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7650 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7651 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7652 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7653 | crt_file=data_files/server7_int-ca.crt \ |
| 7654 | key_file=data_files/server7.key \ |
| 7655 | exchanges=2 renegotiation=1 \ |
| 7656 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7657 | hs_timeout=10000-60000 \ |
| 7658 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7659 | "$P_CLI dtls=1 debug_level=2 \ |
| 7660 | crt_file=data_files/server8_int-ca2.crt \ |
| 7661 | key_file=data_files/server8.key \ |
| 7662 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7663 | hs_timeout=10000-60000 \ |
| 7664 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7665 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7666 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7667 | -s "found fragmented DTLS handshake message" \ |
| 7668 | -c "found fragmented DTLS handshake message" \ |
| 7669 | -C "error" |
| 7670 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7671 | # 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] | 7672 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7673 | requires_config_enabled MBEDTLS_RSA_C |
| 7674 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7675 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7676 | requires_config_enabled MBEDTLS_AES_C |
| 7677 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7678 | client_needs_more_time 2 |
| 7679 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7680 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7681 | "$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] | 7682 | crt_file=data_files/server7_int-ca.crt \ |
| 7683 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7684 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7685 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7686 | crt_file=data_files/server8_int-ca2.crt \ |
| 7687 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7688 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7689 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7690 | 0 \ |
| 7691 | -s "found fragmented DTLS handshake message" \ |
| 7692 | -c "found fragmented DTLS handshake message" \ |
| 7693 | -C "error" |
| 7694 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7695 | # 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] | 7696 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7697 | requires_config_enabled MBEDTLS_RSA_C |
| 7698 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7699 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7700 | requires_config_enabled MBEDTLS_AES_C |
| 7701 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7702 | client_needs_more_time 2 |
| 7703 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7704 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7705 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7706 | crt_file=data_files/server7_int-ca.crt \ |
| 7707 | key_file=data_files/server7.key \ |
| 7708 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7709 | "$P_CLI dtls=1 debug_level=2 \ |
| 7710 | crt_file=data_files/server8_int-ca2.crt \ |
| 7711 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7712 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7713 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7714 | 0 \ |
| 7715 | -s "found fragmented DTLS handshake message" \ |
| 7716 | -c "found fragmented DTLS handshake message" \ |
| 7717 | -C "error" |
| 7718 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7719 | # interop tests for DTLS fragmentating with reliable connection |
| 7720 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7721 | # here and below we just want to test that the we fragment in a way that |
| 7722 | # pleases other implementations, so we don't need the peer to fragment |
| 7723 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7724 | requires_config_enabled MBEDTLS_RSA_C |
| 7725 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7727 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7728 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7729 | "$G_SRV -u" \ |
| 7730 | "$P_CLI dtls=1 debug_level=2 \ |
| 7731 | crt_file=data_files/server8_int-ca2.crt \ |
| 7732 | key_file=data_files/server8.key \ |
| 7733 | mtu=512 force_version=dtls1_2" \ |
| 7734 | 0 \ |
| 7735 | -c "fragmenting handshake message" \ |
| 7736 | -C "error" |
| 7737 | |
| 7738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7739 | requires_config_enabled MBEDTLS_RSA_C |
| 7740 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7741 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7742 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7743 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7744 | "$G_SRV -u" \ |
| 7745 | "$P_CLI dtls=1 debug_level=2 \ |
| 7746 | crt_file=data_files/server8_int-ca2.crt \ |
| 7747 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7748 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7749 | 0 \ |
| 7750 | -c "fragmenting handshake message" \ |
| 7751 | -C "error" |
| 7752 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7753 | # We use --insecure for the GnuTLS client because it expects |
| 7754 | # the hostname / IP it connects to to be the name used in the |
| 7755 | # certificate obtained from the server. Here, however, it |
| 7756 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7757 | # as the server name in the certificate. This will make the |
| 7758 | # certifiate validation fail, but passing --insecure makes |
| 7759 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7760 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7761 | requires_config_enabled MBEDTLS_RSA_C |
| 7762 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7763 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7764 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7765 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7766 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7767 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7768 | crt_file=data_files/server7_int-ca.crt \ |
| 7769 | key_file=data_files/server7.key \ |
| 7770 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7771 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7772 | 0 \ |
| 7773 | -s "fragmenting handshake message" |
| 7774 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7775 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7776 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7777 | requires_config_enabled MBEDTLS_RSA_C |
| 7778 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7780 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7781 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7782 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7783 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7784 | crt_file=data_files/server7_int-ca.crt \ |
| 7785 | key_file=data_files/server7.key \ |
| 7786 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7787 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7788 | 0 \ |
| 7789 | -s "fragmenting handshake message" |
| 7790 | |
| 7791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7792 | requires_config_enabled MBEDTLS_RSA_C |
| 7793 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7795 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7796 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7797 | "$P_CLI dtls=1 debug_level=2 \ |
| 7798 | crt_file=data_files/server8_int-ca2.crt \ |
| 7799 | key_file=data_files/server8.key \ |
| 7800 | mtu=512 force_version=dtls1_2" \ |
| 7801 | 0 \ |
| 7802 | -c "fragmenting handshake message" \ |
| 7803 | -C "error" |
| 7804 | |
| 7805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7806 | requires_config_enabled MBEDTLS_RSA_C |
| 7807 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7809 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 7810 | "$O_SRV -dtls1 -verify 10" \ |
| 7811 | "$P_CLI dtls=1 debug_level=2 \ |
| 7812 | crt_file=data_files/server8_int-ca2.crt \ |
| 7813 | key_file=data_files/server8.key \ |
| 7814 | mtu=512 force_version=dtls1" \ |
| 7815 | 0 \ |
| 7816 | -c "fragmenting handshake message" \ |
| 7817 | -C "error" |
| 7818 | |
| 7819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7820 | requires_config_enabled MBEDTLS_RSA_C |
| 7821 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7822 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7823 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7824 | "$P_SRV dtls=1 debug_level=2 \ |
| 7825 | crt_file=data_files/server7_int-ca.crt \ |
| 7826 | key_file=data_files/server7.key \ |
| 7827 | mtu=512 force_version=dtls1_2" \ |
| 7828 | "$O_CLI -dtls1_2" \ |
| 7829 | 0 \ |
| 7830 | -s "fragmenting handshake message" |
| 7831 | |
| 7832 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7833 | requires_config_enabled MBEDTLS_RSA_C |
| 7834 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7836 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 7837 | "$P_SRV dtls=1 debug_level=2 \ |
| 7838 | crt_file=data_files/server7_int-ca.crt \ |
| 7839 | key_file=data_files/server7.key \ |
| 7840 | mtu=512 force_version=dtls1" \ |
| 7841 | "$O_CLI -dtls1" \ |
| 7842 | 0 \ |
| 7843 | -s "fragmenting handshake message" |
| 7844 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7845 | # interop tests for DTLS fragmentating with unreliable connection |
| 7846 | # |
| 7847 | # again we just want to test that the we fragment in a way that |
| 7848 | # pleases other implementations, so we don't need the peer to fragment |
| 7849 | requires_gnutls_next |
| 7850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7851 | requires_config_enabled MBEDTLS_RSA_C |
| 7852 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7854 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7855 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7856 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7857 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7858 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7859 | crt_file=data_files/server8_int-ca2.crt \ |
| 7860 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7861 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7862 | 0 \ |
| 7863 | -c "fragmenting handshake message" \ |
| 7864 | -C "error" |
| 7865 | |
| 7866 | requires_gnutls_next |
| 7867 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7868 | requires_config_enabled MBEDTLS_RSA_C |
| 7869 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7870 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7871 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7872 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 7873 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7874 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7875 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7876 | crt_file=data_files/server8_int-ca2.crt \ |
| 7877 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7878 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7879 | 0 \ |
| 7880 | -c "fragmenting handshake message" \ |
| 7881 | -C "error" |
| 7882 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7883 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7884 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7885 | requires_config_enabled MBEDTLS_RSA_C |
| 7886 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7888 | client_needs_more_time 4 |
| 7889 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7890 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7891 | "$P_SRV dtls=1 debug_level=2 \ |
| 7892 | crt_file=data_files/server7_int-ca.crt \ |
| 7893 | key_file=data_files/server7.key \ |
| 7894 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7895 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7896 | 0 \ |
| 7897 | -s "fragmenting handshake message" |
| 7898 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7899 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7900 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7901 | requires_config_enabled MBEDTLS_RSA_C |
| 7902 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7903 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7904 | client_needs_more_time 4 |
| 7905 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7906 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7907 | "$P_SRV dtls=1 debug_level=2 \ |
| 7908 | crt_file=data_files/server7_int-ca.crt \ |
| 7909 | key_file=data_files/server7.key \ |
| 7910 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7911 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7912 | 0 \ |
| 7913 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7914 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7915 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7916 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7917 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7918 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7919 | ## (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] | 7920 | skip_next_test |
| 7921 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7922 | requires_config_enabled MBEDTLS_RSA_C |
| 7923 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7924 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7925 | client_needs_more_time 4 |
| 7926 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7927 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7928 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7929 | "$P_CLI dtls=1 debug_level=2 \ |
| 7930 | crt_file=data_files/server8_int-ca2.crt \ |
| 7931 | key_file=data_files/server8.key \ |
| 7932 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7933 | 0 \ |
| 7934 | -c "fragmenting handshake message" \ |
| 7935 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7936 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7937 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7938 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7939 | requires_config_enabled MBEDTLS_RSA_C |
| 7940 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7942 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7943 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7944 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7945 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7946 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7947 | crt_file=data_files/server8_int-ca2.crt \ |
| 7948 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7949 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7950 | 0 \ |
| 7951 | -c "fragmenting handshake message" \ |
| 7952 | -C "error" |
| 7953 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7954 | skip_next_test |
| 7955 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7956 | requires_config_enabled MBEDTLS_RSA_C |
| 7957 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7959 | client_needs_more_time 4 |
| 7960 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7961 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7962 | "$P_SRV dtls=1 debug_level=2 \ |
| 7963 | crt_file=data_files/server7_int-ca.crt \ |
| 7964 | key_file=data_files/server7.key \ |
| 7965 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7966 | "$O_CLI -dtls1_2" \ |
| 7967 | 0 \ |
| 7968 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7969 | |
| 7970 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7971 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7972 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7973 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7974 | requires_config_enabled MBEDTLS_RSA_C |
| 7975 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7976 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7977 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7978 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7979 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7980 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7981 | crt_file=data_files/server7_int-ca.crt \ |
| 7982 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7983 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7984 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7985 | 0 \ |
| 7986 | -s "fragmenting handshake message" |
| 7987 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7988 | # Tests for specific things with "unreliable" UDP connection |
| 7989 | |
| 7990 | not_with_valgrind # spurious resend due to timeout |
| 7991 | run_test "DTLS proxy: reference" \ |
| 7992 | -p "$P_PXY" \ |
| 7993 | "$P_SRV dtls=1 debug_level=2" \ |
| 7994 | "$P_CLI dtls=1 debug_level=2" \ |
| 7995 | 0 \ |
| 7996 | -C "replayed record" \ |
| 7997 | -S "replayed record" \ |
| 7998 | -C "record from another epoch" \ |
| 7999 | -S "record from another epoch" \ |
| 8000 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8001 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8002 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8003 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8004 | -c "HTTP/1.0 200 OK" |
| 8005 | |
| 8006 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8007 | run_test "DTLS proxy: duplicate every packet" \ |
| 8008 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8009 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8010 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8011 | 0 \ |
| 8012 | -c "replayed record" \ |
| 8013 | -s "replayed record" \ |
| 8014 | -c "record from another epoch" \ |
| 8015 | -s "record from another epoch" \ |
| 8016 | -S "resend" \ |
| 8017 | -s "Extra-header:" \ |
| 8018 | -c "HTTP/1.0 200 OK" |
| 8019 | |
| 8020 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8021 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8022 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8023 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8024 | 0 \ |
| 8025 | -c "replayed record" \ |
| 8026 | -S "replayed record" \ |
| 8027 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8028 | -s "record from another epoch" \ |
| 8029 | -c "resend" \ |
| 8030 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8031 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8032 | -c "HTTP/1.0 200 OK" |
| 8033 | |
| 8034 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8035 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8036 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8037 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8038 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8039 | -c "next record in same datagram" \ |
| 8040 | -s "next record in same datagram" |
| 8041 | |
| 8042 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8043 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8044 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8045 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8046 | 0 \ |
| 8047 | -c "next record in same datagram" \ |
| 8048 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8049 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8050 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8051 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8052 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8053 | "$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] | 8054 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8055 | -c "discarding invalid record (mac)" \ |
| 8056 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8057 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8058 | -c "HTTP/1.0 200 OK" \ |
| 8059 | -S "too many records with bad MAC" \ |
| 8060 | -S "Verification of the message MAC failed" |
| 8061 | |
| 8062 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8063 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8064 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8065 | "$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] | 8066 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8067 | -C "discarding invalid record (mac)" \ |
| 8068 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8069 | -S "Extra-header:" \ |
| 8070 | -C "HTTP/1.0 200 OK" \ |
| 8071 | -s "too many records with bad MAC" \ |
| 8072 | -s "Verification of the message MAC failed" |
| 8073 | |
| 8074 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8075 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8076 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8077 | "$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] | 8078 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8079 | -c "discarding invalid record (mac)" \ |
| 8080 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8081 | -s "Extra-header:" \ |
| 8082 | -c "HTTP/1.0 200 OK" \ |
| 8083 | -S "too many records with bad MAC" \ |
| 8084 | -S "Verification of the message MAC failed" |
| 8085 | |
| 8086 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8087 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8088 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8089 | "$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] | 8090 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8091 | -c "discarding invalid record (mac)" \ |
| 8092 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8093 | -s "Extra-header:" \ |
| 8094 | -c "HTTP/1.0 200 OK" \ |
| 8095 | -s "too many records with bad MAC" \ |
| 8096 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8097 | |
| 8098 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8099 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8100 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8101 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8102 | 0 \ |
| 8103 | -c "record from another epoch" \ |
| 8104 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8105 | -s "Extra-header:" \ |
| 8106 | -c "HTTP/1.0 200 OK" |
| 8107 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8108 | # Tests for reordering support with DTLS |
| 8109 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8110 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8111 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8112 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8113 | hs_timeout=2500-60000" \ |
| 8114 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8115 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8116 | 0 \ |
| 8117 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8118 | -c "Next handshake message has been buffered - load"\ |
| 8119 | -S "Buffering HS message" \ |
| 8120 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8121 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8122 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8123 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8124 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8125 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8126 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8127 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8128 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8129 | hs_timeout=2500-60000" \ |
| 8130 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8131 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8132 | 0 \ |
| 8133 | -c "Buffering HS message" \ |
| 8134 | -c "found fragmented DTLS handshake message"\ |
| 8135 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8136 | -c "Next handshake message has been buffered - load"\ |
| 8137 | -S "Buffering HS message" \ |
| 8138 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8139 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8140 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8141 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8142 | -S "Remember CCS message" |
| 8143 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8144 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8145 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8146 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8147 | # while keeping the ServerKeyExchange. |
| 8148 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8149 | 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] | 8150 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8151 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8152 | hs_timeout=2500-60000" \ |
| 8153 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8154 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8155 | 0 \ |
| 8156 | -c "Buffering HS message" \ |
| 8157 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8158 | -C "attempt to make space by freeing buffered messages" \ |
| 8159 | -S "Buffering HS message" \ |
| 8160 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8161 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8162 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8163 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8164 | -S "Remember CCS message" |
| 8165 | |
| 8166 | # The size constraints ensure that the delayed certificate message can't |
| 8167 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8168 | # when dropping it first. |
| 8169 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8170 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8171 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8172 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8173 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8174 | hs_timeout=2500-60000" \ |
| 8175 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8176 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8177 | 0 \ |
| 8178 | -c "Buffering HS message" \ |
| 8179 | -c "attempt to make space by freeing buffered future messages" \ |
| 8180 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8181 | -S "Buffering HS message" \ |
| 8182 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8183 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8184 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8185 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8186 | -S "Remember CCS message" |
| 8187 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8188 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8189 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8190 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8191 | hs_timeout=2500-60000" \ |
| 8192 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8193 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8194 | 0 \ |
| 8195 | -C "Buffering HS message" \ |
| 8196 | -C "Next handshake message has been buffered - load"\ |
| 8197 | -s "Buffering HS message" \ |
| 8198 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8199 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8200 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8201 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8202 | -S "Remember CCS message" |
| 8203 | |
| 8204 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8205 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8206 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8207 | hs_timeout=2500-60000" \ |
| 8208 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8209 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8210 | 0 \ |
| 8211 | -C "Buffering HS message" \ |
| 8212 | -C "Next handshake message has been buffered - load"\ |
| 8213 | -S "Buffering HS message" \ |
| 8214 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8215 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8216 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8217 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8218 | -S "Remember CCS message" |
| 8219 | |
| 8220 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8221 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8222 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8223 | hs_timeout=2500-60000" \ |
| 8224 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8225 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8226 | 0 \ |
| 8227 | -C "Buffering HS message" \ |
| 8228 | -C "Next handshake message has been buffered - load"\ |
| 8229 | -S "Buffering HS message" \ |
| 8230 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8231 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8232 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8233 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8234 | -s "Remember CCS message" |
| 8235 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8236 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8237 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8238 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8239 | hs_timeout=2500-60000" \ |
| 8240 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8241 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8242 | 0 \ |
| 8243 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8244 | -s "Found buffered record from current epoch - load" \ |
| 8245 | -c "Buffer record from epoch 1" \ |
| 8246 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8247 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8248 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8249 | # from the server are delayed, so that the encrypted Finished message |
| 8250 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8251 | # in afterwards, the encrypted Finished message must be freed in order |
| 8252 | # to make space for the NewSessionTicket to be reassembled. |
| 8253 | # This works only in very particular circumstances: |
| 8254 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8255 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8256 | # the encrypted Finished message. |
| 8257 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8258 | # needs to be fragmented. |
| 8259 | # - All messages sent by the server must be small enough to be either sent |
| 8260 | # without fragmentation or be reassembled within the bounds of |
| 8261 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8262 | # handshake, omitting CRTs. |
| 8263 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 8264 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 8265 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8266 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 8267 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 8268 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8269 | 0 \ |
| 8270 | -s "Buffer record from epoch 1" \ |
| 8271 | -s "Found buffered record from current epoch - load" \ |
| 8272 | -c "Buffer record from epoch 1" \ |
| 8273 | -C "Found buffered record from current epoch - load" \ |
| 8274 | -c "Enough space available after freeing future epoch record" |
| 8275 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8276 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8277 | |
| 8278 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8279 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8280 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8281 | "$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] | 8282 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8283 | "$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] | 8284 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8285 | 0 \ |
| 8286 | -s "Extra-header:" \ |
| 8287 | -c "HTTP/1.0 200 OK" |
| 8288 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8289 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8290 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8291 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8292 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8293 | "$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] | 8294 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8295 | 0 \ |
| 8296 | -s "Extra-header:" \ |
| 8297 | -c "HTTP/1.0 200 OK" |
| 8298 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8299 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8300 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8301 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8302 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8303 | "$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] | 8304 | 0 \ |
| 8305 | -s "Extra-header:" \ |
| 8306 | -c "HTTP/1.0 200 OK" |
| 8307 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8308 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8309 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8310 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8311 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8312 | "$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] | 8313 | 0 \ |
| 8314 | -s "Extra-header:" \ |
| 8315 | -c "HTTP/1.0 200 OK" |
| 8316 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8317 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8318 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8319 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8320 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8321 | "$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] | 8322 | 0 \ |
| 8323 | -s "Extra-header:" \ |
| 8324 | -c "HTTP/1.0 200 OK" |
| 8325 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8326 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8327 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8328 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8329 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8330 | "$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] | 8331 | 0 \ |
| 8332 | -s "Extra-header:" \ |
| 8333 | -c "HTTP/1.0 200 OK" |
| 8334 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8335 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8336 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8337 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8338 | "$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] | 8339 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8340 | "$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] | 8341 | 0 \ |
| 8342 | -s "Extra-header:" \ |
| 8343 | -c "HTTP/1.0 200 OK" |
| 8344 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8345 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8346 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8347 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8348 | "$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] | 8349 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8350 | "$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] | 8351 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8352 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8353 | 0 \ |
| 8354 | -s "a session has been resumed" \ |
| 8355 | -c "a session has been resumed" \ |
| 8356 | -s "Extra-header:" \ |
| 8357 | -c "HTTP/1.0 200 OK" |
| 8358 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8359 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8360 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8361 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8362 | "$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] | 8363 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8364 | "$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] | 8365 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8366 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8367 | 0 \ |
| 8368 | -s "a session has been resumed" \ |
| 8369 | -c "a session has been resumed" \ |
| 8370 | -s "Extra-header:" \ |
| 8371 | -c "HTTP/1.0 200 OK" |
| 8372 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8373 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8375 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8376 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8377 | "$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] | 8378 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8379 | "$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] | 8380 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8381 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8382 | 0 \ |
| 8383 | -c "=> renegotiate" \ |
| 8384 | -s "=> renegotiate" \ |
| 8385 | -s "Extra-header:" \ |
| 8386 | -c "HTTP/1.0 200 OK" |
| 8387 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8388 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8390 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8391 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8392 | "$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] | 8393 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8394 | "$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] | 8395 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8396 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8397 | 0 \ |
| 8398 | -c "=> renegotiate" \ |
| 8399 | -s "=> renegotiate" \ |
| 8400 | -s "Extra-header:" \ |
| 8401 | -c "HTTP/1.0 200 OK" |
| 8402 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8403 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8404 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8405 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8406 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8407 | "$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] | 8408 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8409 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8410 | "$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] | 8411 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8412 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8413 | 0 \ |
| 8414 | -c "=> renegotiate" \ |
| 8415 | -s "=> renegotiate" \ |
| 8416 | -s "Extra-header:" \ |
| 8417 | -c "HTTP/1.0 200 OK" |
| 8418 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8419 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8421 | 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] | 8422 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8423 | "$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] | 8424 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8425 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8426 | "$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] | 8427 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8428 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8429 | 0 \ |
| 8430 | -c "=> renegotiate" \ |
| 8431 | -s "=> renegotiate" \ |
| 8432 | -s "Extra-header:" \ |
| 8433 | -c "HTTP/1.0 200 OK" |
| 8434 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8435 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8436 | ## all versions installed on the CI machines), reported here: |
| 8437 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8438 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8439 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8440 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8441 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8442 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8443 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8444 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8445 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8446 | "$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] | 8447 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8448 | -c "HTTP/1.0 200 OK" |
| 8449 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8450 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8451 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8452 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8453 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8454 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8455 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8456 | "$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] | 8457 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8458 | -c "HTTP/1.0 200 OK" |
| 8459 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8460 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8461 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8462 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8463 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8464 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8465 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8466 | "$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] | 8467 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8468 | -c "HTTP/1.0 200 OK" |
| 8469 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8470 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8471 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8472 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8473 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8474 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8475 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8476 | "$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] | 8477 | 0 \ |
| 8478 | -s "Extra-header:" \ |
| 8479 | -c "Extra-header:" |
| 8480 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8481 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8482 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8483 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8484 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8485 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8486 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8487 | "$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] | 8488 | 0 \ |
| 8489 | -s "Extra-header:" \ |
| 8490 | -c "Extra-header:" |
| 8491 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8492 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8493 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8494 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8495 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8496 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8497 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8498 | "$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] | 8499 | 0 \ |
| 8500 | -s "Extra-header:" \ |
| 8501 | -c "Extra-header:" |
| 8502 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8504 | run_test "export keys functionality" \ |
| 8505 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8506 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8507 | 0 \ |
| 8508 | -s "exported maclen is " \ |
| 8509 | -s "exported keylen is " \ |
| 8510 | -s "exported ivlen is " \ |
| 8511 | -c "exported maclen is " \ |
| 8512 | -c "exported keylen is " \ |
| 8513 | -c "exported ivlen is " |
| 8514 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8515 | # Final report |
| 8516 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8517 | echo "------------------------------------------------------------------------" |
| 8518 | |
| 8519 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8520 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8521 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8522 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8523 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8524 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8525 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8526 | |
| 8527 | exit $FAILS |