Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 24 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 25 | # where it may output seemingly unlimited length error logs. |
| 26 | ulimit -f 20971520 |
| 27 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 28 | ORIGINAL_PWD=$PWD |
| 29 | if ! cd "$(dirname "$0")"; then |
| 30 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 31 | fi |
| 32 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 33 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 34 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 35 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 36 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 37 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 42 | guess_config_name() { |
| 43 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 44 | echo "default" |
| 45 | else |
| 46 | echo "unknown" |
| 47 | fi |
| 48 | } |
| 49 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 50 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 51 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 52 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 53 | 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] | 54 | 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] | 55 | 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] | 56 | 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] | 57 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 58 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 59 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 60 | |
| 61 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 62 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 63 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 64 | else |
| 65 | O_LEGACY_SRV=false |
| 66 | O_LEGACY_CLI=false |
| 67 | fi |
| 68 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 69 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 71 | else |
| 72 | G_NEXT_SRV=false |
| 73 | fi |
| 74 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 75 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 76 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 77 | else |
| 78 | G_NEXT_CLI=false |
| 79 | fi |
| 80 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 81 | TESTS=0 |
| 82 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 83 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 84 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 85 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 86 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 88 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 89 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 90 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 91 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 92 | RUN_TEST_NUMBER='' |
| 93 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 94 | PRESERVE_LOGS=0 |
| 95 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 97 | # port which is this plus 10000. Each port number may be independently |
| 98 | # overridden by a command line option. |
| 99 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 100 | PXY_PORT=$((SRV_PORT + 10000)) |
| 101 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 102 | print_usage() { |
| 103 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 104 | printf " -h|--help\tPrint this help.\n" |
| 105 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 106 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 107 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 108 | 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] | 109 | 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] | 110 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 111 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 112 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 113 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 114 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 115 | 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] | 116 | } |
| 117 | |
| 118 | get_options() { |
| 119 | while [ $# -gt 0 ]; do |
| 120 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 121 | -f|--filter) |
| 122 | shift; FILTER=$1 |
| 123 | ;; |
| 124 | -e|--exclude) |
| 125 | shift; EXCLUDE=$1 |
| 126 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 127 | -m|--memcheck) |
| 128 | MEMCHECK=1 |
| 129 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 130 | -n|--number) |
| 131 | shift; RUN_TEST_NUMBER=$1 |
| 132 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | -s|--show-numbers) |
| 134 | SHOW_TEST_NUMBER=1 |
| 135 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 136 | -p|--preserve-logs) |
| 137 | PRESERVE_LOGS=1 |
| 138 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 139 | --port) |
| 140 | shift; SRV_PORT=$1 |
| 141 | ;; |
| 142 | --proxy-port) |
| 143 | shift; PXY_PORT=$1 |
| 144 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 145 | --seed) |
| 146 | shift; SEED="$1" |
| 147 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 148 | -h|--help) |
| 149 | print_usage |
| 150 | exit 0 |
| 151 | ;; |
| 152 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 153 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 154 | print_usage |
| 155 | exit 1 |
| 156 | ;; |
| 157 | esac |
| 158 | shift |
| 159 | done |
| 160 | } |
| 161 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 162 | # Make the outcome file path relative to the original directory, not |
| 163 | # to .../tests |
| 164 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 165 | [!/]*) |
| 166 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 167 | ;; |
| 168 | esac |
| 169 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 170 | # Skip next test; use this macro to skip tests which are legitimate |
| 171 | # in theory and expected to be re-introduced at some point, but |
| 172 | # aren't expected to succeed at the moment due to problems outside |
| 173 | # our control (such as bugs in other TLS implementations). |
| 174 | skip_next_test() { |
| 175 | SKIP_NEXT="YES" |
| 176 | } |
| 177 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 178 | # skip next test if the flag is not enabled in config.h |
| 179 | requires_config_enabled() { |
| 180 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 181 | SKIP_NEXT="YES" |
| 182 | fi |
| 183 | } |
| 184 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 185 | # skip next test if the flag is enabled in config.h |
| 186 | requires_config_disabled() { |
| 187 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 188 | SKIP_NEXT="YES" |
| 189 | fi |
| 190 | } |
| 191 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 192 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 193 | # This function uses the query_config command line option to query the |
| 194 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 195 | # program. The command will always return a success value if the |
| 196 | # configuration is defined and the value will be printed to stdout. |
| 197 | # |
| 198 | # Note that if the configuration is not defined or is defined to nothing, |
| 199 | # the output of this function will be an empty string. |
| 200 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 204 | VAL="$( get_config_value_or_default "$1" )" |
| 205 | if [ -z "$VAL" ]; then |
| 206 | # Should never happen |
| 207 | echo "Mbed TLS configuration $1 is not defined" |
| 208 | exit 1 |
| 209 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 210 | SKIP_NEXT="YES" |
| 211 | fi |
| 212 | } |
| 213 | |
| 214 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 215 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 216 | if [ -z "$VAL" ]; then |
| 217 | # Should never happen |
| 218 | echo "Mbed TLS configuration $1 is not defined" |
| 219 | exit 1 |
| 220 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 221 | SKIP_NEXT="YES" |
| 222 | fi |
| 223 | } |
| 224 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 225 | requires_ciphersuite_enabled() { |
Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 226 | if [ -z "$($P_CLI --help | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 227 | SKIP_NEXT="YES" |
| 228 | fi |
| 229 | } |
| 230 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 231 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 232 | requires_openssl_with_fallback_scsv() { |
| 233 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 234 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 235 | then |
| 236 | OPENSSL_HAS_FBSCSV="YES" |
| 237 | else |
| 238 | OPENSSL_HAS_FBSCSV="NO" |
| 239 | fi |
| 240 | fi |
| 241 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 242 | SKIP_NEXT="YES" |
| 243 | fi |
| 244 | } |
| 245 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 246 | # skip next test if GnuTLS isn't available |
| 247 | requires_gnutls() { |
| 248 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 249 | 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] | 250 | GNUTLS_AVAILABLE="YES" |
| 251 | else |
| 252 | GNUTLS_AVAILABLE="NO" |
| 253 | fi |
| 254 | fi |
| 255 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 256 | SKIP_NEXT="YES" |
| 257 | fi |
| 258 | } |
| 259 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 260 | # skip next test if GnuTLS-next isn't available |
| 261 | requires_gnutls_next() { |
| 262 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 263 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 264 | GNUTLS_NEXT_AVAILABLE="YES" |
| 265 | else |
| 266 | GNUTLS_NEXT_AVAILABLE="NO" |
| 267 | fi |
| 268 | fi |
| 269 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 270 | SKIP_NEXT="YES" |
| 271 | fi |
| 272 | } |
| 273 | |
| 274 | # skip next test if OpenSSL-legacy isn't available |
| 275 | requires_openssl_legacy() { |
| 276 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 277 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 278 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 279 | else |
| 280 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 281 | fi |
| 282 | fi |
| 283 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 284 | SKIP_NEXT="YES" |
| 285 | fi |
| 286 | } |
| 287 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 288 | # skip next test if IPv6 isn't available on this host |
| 289 | requires_ipv6() { |
| 290 | if [ -z "${HAS_IPV6:-}" ]; then |
| 291 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 292 | SRV_PID=$! |
| 293 | sleep 1 |
| 294 | kill $SRV_PID >/dev/null 2>&1 |
| 295 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 296 | HAS_IPV6="NO" |
| 297 | else |
| 298 | HAS_IPV6="YES" |
| 299 | fi |
| 300 | rm -r $SRV_OUT |
| 301 | fi |
| 302 | |
| 303 | if [ "$HAS_IPV6" = "NO" ]; then |
| 304 | SKIP_NEXT="YES" |
| 305 | fi |
| 306 | } |
| 307 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 308 | # skip next test if it's i686 or uname is not available |
| 309 | requires_not_i686() { |
| 310 | if [ -z "${IS_I686:-}" ]; then |
| 311 | IS_I686="YES" |
| 312 | if which "uname" >/dev/null 2>&1; then |
| 313 | if [ -z "$(uname -a | grep i686)" ]; then |
| 314 | IS_I686="NO" |
| 315 | fi |
| 316 | fi |
| 317 | fi |
| 318 | if [ "$IS_I686" = "YES" ]; then |
| 319 | SKIP_NEXT="YES" |
| 320 | fi |
| 321 | } |
| 322 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 323 | # Calculate the input & output maximum content lengths set in the config |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 324 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 325 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 326 | MAX_OUT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 327 | |
| 328 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 329 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 330 | fi |
| 331 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 332 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 333 | fi |
| 334 | |
| 335 | # skip the next test if the SSL output buffer is less than 16KB |
| 336 | requires_full_size_output_buffer() { |
| 337 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 338 | SKIP_NEXT="YES" |
| 339 | fi |
| 340 | } |
| 341 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 342 | # skip the next test if valgrind is in use |
| 343 | not_with_valgrind() { |
| 344 | if [ "$MEMCHECK" -gt 0 ]; then |
| 345 | SKIP_NEXT="YES" |
| 346 | fi |
| 347 | } |
| 348 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 349 | # skip the next test if valgrind is NOT in use |
| 350 | only_with_valgrind() { |
| 351 | if [ "$MEMCHECK" -eq 0 ]; then |
| 352 | SKIP_NEXT="YES" |
| 353 | fi |
| 354 | } |
| 355 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 356 | # 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] | 357 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 358 | CLI_DELAY_FACTOR=$1 |
| 359 | } |
| 360 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 361 | # wait for the given seconds after the client finished in the next test |
| 362 | server_needs_more_time() { |
| 363 | SRV_DELAY_SECONDS=$1 |
| 364 | } |
| 365 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 366 | # print_name <name> |
| 367 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 368 | TESTS=$(( $TESTS + 1 )) |
| 369 | LINE="" |
| 370 | |
| 371 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 372 | LINE="$TESTS " |
| 373 | fi |
| 374 | |
| 375 | LINE="$LINE$1" |
| 376 | printf "$LINE " |
| 377 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 378 | for i in `seq 1 $LEN`; do printf '.'; done |
| 379 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 380 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 381 | } |
| 382 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 383 | # record_outcome <outcome> [<failure-reason>] |
| 384 | # The test name must be in $NAME. |
| 385 | record_outcome() { |
| 386 | echo "$1" |
| 387 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 388 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 389 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 390 | "ssl-opt" "$NAME" \ |
| 391 | "$1" "${2-}" \ |
| 392 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 393 | fi |
| 394 | } |
| 395 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 396 | # fail <message> |
| 397 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 398 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 399 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 400 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 401 | mv $SRV_OUT o-srv-${TESTS}.log |
| 402 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 403 | if [ -n "$PXY_CMD" ]; then |
| 404 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 405 | fi |
| 406 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 407 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 408 | 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] | 409 | echo " ! server output:" |
| 410 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 411 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 412 | echo " ! client output:" |
| 413 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 414 | if [ -n "$PXY_CMD" ]; then |
| 415 | echo " ! ========================================================" |
| 416 | echo " ! proxy output:" |
| 417 | cat o-pxy-${TESTS}.log |
| 418 | fi |
| 419 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 420 | fi |
| 421 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 422 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 423 | } |
| 424 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 425 | # is_polar <cmd_line> |
| 426 | is_polar() { |
| 427 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 428 | } |
| 429 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 430 | # openssl s_server doesn't have -www with DTLS |
| 431 | check_osrv_dtls() { |
| 432 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 433 | NEEDS_INPUT=1 |
| 434 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 435 | else |
| 436 | NEEDS_INPUT=0 |
| 437 | fi |
| 438 | } |
| 439 | |
| 440 | # provide input to commands that need it |
| 441 | provide_input() { |
| 442 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 443 | return |
| 444 | fi |
| 445 | |
| 446 | while true; do |
| 447 | echo "HTTP/1.0 200 OK" |
| 448 | sleep 1 |
| 449 | done |
| 450 | } |
| 451 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 452 | # has_mem_err <log_file_name> |
| 453 | has_mem_err() { |
| 454 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 455 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 456 | then |
| 457 | return 1 # false: does not have errors |
| 458 | else |
| 459 | return 0 # true: has errors |
| 460 | fi |
| 461 | } |
| 462 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 463 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 464 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 465 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 466 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 467 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 468 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 469 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 470 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 471 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 472 | # Make a tight loop, server normally takes less than 1s to start. |
| 473 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 474 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 475 | echo "$3 START TIMEOUT" |
| 476 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 477 | break |
| 478 | fi |
| 479 | # Linux and *BSD support decimal arguments to sleep. On other |
| 480 | # OSes this may be a tight loop. |
| 481 | sleep 0.1 2>/dev/null || true |
| 482 | done |
| 483 | } |
| 484 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 485 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 486 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 487 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 488 | } |
| 489 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 490 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 491 | # Wait for server process $2 to be listening on port $1. |
| 492 | wait_server_start() { |
| 493 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 494 | } |
| 495 | |
| 496 | # Wait for proxy process $2 to be listening on port $1. |
| 497 | wait_proxy_start() { |
| 498 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 499 | } |
| 500 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 501 | # 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] | 502 | # 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] | 503 | # acceptable bounds |
| 504 | check_server_hello_time() { |
| 505 | # 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] | 506 | 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] | 507 | # Get the Unix timestamp for now |
| 508 | CUR_TIME=$(date +'%s') |
| 509 | THRESHOLD_IN_SECS=300 |
| 510 | |
| 511 | # Check if the ServerHello time was printed |
| 512 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 513 | return 1 |
| 514 | fi |
| 515 | |
| 516 | # Check the time in ServerHello is within acceptable bounds |
| 517 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 518 | # The time in ServerHello is at least 5 minutes before now |
| 519 | return 1 |
| 520 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 521 | # 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] | 522 | return 1 |
| 523 | else |
| 524 | return 0 |
| 525 | fi |
| 526 | } |
| 527 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 528 | # wait for client to terminate and set CLI_EXIT |
| 529 | # must be called right after starting the client |
| 530 | wait_client_done() { |
| 531 | CLI_PID=$! |
| 532 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 533 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 534 | CLI_DELAY_FACTOR=1 |
| 535 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 536 | ( 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] | 537 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 538 | |
| 539 | wait $CLI_PID |
| 540 | CLI_EXIT=$? |
| 541 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 542 | kill $DOG_PID >/dev/null 2>&1 |
| 543 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 544 | |
| 545 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 546 | |
| 547 | sleep $SRV_DELAY_SECONDS |
| 548 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 549 | } |
| 550 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 551 | # check if the given command uses dtls and sets global variable DTLS |
| 552 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 553 | 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] | 554 | DTLS=1 |
| 555 | else |
| 556 | DTLS=0 |
| 557 | fi |
| 558 | } |
| 559 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 560 | # 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] | 561 | # Options: -s pattern pattern that must be present in server output |
| 562 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 563 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 564 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 565 | # -S pattern pattern that must be absent in server output |
| 566 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 567 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 568 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 569 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 570 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 571 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 572 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 573 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 574 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 575 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 576 | # There was no request to run the test, so don't record its outcome. |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 577 | return |
| 578 | fi |
| 579 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 580 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 581 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 582 | # Do we only run numbered tests? |
| 583 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 584 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 585 | else |
| 586 | SKIP_NEXT="YES" |
| 587 | fi |
| 588 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 589 | # does this test use a proxy? |
| 590 | if [ "X$1" = "X-p" ]; then |
| 591 | PXY_CMD="$2" |
| 592 | shift 2 |
| 593 | else |
| 594 | PXY_CMD="" |
| 595 | fi |
| 596 | |
| 597 | # get commands and client output |
| 598 | SRV_CMD="$1" |
| 599 | CLI_CMD="$2" |
| 600 | CLI_EXPECT="$3" |
| 601 | shift 3 |
| 602 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 603 | # Check if test uses files |
| 604 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 605 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 606 | requires_config_enabled MBEDTLS_FS_IO |
| 607 | fi |
| 608 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 609 | # Check if server forces ciphersuite |
| 610 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 611 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 612 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 613 | fi |
| 614 | |
| 615 | # Check if client forces ciphersuite |
| 616 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 617 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 618 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 619 | fi |
| 620 | |
| 621 | # should we skip? |
| 622 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 623 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 624 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 625 | SKIPS=$(( $SKIPS + 1 )) |
| 626 | return |
| 627 | fi |
| 628 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 629 | # fix client port |
| 630 | if [ -n "$PXY_CMD" ]; then |
| 631 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 632 | else |
| 633 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 634 | fi |
| 635 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 636 | # update DTLS variable |
| 637 | detect_dtls "$SRV_CMD" |
| 638 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 639 | # prepend valgrind to our commands if active |
| 640 | if [ "$MEMCHECK" -gt 0 ]; then |
| 641 | if is_polar "$SRV_CMD"; then |
| 642 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 643 | fi |
| 644 | if is_polar "$CLI_CMD"; then |
| 645 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 646 | fi |
| 647 | fi |
| 648 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 649 | TIMES_LEFT=2 |
| 650 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 651 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 652 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 653 | # run the commands |
| 654 | if [ -n "$PXY_CMD" ]; then |
| 655 | echo "$PXY_CMD" > $PXY_OUT |
| 656 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 657 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 659 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 660 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 661 | check_osrv_dtls |
| 662 | echo "$SRV_CMD" > $SRV_OUT |
| 663 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 664 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 666 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 667 | echo "$CLI_CMD" > $CLI_OUT |
| 668 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 669 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 670 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 671 | sleep 0.05 |
| 672 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 673 | # terminate the server (and the proxy) |
| 674 | kill $SRV_PID |
| 675 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 676 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 677 | if [ -n "$PXY_CMD" ]; then |
| 678 | kill $PXY_PID >/dev/null 2>&1 |
| 679 | wait $PXY_PID |
| 680 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 681 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 682 | # retry only on timeouts |
| 683 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 684 | printf "RETRY " |
| 685 | else |
| 686 | TIMES_LEFT=0 |
| 687 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 688 | done |
| 689 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 690 | # 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] | 691 | # (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] | 692 | # expected client exit to incorrectly succeed in case of catastrophic |
| 693 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 694 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 695 | 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] | 696 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 697 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 698 | return |
| 699 | fi |
| 700 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 701 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 702 | 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] | 703 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 704 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 705 | return |
| 706 | fi |
| 707 | fi |
| 708 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 709 | # check server exit code |
| 710 | if [ $? != 0 ]; then |
| 711 | fail "server fail" |
| 712 | return |
| 713 | fi |
| 714 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 715 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 716 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 717 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 718 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 719 | 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] | 720 | return |
| 721 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 722 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 723 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 724 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 725 | # 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] | 726 | while [ $# -gt 0 ] |
| 727 | do |
| 728 | case $1 in |
| 729 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 730 | 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] | 731 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 732 | return |
| 733 | fi |
| 734 | ;; |
| 735 | |
| 736 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 737 | 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] | 738 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 739 | return |
| 740 | fi |
| 741 | ;; |
| 742 | |
| 743 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 744 | 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] | 745 | 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] | 746 | return |
| 747 | fi |
| 748 | ;; |
| 749 | |
| 750 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 751 | 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] | 752 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 753 | return |
| 754 | fi |
| 755 | ;; |
| 756 | |
| 757 | # The filtering in the following two options (-u and -U) do the following |
| 758 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 759 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 760 | # - keep one of each non-unique line |
| 761 | # - count how many lines remain |
| 762 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 763 | # if there were no duplicates. |
| 764 | "-U") |
| 765 | 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 |
| 766 | fail "lines following pattern '$2' must be unique in Server output" |
| 767 | return |
| 768 | fi |
| 769 | ;; |
| 770 | |
| 771 | "-u") |
| 772 | 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 |
| 773 | 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] | 774 | return |
| 775 | fi |
| 776 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 777 | "-F") |
| 778 | if ! $2 "$SRV_OUT"; then |
| 779 | fail "function call to '$2' failed on Server output" |
| 780 | return |
| 781 | fi |
| 782 | ;; |
| 783 | "-f") |
| 784 | if ! $2 "$CLI_OUT"; then |
| 785 | fail "function call to '$2' failed on Client output" |
| 786 | return |
| 787 | fi |
| 788 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 789 | |
| 790 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 791 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 792 | exit 1 |
| 793 | esac |
| 794 | shift 2 |
| 795 | done |
| 796 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 797 | # check valgrind's results |
| 798 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 799 | 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] | 800 | fail "Server has memory errors" |
| 801 | return |
| 802 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 803 | 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] | 804 | fail "Client has memory errors" |
| 805 | return |
| 806 | fi |
| 807 | fi |
| 808 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 809 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 810 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 811 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 812 | mv $SRV_OUT o-srv-${TESTS}.log |
| 813 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 814 | if [ -n "$PXY_CMD" ]; then |
| 815 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 816 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 817 | fi |
| 818 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 819 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 820 | } |
| 821 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 822 | run_test_psa() { |
| 823 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 824 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 825 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 826 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 827 | 0 \ |
| 828 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 829 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 830 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 831 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 832 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 833 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 834 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 835 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 836 | -C "Failed to setup PSA-based cipher context"\ |
| 837 | -S "Failed to setup PSA-based cipher context"\ |
| 838 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 839 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 840 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 841 | -S "error" \ |
| 842 | -C "error" |
| 843 | } |
| 844 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 845 | run_test_psa_force_curve() { |
| 846 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 847 | run_test "PSA - ECDH with $1" \ |
| 848 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 849 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 850 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 851 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 852 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 853 | -c "PSA calc verify" \ |
| 854 | -c "calc PSA finished" \ |
| 855 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 856 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 857 | -s "PSA calc verify" \ |
| 858 | -s "calc PSA finished" \ |
| 859 | -C "Failed to setup PSA-based cipher context"\ |
| 860 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 861 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 862 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 863 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 864 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 865 | -C "error" |
| 866 | } |
| 867 | |
| 868 | cleanup() { |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 869 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
| 870 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 871 | 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] | 872 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 873 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
| 874 | exit 1 |
| 875 | } |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 876 | |
| 877 | # |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 878 | # MAIN |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 879 | # |
| 880 | |
| 881 | get_options "$@" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 882 | |
| 883 | # sanity checks, avoid an avalanche of errors |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 884 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 885 | P_CLI_BIN="${P_CLI%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 886 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 887 | if [ ! -x "$P_SRV_BIN" ]; then |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 888 | echo "Command '$P_SRV_BIN' is not an executable file" |
| 889 | exit 1 |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 890 | fi |
| 891 | if [ ! -x "$P_CLI_BIN" ]; then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 892 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 893 | exit 1 |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 894 | fi |
| 895 | if [ ! -x "$P_PXY_BIN" ]; then |
| 896 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 897 | exit 1 |
| 898 | fi |
| 899 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 900 | if which valgrind >/dev/null 2>&1; then :; else |
| 901 | echo "Memcheck not possible. Valgrind not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 902 | exit 1 |
| 903 | fi |
| 904 | fi |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 905 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 906 | echo "Command '$OPENSSL_CMD' not found" |
| 907 | exit 1 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 908 | fi |
| 909 | |
| 910 | # used by watchdog |
| 911 | MAIN_PID="$$" |
| 912 | |
| 913 | # We use somewhat arbitrary delays for tests: |
| 914 | # - how long do we wait for the server to start (when lsof not available)? |
| 915 | # - how long do we allow for the client to finish? |
| 916 | # (not to check performance, just to avoid waiting indefinitely) |
| 917 | # Things are slower with valgrind, so give extra time here. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 918 | # |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 919 | # Note: without lsof, there is a trade-off between the running time of this |
| 920 | # 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] | 921 | # 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] | 922 | # the script, only the case where a client or server gets stuck. |
| 923 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 924 | START_DELAY=6 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 925 | DOG_DELAY=60 |
| 926 | else |
| 927 | START_DELAY=2 |
| 928 | DOG_DELAY=20 |
| 929 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 930 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 931 | # some particular tests need more time: |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 932 | # - 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] | 933 | # - 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] | 934 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 935 | CLI_DELAY_FACTOR=1 |
| 936 | SRV_DELAY_SECONDS=0 |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 937 | |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 938 | # 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] | 939 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 940 | 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] | 941 | 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] | 942 | 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] | 943 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 944 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 945 | G_SRV="$G_SRV -p $SRV_PORT" |
| 946 | G_CLI="$G_CLI -p +SRV_PORT" |
| 947 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 948 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 949 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 950 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 951 | fi |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 952 | |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 953 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 954 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 955 | fi |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 956 | |
| 957 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 958 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 959 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 960 | |
| 961 | # Allow SHA-1, because many of our test certificates use it |
| 962 | P_SRV="$P_SRV allow_sha1=1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 963 | P_CLI="$P_CLI allow_sha1=1" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 964 | |
| 965 | # Also pick a unique name for intermediate files |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 966 | SRV_OUT="srv_out.$$" |
| 967 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 968 | PXY_OUT="pxy_out.$$" |
| 969 | SESSION="session.$$" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 970 | |
| 971 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 972 | |
| 973 | trap cleanup INT TERM HUP |
| 974 | |
| 975 | # Basic test |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 976 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 977 | # Checks that: |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 978 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 979 | # - the expected (highest security) parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 980 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 981 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 982 | "$P_SRV debug_level=3" \ |
| 983 | "$P_CLI" \ |
| 984 | 0 \ |
| 985 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 986 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 987 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 988 | -s "ECDHE curve: secp521r1" \ |
| 989 | -S "error" \ |
| 990 | -C "error" |
| 991 | |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 992 | run_test "Default, DTLS" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 993 | "$P_SRV dtls=1" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 994 | "$P_CLI dtls=1" \ |
| 995 | 0 \ |
| 996 | -s "Protocol is DTLSv1.2" \ |
| 997 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 998 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 999 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1000 | run_test "Default (compression enabled)" \ |
| 1001 | "$P_SRV debug_level=3" \ |
| 1002 | "$P_CLI debug_level=3" \ |
| 1003 | 0 \ |
| 1004 | -s "Allocating compression buffer" \ |
| 1005 | -c "Allocating compression buffer" \ |
| 1006 | -s "Record expansion is unknown (compression)" \ |
| 1007 | -c "Record expansion is unknown (compression)" \ |
| 1008 | -S "error" \ |
| 1009 | -C "error" |
| 1010 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1011 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1012 | run_test "CA callback on client" \ |
| 1013 | "$P_SRV debug_level=3" \ |
| 1014 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1015 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1016 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1017 | -S "error" \ |
| 1018 | -C "error" |
| 1019 | |
| 1020 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1021 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1022 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1023 | requires_config_enabled MBEDTLS_SHA256_C |
| 1024 | run_test "CA callback on server" \ |
| 1025 | "$P_SRV auth_mode=required" \ |
| 1026 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1027 | key_file=data_files/server5.key" \ |
| 1028 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1029 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1030 | -s "Verifying peer X.509 certificate... ok" \ |
| 1031 | -S "error" \ |
| 1032 | -C "error" |
| 1033 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1034 | # Test using an opaque private key for client authentication |
| 1035 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1036 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1037 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1038 | requires_config_enabled MBEDTLS_SHA256_C |
| 1039 | run_test "Opaque key for client authentication" \ |
| 1040 | "$P_SRV auth_mode=required" \ |
| 1041 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1042 | key_file=data_files/server5.key" \ |
| 1043 | 0 \ |
| 1044 | -c "key type: Opaque" \ |
| 1045 | -s "Verifying peer X.509 certificate... ok" \ |
| 1046 | -S "error" \ |
| 1047 | -C "error" |
| 1048 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1049 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1050 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1051 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1052 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1053 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1054 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1055 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1056 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1057 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1058 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1059 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1060 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1061 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1062 | run_test_psa_force_curve "secp521r1" |
| 1063 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1064 | run_test_psa_force_curve "brainpoolP512r1" |
| 1065 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1066 | run_test_psa_force_curve "secp384r1" |
| 1067 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1068 | run_test_psa_force_curve "brainpoolP384r1" |
| 1069 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1070 | run_test_psa_force_curve "secp256r1" |
| 1071 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1072 | run_test_psa_force_curve "secp256k1" |
| 1073 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1074 | run_test_psa_force_curve "brainpoolP256r1" |
| 1075 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1076 | run_test_psa_force_curve "secp224r1" |
| 1077 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1078 | run_test_psa_force_curve "secp224k1" |
| 1079 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1080 | run_test_psa_force_curve "secp192r1" |
| 1081 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1082 | run_test_psa_force_curve "secp192k1" |
| 1083 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1084 | # Test current time in ServerHello |
| 1085 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1086 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1087 | "$P_SRV debug_level=3" \ |
| 1088 | "$P_CLI debug_level=3" \ |
| 1089 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1090 | -f "check_server_hello_time" \ |
| 1091 | -F "check_server_hello_time" |
| 1092 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1093 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1094 | run_test "Unique IV in GCM" \ |
| 1095 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1096 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1097 | 0 \ |
| 1098 | -u "IV used" \ |
| 1099 | -U "IV used" |
| 1100 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1101 | # Tests for certificate verification callback |
| 1102 | run_test "Configuration-specific CRT verification callback" \ |
| 1103 | "$P_SRV debug_level=3" \ |
| 1104 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1105 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1106 | -S "error" \ |
| 1107 | -c "Verify requested for " \ |
| 1108 | -c "Use configuration-specific verification callback" \ |
| 1109 | -C "Use context-specific verification callback" \ |
| 1110 | -C "error" |
| 1111 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1112 | run_test "Context-specific CRT verification callback" \ |
| 1113 | "$P_SRV debug_level=3" \ |
| 1114 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1115 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1116 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1117 | -c "Verify requested for " \ |
| 1118 | -c "Use context-specific verification callback" \ |
| 1119 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1120 | -C "error" |
| 1121 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1122 | # Tests for rc4 option |
| 1123 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1124 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1125 | run_test "RC4: server disabled, client enabled" \ |
| 1126 | "$P_SRV" \ |
| 1127 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1128 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1129 | -s "SSL - The server has no ciphersuites in common" |
| 1130 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1131 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1132 | run_test "RC4: server half, client enabled" \ |
| 1133 | "$P_SRV arc4=1" \ |
| 1134 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1135 | 1 \ |
| 1136 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1137 | |
| 1138 | run_test "RC4: server enabled, client disabled" \ |
| 1139 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1140 | "$P_CLI" \ |
| 1141 | 1 \ |
| 1142 | -s "SSL - The server has no ciphersuites in common" |
| 1143 | |
| 1144 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1145 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1146 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1147 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1148 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1149 | -S "SSL - The server has no ciphersuites in common" |
| 1150 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1151 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1152 | |
| 1153 | requires_gnutls |
| 1154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1155 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1156 | "$G_SRV"\ |
| 1157 | "$P_CLI force_version=tls1_1" \ |
| 1158 | 0 |
| 1159 | |
| 1160 | requires_gnutls |
| 1161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1162 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1163 | "$G_SRV"\ |
| 1164 | "$P_CLI force_version=tls1" \ |
| 1165 | 0 |
| 1166 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1167 | # Tests for SHA-1 support |
| 1168 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1169 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1170 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1171 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1172 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1173 | 1 \ |
| 1174 | -c "The certificate is signed with an unacceptable hash" |
| 1175 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1176 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1177 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1178 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1179 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1180 | 0 |
| 1181 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1182 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1183 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1184 | "$P_CLI allow_sha1=1" \ |
| 1185 | 0 |
| 1186 | |
| 1187 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1188 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1189 | "$P_CLI allow_sha1=0" \ |
| 1190 | 0 |
| 1191 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1192 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1193 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1194 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1195 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1196 | 1 \ |
| 1197 | -s "The certificate is signed with an unacceptable hash" |
| 1198 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1199 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1200 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1201 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1202 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1203 | 0 |
| 1204 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1205 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1206 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1207 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1208 | 0 |
| 1209 | |
| 1210 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1211 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1212 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1213 | 0 |
| 1214 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1215 | # Tests for datagram packing |
| 1216 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1217 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1218 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1219 | 0 \ |
| 1220 | -c "next record in same datagram" \ |
| 1221 | -s "next record in same datagram" |
| 1222 | |
| 1223 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1224 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1225 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1226 | 0 \ |
| 1227 | -s "next record in same datagram" \ |
| 1228 | -C "next record in same datagram" |
| 1229 | |
| 1230 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1231 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1232 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1233 | 0 \ |
| 1234 | -S "next record in same datagram" \ |
| 1235 | -c "next record in same datagram" |
| 1236 | |
| 1237 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1238 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1239 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1240 | 0 \ |
| 1241 | -S "next record in same datagram" \ |
| 1242 | -C "next record in same datagram" |
| 1243 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1244 | # Tests for Truncated HMAC extension |
| 1245 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1246 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1247 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1248 | "$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] | 1249 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1250 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1251 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1252 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1253 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1254 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1255 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1256 | "$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] | 1257 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1258 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1259 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1260 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1261 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1262 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1263 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1264 | "$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] | 1265 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1266 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1267 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1268 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1269 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1270 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1271 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1272 | "$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] | 1273 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1274 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1275 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1276 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1277 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1278 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1279 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1280 | "$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] | 1281 | 0 \ |
| 1282 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1283 | -S "dumping 'expected mac' (10 bytes)" |
| 1284 | |
| 1285 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1286 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1287 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1288 | "$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] | 1289 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1290 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1291 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1292 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1293 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1294 | "$P_SRV dtls=1 debug_level=4" \ |
| 1295 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1296 | 0 \ |
| 1297 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1298 | -S "dumping 'expected mac' (10 bytes)" |
| 1299 | |
| 1300 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1301 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1302 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1303 | "$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] | 1304 | 0 \ |
| 1305 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1306 | -S "dumping 'expected mac' (10 bytes)" |
| 1307 | |
| 1308 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1309 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1310 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1311 | "$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] | 1312 | 0 \ |
| 1313 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1314 | -S "dumping 'expected mac' (10 bytes)" |
| 1315 | |
| 1316 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1317 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1318 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1319 | "$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] | 1320 | 0 \ |
| 1321 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1322 | -S "dumping 'expected mac' (10 bytes)" |
| 1323 | |
| 1324 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1325 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1326 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1327 | "$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] | 1328 | 0 \ |
| 1329 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1330 | -S "dumping 'expected mac' (10 bytes)" |
| 1331 | |
| 1332 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1333 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1334 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1335 | "$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] | 1336 | 0 \ |
| 1337 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1338 | -s "dumping 'expected mac' (10 bytes)" |
| 1339 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1340 | # Tests for Context serialization |
| 1341 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1342 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1343 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1344 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1345 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1346 | 0 \ |
| 1347 | -c "Deserializing connection..." \ |
| 1348 | -S "Deserializing connection..." |
| 1349 | |
| 1350 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1351 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1352 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1353 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1354 | 0 \ |
| 1355 | -c "Deserializing connection..." \ |
| 1356 | -S "Deserializing connection..." |
| 1357 | |
| 1358 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1359 | run_test "Context serialization, client serializes, GCM" \ |
| 1360 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1361 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1362 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1363 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1364 | -S "Deserializing connection..." |
| 1365 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1366 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1367 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1368 | run_test "Context serialization, client serializes, with CID" \ |
| 1369 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1370 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1371 | 0 \ |
| 1372 | -c "Deserializing connection..." \ |
| 1373 | -S "Deserializing connection..." |
| 1374 | |
| 1375 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1376 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1377 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1378 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1379 | 0 \ |
| 1380 | -C "Deserializing connection..." \ |
| 1381 | -s "Deserializing connection..." |
| 1382 | |
| 1383 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1384 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1385 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1386 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1387 | 0 \ |
| 1388 | -C "Deserializing connection..." \ |
| 1389 | -s "Deserializing connection..." |
| 1390 | |
| 1391 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1392 | run_test "Context serialization, server serializes, GCM" \ |
| 1393 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1394 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1395 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1396 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1397 | -s "Deserializing connection..." |
| 1398 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1399 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1400 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1401 | run_test "Context serialization, server serializes, with CID" \ |
| 1402 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1403 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1404 | 0 \ |
| 1405 | -C "Deserializing connection..." \ |
| 1406 | -s "Deserializing connection..." |
| 1407 | |
| 1408 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1409 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1410 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1411 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1412 | 0 \ |
| 1413 | -c "Deserializing connection..." \ |
| 1414 | -s "Deserializing connection..." |
| 1415 | |
| 1416 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1417 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1418 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1419 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1420 | 0 \ |
| 1421 | -c "Deserializing connection..." \ |
| 1422 | -s "Deserializing connection..." |
| 1423 | |
| 1424 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1425 | run_test "Context serialization, both serialize, GCM" \ |
| 1426 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1427 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1428 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1429 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1430 | -s "Deserializing connection..." |
| 1431 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1432 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1433 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1434 | run_test "Context serialization, both serialize, with CID" \ |
| 1435 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1436 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1437 | 0 \ |
| 1438 | -c "Deserializing connection..." \ |
| 1439 | -s "Deserializing connection..." |
| 1440 | |
| 1441 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1442 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1443 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1444 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1445 | 0 \ |
| 1446 | -c "Deserializing connection..." \ |
| 1447 | -S "Deserializing connection..." |
| 1448 | |
| 1449 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1450 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1451 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1452 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1453 | 0 \ |
| 1454 | -c "Deserializing connection..." \ |
| 1455 | -S "Deserializing connection..." |
| 1456 | |
| 1457 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1458 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1459 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1460 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1461 | 0 \ |
| 1462 | -c "Deserializing connection..." \ |
| 1463 | -S "Deserializing connection..." |
| 1464 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1465 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1466 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1467 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1468 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1469 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1470 | 0 \ |
| 1471 | -c "Deserializing connection..." \ |
| 1472 | -S "Deserializing connection..." |
| 1473 | |
| 1474 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1475 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1476 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1477 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1478 | 0 \ |
| 1479 | -C "Deserializing connection..." \ |
| 1480 | -s "Deserializing connection..." |
| 1481 | |
| 1482 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1483 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1484 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1485 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1486 | 0 \ |
| 1487 | -C "Deserializing connection..." \ |
| 1488 | -s "Deserializing connection..." |
| 1489 | |
| 1490 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1491 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1492 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1493 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1494 | 0 \ |
| 1495 | -C "Deserializing connection..." \ |
| 1496 | -s "Deserializing connection..." |
| 1497 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1498 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1499 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1500 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1501 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1502 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1503 | 0 \ |
| 1504 | -C "Deserializing connection..." \ |
| 1505 | -s "Deserializing connection..." |
| 1506 | |
| 1507 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1508 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1509 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1510 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1511 | 0 \ |
| 1512 | -c "Deserializing connection..." \ |
| 1513 | -s "Deserializing connection..." |
| 1514 | |
| 1515 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1516 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1517 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1518 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1519 | 0 \ |
| 1520 | -c "Deserializing connection..." \ |
| 1521 | -s "Deserializing connection..." |
| 1522 | |
| 1523 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1524 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1525 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1526 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1527 | 0 \ |
| 1528 | -c "Deserializing connection..." \ |
| 1529 | -s "Deserializing connection..." |
| 1530 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1531 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1532 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1533 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1534 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1535 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1536 | 0 \ |
| 1537 | -c "Deserializing connection..." \ |
| 1538 | -s "Deserializing connection..." |
| 1539 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1540 | # Tests for DTLS Connection ID extension |
| 1541 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1542 | # So far, the CID API isn't implemented, so we can't |
| 1543 | # grep for output witnessing its use. This needs to be |
| 1544 | # changed once the CID extension is implemented. |
| 1545 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1546 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1547 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1548 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1549 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1550 | 0 \ |
| 1551 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1552 | -s "found CID extension" \ |
| 1553 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1554 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1555 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1556 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1557 | -C "found CID extension" \ |
| 1558 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1559 | -C "Copy CIDs into SSL transform" \ |
| 1560 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1561 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1562 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1563 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1564 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1565 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1566 | 0 \ |
| 1567 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1568 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1569 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1570 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1571 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1572 | -C "found CID extension" \ |
| 1573 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1574 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1575 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1576 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1577 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1578 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1579 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1580 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1581 | 0 \ |
| 1582 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1583 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1584 | -c "client hello, adding CID extension" \ |
| 1585 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1586 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1587 | -s "server hello, adding CID extension" \ |
| 1588 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1589 | -c "Use of CID extension negotiated" \ |
| 1590 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1591 | -c "Copy CIDs into SSL transform" \ |
| 1592 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1593 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1594 | -s "Use of Connection ID has been negotiated" \ |
| 1595 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1596 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1597 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1598 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1599 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1600 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1601 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1602 | 0 \ |
| 1603 | -c "Enable use of CID extension." \ |
| 1604 | -s "Enable use of CID extension." \ |
| 1605 | -c "client hello, adding CID extension" \ |
| 1606 | -s "found CID extension" \ |
| 1607 | -s "Use of CID extension negotiated" \ |
| 1608 | -s "server hello, adding CID extension" \ |
| 1609 | -c "found CID extension" \ |
| 1610 | -c "Use of CID extension negotiated" \ |
| 1611 | -s "Copy CIDs into SSL transform" \ |
| 1612 | -c "Copy CIDs into SSL transform" \ |
| 1613 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1614 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1615 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1616 | -c "Use of Connection ID has been negotiated" \ |
| 1617 | -c "ignoring unexpected CID" \ |
| 1618 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1619 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1620 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1621 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1622 | -p "$P_PXY mtu=800" \ |
| 1623 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1624 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1625 | 0 \ |
| 1626 | -c "Enable use of CID extension." \ |
| 1627 | -s "Enable use of CID extension." \ |
| 1628 | -c "client hello, adding CID extension" \ |
| 1629 | -s "found CID extension" \ |
| 1630 | -s "Use of CID extension negotiated" \ |
| 1631 | -s "server hello, adding CID extension" \ |
| 1632 | -c "found CID extension" \ |
| 1633 | -c "Use of CID extension negotiated" \ |
| 1634 | -s "Copy CIDs into SSL transform" \ |
| 1635 | -c "Copy CIDs into SSL transform" \ |
| 1636 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1637 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1638 | -s "Use of Connection ID has been negotiated" \ |
| 1639 | -c "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 | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1642 | 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] | 1643 | -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] | 1644 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1645 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1646 | 0 \ |
| 1647 | -c "Enable use of CID extension." \ |
| 1648 | -s "Enable use of CID extension." \ |
| 1649 | -c "client hello, adding CID extension" \ |
| 1650 | -s "found CID extension" \ |
| 1651 | -s "Use of CID extension negotiated" \ |
| 1652 | -s "server hello, adding CID extension" \ |
| 1653 | -c "found CID extension" \ |
| 1654 | -c "Use of CID extension negotiated" \ |
| 1655 | -s "Copy CIDs into SSL transform" \ |
| 1656 | -c "Copy CIDs into SSL transform" \ |
| 1657 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1658 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1659 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1660 | -c "Use of Connection ID has been negotiated" \ |
| 1661 | -c "ignoring unexpected CID" \ |
| 1662 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1663 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1665 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1666 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1667 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1668 | 0 \ |
| 1669 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1670 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1671 | -c "client hello, adding CID extension" \ |
| 1672 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1673 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1674 | -s "server hello, adding CID extension" \ |
| 1675 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1676 | -c "Use of CID extension negotiated" \ |
| 1677 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1678 | -c "Copy CIDs into SSL transform" \ |
| 1679 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1680 | -s "Peer CID (length 0 Bytes):" \ |
| 1681 | -s "Use of Connection ID has been negotiated" \ |
| 1682 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1683 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1684 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1685 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1686 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1687 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1688 | 0 \ |
| 1689 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1690 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1691 | -c "client hello, adding CID extension" \ |
| 1692 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1693 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1694 | -s "server hello, adding CID extension" \ |
| 1695 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1696 | -c "Use of CID extension negotiated" \ |
| 1697 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1698 | -c "Copy CIDs into SSL transform" \ |
| 1699 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1700 | -c "Peer CID (length 0 Bytes):" \ |
| 1701 | -s "Use of Connection ID has been negotiated" \ |
| 1702 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1703 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1704 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1705 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1706 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1707 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1708 | 0 \ |
| 1709 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1710 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1711 | -c "client hello, adding CID extension" \ |
| 1712 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1713 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1714 | -s "server hello, adding CID extension" \ |
| 1715 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1716 | -c "Use of CID extension negotiated" \ |
| 1717 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1718 | -c "Copy CIDs into SSL transform" \ |
| 1719 | -S "Use of Connection ID has been negotiated" \ |
| 1720 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +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 | 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] | 1724 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1725 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1726 | 0 \ |
| 1727 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1728 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1729 | -c "client hello, adding CID extension" \ |
| 1730 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1731 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1732 | -s "server hello, adding CID extension" \ |
| 1733 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1734 | -c "Use of CID extension negotiated" \ |
| 1735 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1736 | -c "Copy CIDs into SSL transform" \ |
| 1737 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1738 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1739 | -s "Use of Connection ID has been negotiated" \ |
| 1740 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1741 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1742 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1743 | 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] | 1744 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1745 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1746 | 0 \ |
| 1747 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1748 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1749 | -c "client hello, adding CID extension" \ |
| 1750 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1751 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1752 | -s "server hello, adding CID extension" \ |
| 1753 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1754 | -c "Use of CID extension negotiated" \ |
| 1755 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1756 | -c "Copy CIDs into SSL transform" \ |
| 1757 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1758 | -s "Peer CID (length 0 Bytes):" \ |
| 1759 | -s "Use of Connection ID has been negotiated" \ |
| 1760 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1761 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1762 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1763 | 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] | 1764 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1765 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1766 | 0 \ |
| 1767 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1768 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1769 | -c "client hello, adding CID extension" \ |
| 1770 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1771 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1772 | -s "server hello, adding CID extension" \ |
| 1773 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1774 | -c "Use of CID extension negotiated" \ |
| 1775 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1776 | -c "Copy CIDs into SSL transform" \ |
| 1777 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1778 | -c "Peer CID (length 0 Bytes):" \ |
| 1779 | -s "Use of Connection ID has been negotiated" \ |
| 1780 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1781 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1782 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1783 | 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] | 1784 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1785 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1786 | 0 \ |
| 1787 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1788 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1789 | -c "client hello, adding CID extension" \ |
| 1790 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1791 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1792 | -s "server hello, adding CID extension" \ |
| 1793 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1794 | -c "Use of CID extension negotiated" \ |
| 1795 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1796 | -c "Copy CIDs into SSL transform" \ |
| 1797 | -S "Use of Connection ID has been negotiated" \ |
| 1798 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1799 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1801 | 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] | 1802 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1803 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1804 | 0 \ |
| 1805 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1806 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1807 | -c "client hello, adding CID extension" \ |
| 1808 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1809 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1810 | -s "server hello, adding CID extension" \ |
| 1811 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1812 | -c "Use of CID extension negotiated" \ |
| 1813 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1814 | -c "Copy CIDs into SSL transform" \ |
| 1815 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1816 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1817 | -s "Use of Connection ID has been negotiated" \ |
| 1818 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1819 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1820 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1821 | 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] | 1822 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1823 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1824 | 0 \ |
| 1825 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1826 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1827 | -c "client hello, adding CID extension" \ |
| 1828 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1829 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1830 | -s "server hello, adding CID extension" \ |
| 1831 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1832 | -c "Use of CID extension negotiated" \ |
| 1833 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1834 | -c "Copy CIDs into SSL transform" \ |
| 1835 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1836 | -s "Peer CID (length 0 Bytes):" \ |
| 1837 | -s "Use of Connection ID has been negotiated" \ |
| 1838 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1839 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1840 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1841 | 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] | 1842 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1843 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1844 | 0 \ |
| 1845 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1846 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1847 | -c "client hello, adding CID extension" \ |
| 1848 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1849 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1850 | -s "server hello, adding CID extension" \ |
| 1851 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1852 | -c "Use of CID extension negotiated" \ |
| 1853 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1854 | -c "Copy CIDs into SSL transform" \ |
| 1855 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1856 | -c "Peer CID (length 0 Bytes):" \ |
| 1857 | -s "Use of Connection ID has been negotiated" \ |
| 1858 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1859 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1860 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1861 | 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] | 1862 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1863 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1864 | 0 \ |
| 1865 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1866 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1867 | -c "client hello, adding CID extension" \ |
| 1868 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1869 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1870 | -s "server hello, adding CID extension" \ |
| 1871 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1872 | -c "Use of CID extension negotiated" \ |
| 1873 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1874 | -c "Copy CIDs into SSL transform" \ |
| 1875 | -S "Use of Connection ID has been negotiated" \ |
| 1876 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1877 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1878 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1880 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1881 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1882 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1883 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1884 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1885 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1886 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1887 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1888 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1889 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1890 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1891 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1892 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1893 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1894 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1895 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1896 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1897 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1898 | 0 \ |
| 1899 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1900 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1901 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1902 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1903 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1904 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1905 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1906 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1907 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1908 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1909 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1910 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 1911 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1912 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1913 | 0 \ |
| 1914 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1915 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1916 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1917 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1918 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1919 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1920 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1921 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1922 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1923 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1924 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1925 | 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] | 1926 | -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] | 1927 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1928 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1929 | 0 \ |
| 1930 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1931 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1932 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1933 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1934 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1935 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1936 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1937 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1938 | -c "ignoring unexpected CID" \ |
| 1939 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1940 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1941 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1942 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1943 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1944 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1945 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1946 | 0 \ |
| 1947 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1948 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1949 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1950 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1951 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1952 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1953 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1954 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1955 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1958 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 1959 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1960 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1961 | 0 \ |
| 1962 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1963 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1964 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1965 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1966 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1967 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1968 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1969 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1970 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1971 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1972 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1973 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1974 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1975 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1976 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1977 | 0 \ |
| 1978 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1979 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1980 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1981 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1982 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1983 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1984 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1985 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1986 | -c "ignoring unexpected CID" \ |
| 1987 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1988 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1991 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1992 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1993 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1994 | 0 \ |
| 1995 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1996 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1997 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1998 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1999 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2000 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2001 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2002 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2004 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2005 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2006 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2007 | 0 \ |
| 2008 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2009 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2010 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2011 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2012 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2013 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2014 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2017 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2018 | -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] | 2019 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2020 | "$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" \ |
| 2021 | 0 \ |
| 2022 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2023 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2024 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2025 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2026 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2027 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2028 | -c "ignoring unexpected CID" \ |
| 2029 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2030 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2033 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2034 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2035 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2036 | 0 \ |
| 2037 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2038 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2039 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2040 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2041 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2042 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2043 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2044 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2045 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2046 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2050 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2051 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2052 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2053 | 0 \ |
| 2054 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2055 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2056 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2057 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2058 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2059 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2060 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2061 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2062 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2063 | -c "ignoring unexpected CID" \ |
| 2064 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2065 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2066 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2068 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2069 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2070 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2071 | 0 \ |
| 2072 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2073 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2074 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2075 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2076 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2077 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2078 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2079 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2080 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2081 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2084 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2085 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2086 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2087 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2088 | 0 \ |
| 2089 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2090 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2091 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2092 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2093 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2094 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2095 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2096 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2097 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2098 | -c "ignoring unexpected CID" \ |
| 2099 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2100 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2101 | # Tests for Encrypt-then-MAC extension |
| 2102 | |
| 2103 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2104 | "$P_SRV debug_level=3 \ |
| 2105 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2106 | "$P_CLI debug_level=3" \ |
| 2107 | 0 \ |
| 2108 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2109 | -s "found encrypt then mac extension" \ |
| 2110 | -s "server hello, adding encrypt then mac extension" \ |
| 2111 | -c "found encrypt_then_mac extension" \ |
| 2112 | -c "using encrypt then mac" \ |
| 2113 | -s "using encrypt then mac" |
| 2114 | |
| 2115 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2116 | "$P_SRV debug_level=3 etm=0 \ |
| 2117 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2118 | "$P_CLI debug_level=3 etm=1" \ |
| 2119 | 0 \ |
| 2120 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2121 | -s "found encrypt then mac extension" \ |
| 2122 | -S "server hello, adding encrypt then mac extension" \ |
| 2123 | -C "found encrypt_then_mac extension" \ |
| 2124 | -C "using encrypt then mac" \ |
| 2125 | -S "using encrypt then mac" |
| 2126 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2127 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2128 | "$P_SRV debug_level=3 etm=1 \ |
| 2129 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2130 | "$P_CLI debug_level=3 etm=1" \ |
| 2131 | 0 \ |
| 2132 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2133 | -s "found encrypt then mac extension" \ |
| 2134 | -S "server hello, adding encrypt then mac extension" \ |
| 2135 | -C "found encrypt_then_mac extension" \ |
| 2136 | -C "using encrypt then mac" \ |
| 2137 | -S "using encrypt then mac" |
| 2138 | |
| 2139 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2140 | "$P_SRV debug_level=3 etm=1 \ |
| 2141 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2142 | "$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] | 2143 | 0 \ |
| 2144 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2145 | -s "found encrypt then mac extension" \ |
| 2146 | -S "server hello, adding encrypt then mac extension" \ |
| 2147 | -C "found encrypt_then_mac extension" \ |
| 2148 | -C "using encrypt then mac" \ |
| 2149 | -S "using encrypt then mac" |
| 2150 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2151 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2152 | "$P_SRV debug_level=3 etm=1 \ |
| 2153 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2154 | "$P_CLI debug_level=3 etm=0" \ |
| 2155 | 0 \ |
| 2156 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2157 | -S "found encrypt then mac extension" \ |
| 2158 | -S "server hello, adding encrypt then mac extension" \ |
| 2159 | -C "found encrypt_then_mac extension" \ |
| 2160 | -C "using encrypt then mac" \ |
| 2161 | -S "using encrypt then mac" |
| 2162 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2163 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2164 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2165 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2166 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2167 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2168 | 0 \ |
| 2169 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2170 | -S "found encrypt then mac extension" \ |
| 2171 | -S "server hello, adding encrypt then mac extension" \ |
| 2172 | -C "found encrypt_then_mac extension" \ |
| 2173 | -C "using encrypt then mac" \ |
| 2174 | -S "using encrypt then mac" |
| 2175 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2176 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2177 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2178 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2179 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2180 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2181 | 0 \ |
| 2182 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2183 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2184 | -S "server hello, adding encrypt then mac extension" \ |
| 2185 | -C "found encrypt_then_mac extension" \ |
| 2186 | -C "using encrypt then mac" \ |
| 2187 | -S "using encrypt then mac" |
| 2188 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2189 | # Tests for Extended Master Secret extension |
| 2190 | |
| 2191 | run_test "Extended Master Secret: default" \ |
| 2192 | "$P_SRV debug_level=3" \ |
| 2193 | "$P_CLI debug_level=3" \ |
| 2194 | 0 \ |
| 2195 | -c "client hello, adding extended_master_secret extension" \ |
| 2196 | -s "found extended master secret extension" \ |
| 2197 | -s "server hello, adding extended master secret extension" \ |
| 2198 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2199 | -c "session hash for extended master secret" \ |
| 2200 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2201 | |
| 2202 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2203 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2204 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2205 | 0 \ |
| 2206 | -c "client hello, adding extended_master_secret extension" \ |
| 2207 | -s "found extended master secret extension" \ |
| 2208 | -S "server hello, adding extended master secret extension" \ |
| 2209 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2210 | -C "session hash for extended master secret" \ |
| 2211 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2212 | |
| 2213 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2214 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2215 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2216 | 0 \ |
| 2217 | -C "client hello, adding extended_master_secret extension" \ |
| 2218 | -S "found extended master secret extension" \ |
| 2219 | -S "server hello, adding extended master secret extension" \ |
| 2220 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2221 | -C "session hash for extended master secret" \ |
| 2222 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2223 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2225 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2226 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2227 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2228 | 0 \ |
| 2229 | -C "client hello, adding extended_master_secret extension" \ |
| 2230 | -S "found extended master secret extension" \ |
| 2231 | -S "server hello, adding extended master secret extension" \ |
| 2232 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2233 | -C "session hash for extended master secret" \ |
| 2234 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2235 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2236 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2237 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2238 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2239 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2240 | 0 \ |
| 2241 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2242 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2243 | -S "server hello, adding extended master secret extension" \ |
| 2244 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2245 | -C "session hash for extended master secret" \ |
| 2246 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2247 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2248 | # Tests for FALLBACK_SCSV |
| 2249 | |
| 2250 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2251 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2252 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2253 | 0 \ |
| 2254 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2255 | -S "received FALLBACK_SCSV" \ |
| 2256 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2257 | -C "is a fatal alert message (msg 86)" |
| 2258 | |
| 2259 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2260 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2261 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2262 | 0 \ |
| 2263 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2264 | -S "received FALLBACK_SCSV" \ |
| 2265 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2266 | -C "is a fatal alert message (msg 86)" |
| 2267 | |
| 2268 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2269 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2270 | "$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] | 2271 | 1 \ |
| 2272 | -c "adding FALLBACK_SCSV" \ |
| 2273 | -s "received FALLBACK_SCSV" \ |
| 2274 | -s "inapropriate fallback" \ |
| 2275 | -c "is a fatal alert message (msg 86)" |
| 2276 | |
| 2277 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2278 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2279 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2280 | 0 \ |
| 2281 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2282 | -s "received FALLBACK_SCSV" \ |
| 2283 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2284 | -C "is a fatal alert message (msg 86)" |
| 2285 | |
| 2286 | requires_openssl_with_fallback_scsv |
| 2287 | run_test "Fallback SCSV: default, openssl server" \ |
| 2288 | "$O_SRV" \ |
| 2289 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2290 | 0 \ |
| 2291 | -C "adding FALLBACK_SCSV" \ |
| 2292 | -C "is a fatal alert message (msg 86)" |
| 2293 | |
| 2294 | requires_openssl_with_fallback_scsv |
| 2295 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2296 | "$O_SRV" \ |
| 2297 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2298 | 1 \ |
| 2299 | -c "adding FALLBACK_SCSV" \ |
| 2300 | -c "is a fatal alert message (msg 86)" |
| 2301 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2302 | requires_openssl_with_fallback_scsv |
| 2303 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2304 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2305 | "$O_CLI -tls1_1" \ |
| 2306 | 0 \ |
| 2307 | -S "received FALLBACK_SCSV" \ |
| 2308 | -S "inapropriate fallback" |
| 2309 | |
| 2310 | requires_openssl_with_fallback_scsv |
| 2311 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2312 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2313 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2314 | 1 \ |
| 2315 | -s "received FALLBACK_SCSV" \ |
| 2316 | -s "inapropriate fallback" |
| 2317 | |
| 2318 | requires_openssl_with_fallback_scsv |
| 2319 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2320 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2321 | "$O_CLI -fallback_scsv" \ |
| 2322 | 0 \ |
| 2323 | -s "received FALLBACK_SCSV" \ |
| 2324 | -S "inapropriate fallback" |
| 2325 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2326 | # Test sending and receiving empty application data records |
| 2327 | |
| 2328 | run_test "Encrypt then MAC: empty application data record" \ |
| 2329 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2330 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2331 | 0 \ |
| 2332 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2333 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2334 | -c "0 bytes written in 1 fragments" |
| 2335 | |
| 2336 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2337 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2338 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2339 | 0 \ |
| 2340 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2341 | -c "0 bytes written in 1 fragments" |
| 2342 | |
| 2343 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2344 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2345 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2346 | 0 \ |
| 2347 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2348 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2349 | -c "0 bytes written in 1 fragments" |
| 2350 | |
| 2351 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2352 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2353 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2354 | 0 \ |
| 2355 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2356 | -c "0 bytes written in 1 fragments" |
| 2357 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2358 | ## ClientHello generated with |
| 2359 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2360 | ## then manually twiddling the ciphersuite list. |
| 2361 | ## The ClientHello content is spelled out below as a hex string as |
| 2362 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2363 | ## The expected response is an inappropriate_fallback alert. |
| 2364 | requires_openssl_with_fallback_scsv |
| 2365 | run_test "Fallback SCSV: beginning of list" \ |
| 2366 | "$P_SRV debug_level=2" \ |
| 2367 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2368 | 0 \ |
| 2369 | -s "received FALLBACK_SCSV" \ |
| 2370 | -s "inapropriate fallback" |
| 2371 | |
| 2372 | requires_openssl_with_fallback_scsv |
| 2373 | run_test "Fallback SCSV: end of list" \ |
| 2374 | "$P_SRV debug_level=2" \ |
| 2375 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2376 | 0 \ |
| 2377 | -s "received FALLBACK_SCSV" \ |
| 2378 | -s "inapropriate fallback" |
| 2379 | |
| 2380 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2381 | requires_openssl_with_fallback_scsv |
| 2382 | run_test "Fallback SCSV: not in list" \ |
| 2383 | "$P_SRV debug_level=2" \ |
| 2384 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2385 | 0 \ |
| 2386 | -S "received FALLBACK_SCSV" \ |
| 2387 | -S "inapropriate fallback" |
| 2388 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2389 | # Tests for CBC 1/n-1 record splitting |
| 2390 | |
| 2391 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2392 | "$P_SRV" \ |
| 2393 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2394 | request_size=123 force_version=tls1_2" \ |
| 2395 | 0 \ |
| 2396 | -s "Read from client: 123 bytes read" \ |
| 2397 | -S "Read from client: 1 bytes read" \ |
| 2398 | -S "122 bytes read" |
| 2399 | |
| 2400 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2401 | "$P_SRV" \ |
| 2402 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2403 | request_size=123 force_version=tls1_1" \ |
| 2404 | 0 \ |
| 2405 | -s "Read from client: 123 bytes read" \ |
| 2406 | -S "Read from client: 1 bytes read" \ |
| 2407 | -S "122 bytes read" |
| 2408 | |
| 2409 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2410 | "$P_SRV" \ |
| 2411 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2412 | request_size=123 force_version=tls1" \ |
| 2413 | 0 \ |
| 2414 | -S "Read from client: 123 bytes read" \ |
| 2415 | -s "Read from client: 1 bytes read" \ |
| 2416 | -s "122 bytes read" |
| 2417 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2419 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2420 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2421 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2422 | request_size=123 force_version=ssl3" \ |
| 2423 | 0 \ |
| 2424 | -S "Read from client: 123 bytes read" \ |
| 2425 | -s "Read from client: 1 bytes read" \ |
| 2426 | -s "122 bytes read" |
| 2427 | |
| 2428 | 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] | 2429 | "$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] | 2430 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2431 | request_size=123 force_version=tls1" \ |
| 2432 | 0 \ |
| 2433 | -s "Read from client: 123 bytes read" \ |
| 2434 | -S "Read from client: 1 bytes read" \ |
| 2435 | -S "122 bytes read" |
| 2436 | |
| 2437 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2438 | "$P_SRV" \ |
| 2439 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2440 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2441 | 0 \ |
| 2442 | -s "Read from client: 123 bytes read" \ |
| 2443 | -S "Read from client: 1 bytes read" \ |
| 2444 | -S "122 bytes read" |
| 2445 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2446 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2447 | "$P_SRV nbio=2" \ |
| 2448 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2449 | request_size=123 force_version=tls1" \ |
| 2450 | 0 \ |
| 2451 | -S "Read from client: 123 bytes read" \ |
| 2452 | -s "Read from client: 1 bytes read" \ |
| 2453 | -s "122 bytes read" |
| 2454 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2455 | # Tests for Session Tickets |
| 2456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2457 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2458 | "$P_SRV debug_level=3 tickets=1" \ |
| 2459 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2460 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2461 | -c "client hello, adding session ticket extension" \ |
| 2462 | -s "found session ticket extension" \ |
| 2463 | -s "server hello, adding session ticket extension" \ |
| 2464 | -c "found session_ticket extension" \ |
| 2465 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2466 | -S "session successfully restored from cache" \ |
| 2467 | -s "session successfully restored from ticket" \ |
| 2468 | -s "a session has been resumed" \ |
| 2469 | -c "a session has been resumed" |
| 2470 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2471 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2472 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2473 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2474 | 0 \ |
| 2475 | -c "client hello, adding session ticket extension" \ |
| 2476 | -s "found session ticket extension" \ |
| 2477 | -s "server hello, adding session ticket extension" \ |
| 2478 | -c "found session_ticket extension" \ |
| 2479 | -c "parse new session ticket" \ |
| 2480 | -S "session successfully restored from cache" \ |
| 2481 | -s "session successfully restored from ticket" \ |
| 2482 | -s "a session has been resumed" \ |
| 2483 | -c "a session has been resumed" |
| 2484 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2485 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2486 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2487 | "$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] | 2488 | 0 \ |
| 2489 | -c "client hello, adding session ticket extension" \ |
| 2490 | -s "found session ticket extension" \ |
| 2491 | -s "server hello, adding session ticket extension" \ |
| 2492 | -c "found session_ticket extension" \ |
| 2493 | -c "parse new session ticket" \ |
| 2494 | -S "session successfully restored from cache" \ |
| 2495 | -S "session successfully restored from ticket" \ |
| 2496 | -S "a session has been resumed" \ |
| 2497 | -C "a session has been resumed" |
| 2498 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2499 | run_test "Session resume using tickets: session copy" \ |
| 2500 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2501 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2502 | 0 \ |
| 2503 | -c "client hello, adding session ticket extension" \ |
| 2504 | -s "found session ticket extension" \ |
| 2505 | -s "server hello, adding session ticket extension" \ |
| 2506 | -c "found session_ticket extension" \ |
| 2507 | -c "parse new session ticket" \ |
| 2508 | -S "session successfully restored from cache" \ |
| 2509 | -s "session successfully restored from ticket" \ |
| 2510 | -s "a session has been resumed" \ |
| 2511 | -c "a session has been resumed" |
| 2512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2513 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2514 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2515 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2516 | 0 \ |
| 2517 | -c "client hello, adding session ticket extension" \ |
| 2518 | -c "found session_ticket extension" \ |
| 2519 | -c "parse new session ticket" \ |
| 2520 | -c "a session has been resumed" |
| 2521 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2522 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2523 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2524 | "( $O_CLI -sess_out $SESSION; \ |
| 2525 | $O_CLI -sess_in $SESSION; \ |
| 2526 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2527 | 0 \ |
| 2528 | -s "found session ticket extension" \ |
| 2529 | -s "server hello, adding session ticket extension" \ |
| 2530 | -S "session successfully restored from cache" \ |
| 2531 | -s "session successfully restored from ticket" \ |
| 2532 | -s "a session has been resumed" |
| 2533 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2534 | # Tests for Session Tickets with DTLS |
| 2535 | |
| 2536 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2537 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2538 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2539 | 0 \ |
| 2540 | -c "client hello, adding session ticket extension" \ |
| 2541 | -s "found session ticket extension" \ |
| 2542 | -s "server hello, adding session ticket extension" \ |
| 2543 | -c "found session_ticket extension" \ |
| 2544 | -c "parse new session ticket" \ |
| 2545 | -S "session successfully restored from cache" \ |
| 2546 | -s "session successfully restored from ticket" \ |
| 2547 | -s "a session has been resumed" \ |
| 2548 | -c "a session has been resumed" |
| 2549 | |
| 2550 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2551 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2552 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2553 | 0 \ |
| 2554 | -c "client hello, adding session ticket extension" \ |
| 2555 | -s "found session ticket extension" \ |
| 2556 | -s "server hello, adding session ticket extension" \ |
| 2557 | -c "found session_ticket extension" \ |
| 2558 | -c "parse new session ticket" \ |
| 2559 | -S "session successfully restored from cache" \ |
| 2560 | -s "session successfully restored from ticket" \ |
| 2561 | -s "a session has been resumed" \ |
| 2562 | -c "a session has been resumed" |
| 2563 | |
| 2564 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2565 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2566 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2567 | 0 \ |
| 2568 | -c "client hello, adding session ticket extension" \ |
| 2569 | -s "found session ticket extension" \ |
| 2570 | -s "server hello, adding session ticket extension" \ |
| 2571 | -c "found session_ticket extension" \ |
| 2572 | -c "parse new session ticket" \ |
| 2573 | -S "session successfully restored from cache" \ |
| 2574 | -S "session successfully restored from ticket" \ |
| 2575 | -S "a session has been resumed" \ |
| 2576 | -C "a session has been resumed" |
| 2577 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2578 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2579 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2580 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ |
| 2581 | 0 \ |
| 2582 | -c "client hello, adding session ticket extension" \ |
| 2583 | -s "found session ticket extension" \ |
| 2584 | -s "server hello, adding session ticket extension" \ |
| 2585 | -c "found session_ticket extension" \ |
| 2586 | -c "parse new session ticket" \ |
| 2587 | -S "session successfully restored from cache" \ |
| 2588 | -s "session successfully restored from ticket" \ |
| 2589 | -s "a session has been resumed" \ |
| 2590 | -c "a session has been resumed" |
| 2591 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2592 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2593 | "$O_SRV -dtls1" \ |
| 2594 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2595 | 0 \ |
| 2596 | -c "client hello, adding session ticket extension" \ |
| 2597 | -c "found session_ticket extension" \ |
| 2598 | -c "parse new session ticket" \ |
| 2599 | -c "a session has been resumed" |
| 2600 | |
| 2601 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2602 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2603 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2604 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2605 | rm -f $SESSION )" \ |
| 2606 | 0 \ |
| 2607 | -s "found session ticket extension" \ |
| 2608 | -s "server hello, adding session ticket extension" \ |
| 2609 | -S "session successfully restored from cache" \ |
| 2610 | -s "session successfully restored from ticket" \ |
| 2611 | -s "a session has been resumed" |
| 2612 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2613 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2614 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2615 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2616 | "$P_SRV debug_level=3 tickets=0" \ |
| 2617 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2618 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2619 | -c "client hello, adding session ticket extension" \ |
| 2620 | -s "found session ticket extension" \ |
| 2621 | -S "server hello, adding session ticket extension" \ |
| 2622 | -C "found session_ticket extension" \ |
| 2623 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2624 | -s "session successfully restored from cache" \ |
| 2625 | -S "session successfully restored from ticket" \ |
| 2626 | -s "a session has been resumed" \ |
| 2627 | -c "a session has been resumed" |
| 2628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2629 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2630 | "$P_SRV debug_level=3 tickets=1" \ |
| 2631 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2632 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2633 | -C "client hello, adding session ticket extension" \ |
| 2634 | -S "found session ticket extension" \ |
| 2635 | -S "server hello, adding session ticket extension" \ |
| 2636 | -C "found session_ticket extension" \ |
| 2637 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2638 | -s "session successfully restored from cache" \ |
| 2639 | -S "session successfully restored from ticket" \ |
| 2640 | -s "a session has been resumed" \ |
| 2641 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2642 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2643 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2644 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2645 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2646 | 0 \ |
| 2647 | -S "session successfully restored from cache" \ |
| 2648 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2649 | -S "a session has been resumed" \ |
| 2650 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2652 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2653 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2654 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2655 | 0 \ |
| 2656 | -s "session successfully restored from cache" \ |
| 2657 | -S "session successfully restored from ticket" \ |
| 2658 | -s "a session has been resumed" \ |
| 2659 | -c "a session has been resumed" |
| 2660 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2661 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2662 | "$P_SRV debug_level=3 tickets=0" \ |
| 2663 | "$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] | 2664 | 0 \ |
| 2665 | -s "session successfully restored from cache" \ |
| 2666 | -S "session successfully restored from ticket" \ |
| 2667 | -s "a session has been resumed" \ |
| 2668 | -c "a session has been resumed" |
| 2669 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2670 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2671 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2672 | "$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] | 2673 | 0 \ |
| 2674 | -S "session successfully restored from cache" \ |
| 2675 | -S "session successfully restored from ticket" \ |
| 2676 | -S "a session has been resumed" \ |
| 2677 | -C "a session has been resumed" |
| 2678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2679 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2680 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2681 | "$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] | 2682 | 0 \ |
| 2683 | -s "session successfully restored from cache" \ |
| 2684 | -S "session successfully restored from ticket" \ |
| 2685 | -s "a session has been resumed" \ |
| 2686 | -c "a session has been resumed" |
| 2687 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2688 | run_test "Session resume using cache: session copy" \ |
| 2689 | "$P_SRV debug_level=3 tickets=0" \ |
| 2690 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2691 | 0 \ |
| 2692 | -s "session successfully restored from cache" \ |
| 2693 | -S "session successfully restored from ticket" \ |
| 2694 | -s "a session has been resumed" \ |
| 2695 | -c "a session has been resumed" |
| 2696 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2697 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2698 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2699 | "( $O_CLI -sess_out $SESSION; \ |
| 2700 | $O_CLI -sess_in $SESSION; \ |
| 2701 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2702 | 0 \ |
| 2703 | -s "found session ticket extension" \ |
| 2704 | -S "server hello, adding session ticket extension" \ |
| 2705 | -s "session successfully restored from cache" \ |
| 2706 | -S "session successfully restored from ticket" \ |
| 2707 | -s "a session has been resumed" |
| 2708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2709 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2710 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2711 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2712 | 0 \ |
| 2713 | -C "found session_ticket extension" \ |
| 2714 | -C "parse new session ticket" \ |
| 2715 | -c "a session has been resumed" |
| 2716 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2717 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2718 | |
| 2719 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2720 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2721 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2722 | 0 \ |
| 2723 | -c "client hello, adding session ticket extension" \ |
| 2724 | -s "found session ticket extension" \ |
| 2725 | -S "server hello, adding session ticket extension" \ |
| 2726 | -C "found session_ticket extension" \ |
| 2727 | -C "parse new session ticket" \ |
| 2728 | -s "session successfully restored from cache" \ |
| 2729 | -S "session successfully restored from ticket" \ |
| 2730 | -s "a session has been resumed" \ |
| 2731 | -c "a session has been resumed" |
| 2732 | |
| 2733 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2734 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2735 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2736 | 0 \ |
| 2737 | -C "client hello, adding session ticket extension" \ |
| 2738 | -S "found session ticket extension" \ |
| 2739 | -S "server hello, adding session ticket extension" \ |
| 2740 | -C "found session_ticket extension" \ |
| 2741 | -C "parse new session ticket" \ |
| 2742 | -s "session successfully restored from cache" \ |
| 2743 | -S "session successfully restored from ticket" \ |
| 2744 | -s "a session has been resumed" \ |
| 2745 | -c "a session has been resumed" |
| 2746 | |
| 2747 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2748 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2749 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2750 | 0 \ |
| 2751 | -S "session successfully restored from cache" \ |
| 2752 | -S "session successfully restored from ticket" \ |
| 2753 | -S "a session has been resumed" \ |
| 2754 | -C "a session has been resumed" |
| 2755 | |
| 2756 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2757 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2758 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2759 | 0 \ |
| 2760 | -s "session successfully restored from cache" \ |
| 2761 | -S "session successfully restored from ticket" \ |
| 2762 | -s "a session has been resumed" \ |
| 2763 | -c "a session has been resumed" |
| 2764 | |
| 2765 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2766 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2767 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2768 | 0 \ |
| 2769 | -s "session successfully restored from cache" \ |
| 2770 | -S "session successfully restored from ticket" \ |
| 2771 | -s "a session has been resumed" \ |
| 2772 | -c "a session has been resumed" |
| 2773 | |
| 2774 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2775 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2776 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2777 | 0 \ |
| 2778 | -S "session successfully restored from cache" \ |
| 2779 | -S "session successfully restored from ticket" \ |
| 2780 | -S "a session has been resumed" \ |
| 2781 | -C "a session has been resumed" |
| 2782 | |
| 2783 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2784 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2785 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2786 | 0 \ |
| 2787 | -s "session successfully restored from cache" \ |
| 2788 | -S "session successfully restored from ticket" \ |
| 2789 | -s "a session has been resumed" \ |
| 2790 | -c "a session has been resumed" |
| 2791 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2792 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2793 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2794 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2795 | 0 \ |
| 2796 | -s "session successfully restored from cache" \ |
| 2797 | -S "session successfully restored from ticket" \ |
| 2798 | -s "a session has been resumed" \ |
| 2799 | -c "a session has been resumed" |
| 2800 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2801 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2802 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2803 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2804 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2805 | rm -f $SESSION )" \ |
| 2806 | 0 \ |
| 2807 | -s "found session ticket extension" \ |
| 2808 | -S "server hello, adding session ticket extension" \ |
| 2809 | -s "session successfully restored from cache" \ |
| 2810 | -S "session successfully restored from ticket" \ |
| 2811 | -s "a session has been resumed" |
| 2812 | |
| 2813 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2814 | "$O_SRV -dtls1" \ |
| 2815 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2816 | 0 \ |
| 2817 | -C "found session_ticket extension" \ |
| 2818 | -C "parse new session ticket" \ |
| 2819 | -c "a session has been resumed" |
| 2820 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2821 | # Tests for Max Fragment Length extension |
| 2822 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2823 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2824 | 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] | 2825 | exit 1 |
| 2826 | fi |
| 2827 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2828 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2829 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2830 | fi |
| 2831 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2832 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2833 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2834 | "$P_SRV debug_level=3" \ |
| 2835 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2836 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2837 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2838 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2839 | -C "client hello, adding max_fragment_length extension" \ |
| 2840 | -S "found max fragment length extension" \ |
| 2841 | -S "server hello, max_fragment_length extension" \ |
| 2842 | -C "found max_fragment_length extension" |
| 2843 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2844 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2845 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2846 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2847 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2848 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2849 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2850 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2851 | -C "client hello, adding max_fragment_length extension" \ |
| 2852 | -S "found max fragment length extension" \ |
| 2853 | -S "server hello, max_fragment_length extension" \ |
| 2854 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2855 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2856 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2857 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2858 | |
| 2859 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2860 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2861 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2862 | "$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] | 2863 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2864 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2865 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2866 | -C "client hello, adding max_fragment_length extension" \ |
| 2867 | -S "found max fragment length extension" \ |
| 2868 | -S "server hello, max_fragment_length extension" \ |
| 2869 | -C "found max_fragment_length extension" \ |
| 2870 | -c "fragment larger than.*maximum " |
| 2871 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2872 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2873 | # (session fragment length will be 16384 regardless of mbedtls |
| 2874 | # content length configuration.) |
| 2875 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2876 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2877 | run_test "Max fragment length: disabled, larger message" \ |
| 2878 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2879 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2880 | 0 \ |
| 2881 | -C "Maximum fragment length is 16384" \ |
| 2882 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2883 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2884 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2885 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2886 | |
| 2887 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2888 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2889 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2890 | "$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] | 2891 | 1 \ |
| 2892 | -C "Maximum fragment length is 16384" \ |
| 2893 | -S "Maximum fragment length is 16384" \ |
| 2894 | -c "fragment larger than.*maximum " |
| 2895 | |
| 2896 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2897 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2898 | "$P_SRV debug_level=3" \ |
| 2899 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2900 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2901 | -c "Maximum fragment length is 4096" \ |
| 2902 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2903 | -c "client hello, adding max_fragment_length extension" \ |
| 2904 | -s "found max fragment length extension" \ |
| 2905 | -s "server hello, max_fragment_length extension" \ |
| 2906 | -c "found max_fragment_length extension" |
| 2907 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2908 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2909 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2910 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2911 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2912 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2913 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2914 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2915 | -C "client hello, adding max_fragment_length extension" \ |
| 2916 | -S "found max fragment length extension" \ |
| 2917 | -S "server hello, max_fragment_length extension" \ |
| 2918 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2919 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2920 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2921 | requires_gnutls |
| 2922 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2923 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2924 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2925 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2926 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2927 | -c "client hello, adding max_fragment_length extension" \ |
| 2928 | -c "found max_fragment_length extension" |
| 2929 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2930 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2931 | run_test "Max fragment length: client, message just fits" \ |
| 2932 | "$P_SRV debug_level=3" \ |
| 2933 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2934 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2935 | -c "Maximum fragment length is 2048" \ |
| 2936 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2937 | -c "client hello, adding max_fragment_length extension" \ |
| 2938 | -s "found max fragment length extension" \ |
| 2939 | -s "server hello, max_fragment_length extension" \ |
| 2940 | -c "found max_fragment_length extension" \ |
| 2941 | -c "2048 bytes written in 1 fragments" \ |
| 2942 | -s "2048 bytes read" |
| 2943 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2944 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2945 | run_test "Max fragment length: client, larger message" \ |
| 2946 | "$P_SRV debug_level=3" \ |
| 2947 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2948 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2949 | -c "Maximum fragment length is 2048" \ |
| 2950 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2951 | -c "client hello, adding max_fragment_length extension" \ |
| 2952 | -s "found max fragment length extension" \ |
| 2953 | -s "server hello, max_fragment_length extension" \ |
| 2954 | -c "found max_fragment_length extension" \ |
| 2955 | -c "2345 bytes written in 2 fragments" \ |
| 2956 | -s "2048 bytes read" \ |
| 2957 | -s "297 bytes read" |
| 2958 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2959 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2960 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2961 | "$P_SRV debug_level=3 dtls=1" \ |
| 2962 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2963 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2964 | -c "Maximum fragment length is 2048" \ |
| 2965 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2966 | -c "client hello, adding max_fragment_length extension" \ |
| 2967 | -s "found max fragment length extension" \ |
| 2968 | -s "server hello, max_fragment_length extension" \ |
| 2969 | -c "found max_fragment_length extension" \ |
| 2970 | -c "fragment larger than.*maximum" |
| 2971 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2972 | # Tests for renegotiation |
| 2973 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2974 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2975 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2976 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2977 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2978 | 0 \ |
| 2979 | -C "client hello, adding renegotiation extension" \ |
| 2980 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2981 | -S "found renegotiation extension" \ |
| 2982 | -s "server hello, secure renegotiation extension" \ |
| 2983 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2984 | -C "=> renegotiate" \ |
| 2985 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2986 | -S "write hello request" |
| 2987 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2989 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2990 | "$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] | 2991 | "$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] | 2992 | 0 \ |
| 2993 | -c "client hello, adding renegotiation extension" \ |
| 2994 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2995 | -s "found renegotiation extension" \ |
| 2996 | -s "server hello, secure renegotiation extension" \ |
| 2997 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2998 | -c "=> renegotiate" \ |
| 2999 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3000 | -S "write hello request" |
| 3001 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3002 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3003 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3004 | "$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] | 3005 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3006 | 0 \ |
| 3007 | -c "client hello, adding renegotiation extension" \ |
| 3008 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3009 | -s "found renegotiation extension" \ |
| 3010 | -s "server hello, secure renegotiation extension" \ |
| 3011 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3012 | -c "=> renegotiate" \ |
| 3013 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3014 | -s "write hello request" |
| 3015 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3016 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3017 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3018 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3020 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3021 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3022 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3023 | 0 \ |
| 3024 | -c "client hello, adding renegotiation extension" \ |
| 3025 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3026 | -s "found renegotiation extension" \ |
| 3027 | -s "server hello, secure renegotiation extension" \ |
| 3028 | -c "found renegotiation extension" \ |
| 3029 | -c "=> renegotiate" \ |
| 3030 | -s "=> renegotiate" \ |
| 3031 | -S "write hello request" \ |
| 3032 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3033 | |
| 3034 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3035 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3036 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3037 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3038 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3039 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3040 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3041 | 0 \ |
| 3042 | -c "client hello, adding renegotiation extension" \ |
| 3043 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3044 | -s "found renegotiation extension" \ |
| 3045 | -s "server hello, secure renegotiation extension" \ |
| 3046 | -c "found renegotiation extension" \ |
| 3047 | -c "=> renegotiate" \ |
| 3048 | -s "=> renegotiate" \ |
| 3049 | -s "write hello request" \ |
| 3050 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3051 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3052 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3053 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3054 | "$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] | 3055 | "$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] | 3056 | 0 \ |
| 3057 | -c "client hello, adding renegotiation extension" \ |
| 3058 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3059 | -s "found renegotiation extension" \ |
| 3060 | -s "server hello, secure renegotiation extension" \ |
| 3061 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3062 | -c "=> renegotiate" \ |
| 3063 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3064 | -s "write hello request" |
| 3065 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3066 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3067 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3068 | "$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] | 3069 | "$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] | 3070 | 1 \ |
| 3071 | -c "client hello, adding renegotiation extension" \ |
| 3072 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3073 | -S "found renegotiation extension" \ |
| 3074 | -s "server hello, secure renegotiation extension" \ |
| 3075 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3076 | -c "=> renegotiate" \ |
| 3077 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3078 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3079 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3080 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3081 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3082 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3083 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3084 | "$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] | 3085 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3086 | 0 \ |
| 3087 | -C "client hello, adding renegotiation extension" \ |
| 3088 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3089 | -S "found renegotiation extension" \ |
| 3090 | -s "server hello, secure renegotiation extension" \ |
| 3091 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3092 | -C "=> renegotiate" \ |
| 3093 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3094 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3095 | -S "SSL - An unexpected message was received from our peer" \ |
| 3096 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3097 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3099 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3100 | "$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] | 3101 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3102 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3103 | 0 \ |
| 3104 | -C "client hello, adding renegotiation extension" \ |
| 3105 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3106 | -S "found renegotiation extension" \ |
| 3107 | -s "server hello, secure renegotiation extension" \ |
| 3108 | -c "found renegotiation extension" \ |
| 3109 | -C "=> renegotiate" \ |
| 3110 | -S "=> renegotiate" \ |
| 3111 | -s "write hello request" \ |
| 3112 | -S "SSL - An unexpected message was received from our peer" \ |
| 3113 | -S "failed" |
| 3114 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3115 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3116 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3117 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3118 | "$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] | 3119 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3120 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3121 | 0 \ |
| 3122 | -C "client hello, adding renegotiation extension" \ |
| 3123 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3124 | -S "found renegotiation extension" \ |
| 3125 | -s "server hello, secure renegotiation extension" \ |
| 3126 | -c "found renegotiation extension" \ |
| 3127 | -C "=> renegotiate" \ |
| 3128 | -S "=> renegotiate" \ |
| 3129 | -s "write hello request" \ |
| 3130 | -S "SSL - An unexpected message was received from our peer" \ |
| 3131 | -S "failed" |
| 3132 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3135 | "$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] | 3136 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3137 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3138 | 0 \ |
| 3139 | -C "client hello, adding renegotiation extension" \ |
| 3140 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3141 | -S "found renegotiation extension" \ |
| 3142 | -s "server hello, secure renegotiation extension" \ |
| 3143 | -c "found renegotiation extension" \ |
| 3144 | -C "=> renegotiate" \ |
| 3145 | -S "=> renegotiate" \ |
| 3146 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3147 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3148 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3149 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3150 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3151 | "$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] | 3152 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3153 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3154 | 0 \ |
| 3155 | -c "client hello, adding renegotiation extension" \ |
| 3156 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3157 | -s "found renegotiation extension" \ |
| 3158 | -s "server hello, secure renegotiation extension" \ |
| 3159 | -c "found renegotiation extension" \ |
| 3160 | -c "=> renegotiate" \ |
| 3161 | -s "=> renegotiate" \ |
| 3162 | -s "write hello request" \ |
| 3163 | -S "SSL - An unexpected message was received from our peer" \ |
| 3164 | -S "failed" |
| 3165 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3166 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3167 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3168 | "$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] | 3169 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3170 | 0 \ |
| 3171 | -C "client hello, adding renegotiation extension" \ |
| 3172 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3173 | -S "found renegotiation extension" \ |
| 3174 | -s "server hello, secure renegotiation extension" \ |
| 3175 | -c "found renegotiation extension" \ |
| 3176 | -S "record counter limit reached: renegotiate" \ |
| 3177 | -C "=> renegotiate" \ |
| 3178 | -S "=> renegotiate" \ |
| 3179 | -S "write hello request" \ |
| 3180 | -S "SSL - An unexpected message was received from our peer" \ |
| 3181 | -S "failed" |
| 3182 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3183 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3185 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3186 | "$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] | 3187 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3188 | 0 \ |
| 3189 | -c "client hello, adding renegotiation extension" \ |
| 3190 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3191 | -s "found renegotiation extension" \ |
| 3192 | -s "server hello, secure renegotiation extension" \ |
| 3193 | -c "found renegotiation extension" \ |
| 3194 | -s "record counter limit reached: renegotiate" \ |
| 3195 | -c "=> renegotiate" \ |
| 3196 | -s "=> renegotiate" \ |
| 3197 | -s "write hello request" \ |
| 3198 | -S "SSL - An unexpected message was received from our peer" \ |
| 3199 | -S "failed" |
| 3200 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3201 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3202 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3203 | "$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] | 3204 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3205 | 0 \ |
| 3206 | -c "client hello, adding renegotiation extension" \ |
| 3207 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3208 | -s "found renegotiation extension" \ |
| 3209 | -s "server hello, secure renegotiation extension" \ |
| 3210 | -c "found renegotiation extension" \ |
| 3211 | -s "record counter limit reached: renegotiate" \ |
| 3212 | -c "=> renegotiate" \ |
| 3213 | -s "=> renegotiate" \ |
| 3214 | -s "write hello request" \ |
| 3215 | -S "SSL - An unexpected message was received from our peer" \ |
| 3216 | -S "failed" |
| 3217 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3219 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3220 | "$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] | 3221 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3222 | 0 \ |
| 3223 | -C "client hello, adding renegotiation extension" \ |
| 3224 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3225 | -S "found renegotiation extension" \ |
| 3226 | -s "server hello, secure renegotiation extension" \ |
| 3227 | -c "found renegotiation extension" \ |
| 3228 | -S "record counter limit reached: renegotiate" \ |
| 3229 | -C "=> renegotiate" \ |
| 3230 | -S "=> renegotiate" \ |
| 3231 | -S "write hello request" \ |
| 3232 | -S "SSL - An unexpected message was received from our peer" \ |
| 3233 | -S "failed" |
| 3234 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3235 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3236 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3237 | "$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] | 3238 | "$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] | 3239 | 0 \ |
| 3240 | -c "client hello, adding renegotiation extension" \ |
| 3241 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3242 | -s "found renegotiation extension" \ |
| 3243 | -s "server hello, secure renegotiation extension" \ |
| 3244 | -c "found renegotiation extension" \ |
| 3245 | -c "=> renegotiate" \ |
| 3246 | -s "=> renegotiate" \ |
| 3247 | -S "write hello request" |
| 3248 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3250 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3251 | "$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] | 3252 | "$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] | 3253 | 0 \ |
| 3254 | -c "client hello, adding renegotiation extension" \ |
| 3255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3256 | -s "found renegotiation extension" \ |
| 3257 | -s "server hello, secure renegotiation extension" \ |
| 3258 | -c "found renegotiation extension" \ |
| 3259 | -c "=> renegotiate" \ |
| 3260 | -s "=> renegotiate" \ |
| 3261 | -s "write hello request" |
| 3262 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3264 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3265 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3266 | "$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] | 3267 | 0 \ |
| 3268 | -c "client hello, adding renegotiation extension" \ |
| 3269 | -c "found renegotiation extension" \ |
| 3270 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3271 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3272 | -C "error" \ |
| 3273 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3274 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3275 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3277 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3278 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3279 | "$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] | 3280 | 0 \ |
| 3281 | -c "client hello, adding renegotiation extension" \ |
| 3282 | -c "found renegotiation extension" \ |
| 3283 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3284 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3285 | -C "error" \ |
| 3286 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3287 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3288 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3290 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3291 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3292 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3293 | 1 \ |
| 3294 | -c "client hello, adding renegotiation extension" \ |
| 3295 | -C "found renegotiation extension" \ |
| 3296 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3297 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3298 | -c "error" \ |
| 3299 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3300 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3301 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3302 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3303 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3304 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3305 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3306 | allow_legacy=0" \ |
| 3307 | 1 \ |
| 3308 | -c "client hello, adding renegotiation extension" \ |
| 3309 | -C "found renegotiation extension" \ |
| 3310 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3311 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3312 | -c "error" \ |
| 3313 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3314 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3315 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3316 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3317 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3318 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3319 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3320 | allow_legacy=1" \ |
| 3321 | 0 \ |
| 3322 | -c "client hello, adding renegotiation extension" \ |
| 3323 | -C "found renegotiation extension" \ |
| 3324 | -c "=> renegotiate" \ |
| 3325 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3326 | -C "error" \ |
| 3327 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3328 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3329 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3330 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3331 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3332 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3333 | 0 \ |
| 3334 | -c "client hello, adding renegotiation extension" \ |
| 3335 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3336 | -s "found renegotiation extension" \ |
| 3337 | -s "server hello, secure renegotiation extension" \ |
| 3338 | -c "found renegotiation extension" \ |
| 3339 | -c "=> renegotiate" \ |
| 3340 | -s "=> renegotiate" \ |
| 3341 | -S "write hello request" |
| 3342 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3343 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3344 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3345 | "$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] | 3346 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3347 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3348 | 0 \ |
| 3349 | -c "client hello, adding renegotiation extension" \ |
| 3350 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3351 | -s "found renegotiation extension" \ |
| 3352 | -s "server hello, secure renegotiation extension" \ |
| 3353 | -c "found renegotiation extension" \ |
| 3354 | -c "=> renegotiate" \ |
| 3355 | -s "=> renegotiate" \ |
| 3356 | -s "write hello request" |
| 3357 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3359 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3360 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3361 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3362 | 0 \ |
| 3363 | -c "client hello, adding renegotiation extension" \ |
| 3364 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3365 | -s "found renegotiation extension" \ |
| 3366 | -s "server hello, secure renegotiation extension" \ |
| 3367 | -s "record counter limit reached: renegotiate" \ |
| 3368 | -c "=> renegotiate" \ |
| 3369 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3370 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3371 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3372 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3374 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3375 | "$G_SRV -u --mtu 4096" \ |
| 3376 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3377 | 0 \ |
| 3378 | -c "client hello, adding renegotiation extension" \ |
| 3379 | -c "found renegotiation extension" \ |
| 3380 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3381 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3382 | -C "error" \ |
| 3383 | -s "Extra-header:" |
| 3384 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3385 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3386 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3387 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3388 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3389 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3390 | "$P_CLI debug_level=3" \ |
| 3391 | 0 \ |
| 3392 | -c "found renegotiation extension" \ |
| 3393 | -C "error" \ |
| 3394 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3395 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3396 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3397 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3398 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3399 | "$P_CLI debug_level=3" \ |
| 3400 | 0 \ |
| 3401 | -C "found renegotiation extension" \ |
| 3402 | -C "error" \ |
| 3403 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3404 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3405 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3406 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3407 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3408 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3409 | 1 \ |
| 3410 | -C "found renegotiation extension" \ |
| 3411 | -c "error" \ |
| 3412 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3413 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3414 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3415 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3416 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3417 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3418 | 0 \ |
| 3419 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3420 | -s "server hello, secure renegotiation extension" |
| 3421 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3422 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3423 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3424 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3425 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3426 | 0 \ |
| 3427 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3428 | -S "server hello, secure renegotiation extension" |
| 3429 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3430 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3431 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3432 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3433 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3434 | 1 \ |
| 3435 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3436 | -S "server hello, secure renegotiation extension" |
| 3437 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3438 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3439 | |
| 3440 | requires_gnutls |
| 3441 | run_test "DER format: no trailing bytes" \ |
| 3442 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3443 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3444 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3445 | 0 \ |
| 3446 | -c "Handshake was completed" \ |
| 3447 | |
| 3448 | requires_gnutls |
| 3449 | run_test "DER format: with a trailing zero byte" \ |
| 3450 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3451 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3452 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3453 | 0 \ |
| 3454 | -c "Handshake was completed" \ |
| 3455 | |
| 3456 | requires_gnutls |
| 3457 | run_test "DER format: with a trailing random byte" \ |
| 3458 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3459 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3460 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3461 | 0 \ |
| 3462 | -c "Handshake was completed" \ |
| 3463 | |
| 3464 | requires_gnutls |
| 3465 | run_test "DER format: with 2 trailing random bytes" \ |
| 3466 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3467 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3468 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3469 | 0 \ |
| 3470 | -c "Handshake was completed" \ |
| 3471 | |
| 3472 | requires_gnutls |
| 3473 | run_test "DER format: with 4 trailing random bytes" \ |
| 3474 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3475 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3476 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3477 | 0 \ |
| 3478 | -c "Handshake was completed" \ |
| 3479 | |
| 3480 | requires_gnutls |
| 3481 | run_test "DER format: with 8 trailing random bytes" \ |
| 3482 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3483 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3484 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3485 | 0 \ |
| 3486 | -c "Handshake was completed" \ |
| 3487 | |
| 3488 | requires_gnutls |
| 3489 | run_test "DER format: with 9 trailing random bytes" \ |
| 3490 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3491 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3492 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3493 | 0 \ |
| 3494 | -c "Handshake was completed" \ |
| 3495 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3496 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3497 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3498 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3499 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3500 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3501 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3502 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3503 | 1 \ |
| 3504 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3505 | -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] | 3506 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3507 | -c "X509 - Certificate verification failed" |
| 3508 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3509 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3510 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3511 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3512 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3513 | 0 \ |
| 3514 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3515 | -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] | 3516 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3517 | -C "X509 - Certificate verification failed" |
| 3518 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3519 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3520 | "$P_SRV" \ |
| 3521 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3522 | 0 \ |
| 3523 | -c "x509_verify_cert() returned" \ |
| 3524 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3525 | -c "! Certificate verification flags"\ |
| 3526 | -C "! mbedtls_ssl_handshake returned" \ |
| 3527 | -C "X509 - Certificate verification failed" \ |
| 3528 | -C "SSL - No CA Chain is set, but required to operate" |
| 3529 | |
| 3530 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3531 | "$P_SRV" \ |
| 3532 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3533 | 1 \ |
| 3534 | -c "x509_verify_cert() returned" \ |
| 3535 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3536 | -c "! Certificate verification flags"\ |
| 3537 | -c "! mbedtls_ssl_handshake returned" \ |
| 3538 | -c "SSL - No CA Chain is set, but required to operate" |
| 3539 | |
| 3540 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3541 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3542 | # the client informs the server about the supported curves - it does, though, in the |
| 3543 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3544 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3545 | # different means to have the server ignoring the client's supported curve list. |
| 3546 | |
| 3547 | requires_config_enabled MBEDTLS_ECP_C |
| 3548 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3549 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3550 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3551 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3552 | 1 \ |
| 3553 | -c "bad certificate (EC key curve)"\ |
| 3554 | -c "! Certificate verification flags"\ |
| 3555 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3556 | |
| 3557 | requires_config_enabled MBEDTLS_ECP_C |
| 3558 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3559 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3560 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3561 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3562 | 1 \ |
| 3563 | -c "bad certificate (EC key curve)"\ |
| 3564 | -c "! Certificate verification flags"\ |
| 3565 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3567 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3568 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3569 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3570 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3571 | 0 \ |
| 3572 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3573 | -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] | 3574 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3575 | -C "X509 - Certificate verification failed" |
| 3576 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3577 | run_test "Authentication: client SHA256, server required" \ |
| 3578 | "$P_SRV auth_mode=required" \ |
| 3579 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3580 | key_file=data_files/server6.key \ |
| 3581 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3582 | 0 \ |
| 3583 | -c "Supported Signature Algorithm found: 4," \ |
| 3584 | -c "Supported Signature Algorithm found: 5," |
| 3585 | |
| 3586 | run_test "Authentication: client SHA384, server required" \ |
| 3587 | "$P_SRV auth_mode=required" \ |
| 3588 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3589 | key_file=data_files/server6.key \ |
| 3590 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3591 | 0 \ |
| 3592 | -c "Supported Signature Algorithm found: 4," \ |
| 3593 | -c "Supported Signature Algorithm found: 5," |
| 3594 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3595 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3596 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3597 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3598 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3599 | key_file=data_files/server5.key" \ |
| 3600 | 1 \ |
| 3601 | -S "skip write certificate request" \ |
| 3602 | -C "skip parse certificate request" \ |
| 3603 | -c "got a certificate request" \ |
| 3604 | -c "got no certificate to send" \ |
| 3605 | -S "x509_verify_cert() returned" \ |
| 3606 | -s "client has no certificate" \ |
| 3607 | -s "! mbedtls_ssl_handshake returned" \ |
| 3608 | -c "! mbedtls_ssl_handshake returned" \ |
| 3609 | -s "No client certification received from the client, but required by the authentication mode" |
| 3610 | |
| 3611 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3612 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3613 | "$P_CLI debug_level=3 crt_file=none \ |
| 3614 | key_file=data_files/server5.key" \ |
| 3615 | 1 \ |
| 3616 | -S "skip write certificate request" \ |
| 3617 | -C "skip parse certificate request" \ |
| 3618 | -c "got a certificate request" \ |
| 3619 | -c "= write certificate$" \ |
| 3620 | -C "skip write certificate$" \ |
| 3621 | -S "x509_verify_cert() returned" \ |
| 3622 | -s "client has no certificate" \ |
| 3623 | -s "! mbedtls_ssl_handshake returned" \ |
| 3624 | -c "! mbedtls_ssl_handshake returned" \ |
| 3625 | -s "No client certification received from the client, but required by the authentication mode" |
| 3626 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3627 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3628 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3629 | "$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] | 3630 | key_file=data_files/server5.key" \ |
| 3631 | 1 \ |
| 3632 | -S "skip write certificate request" \ |
| 3633 | -C "skip parse certificate request" \ |
| 3634 | -c "got a certificate request" \ |
| 3635 | -C "skip write certificate" \ |
| 3636 | -C "skip write certificate verify" \ |
| 3637 | -S "skip parse certificate verify" \ |
| 3638 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3639 | -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] | 3640 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3641 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3642 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3643 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3644 | # We don't check that the client receives the alert because it might |
| 3645 | # detect that its write end of the connection is closed and abort |
| 3646 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3647 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3648 | run_test "Authentication: client cert not trusted, server required" \ |
| 3649 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3650 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3651 | key_file=data_files/server5.key" \ |
| 3652 | 1 \ |
| 3653 | -S "skip write certificate request" \ |
| 3654 | -C "skip parse certificate request" \ |
| 3655 | -c "got a certificate request" \ |
| 3656 | -C "skip write certificate" \ |
| 3657 | -C "skip write certificate verify" \ |
| 3658 | -S "skip parse certificate verify" \ |
| 3659 | -s "x509_verify_cert() returned" \ |
| 3660 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3661 | -s "! mbedtls_ssl_handshake returned" \ |
| 3662 | -c "! mbedtls_ssl_handshake returned" \ |
| 3663 | -s "X509 - Certificate verification failed" |
| 3664 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3665 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3666 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3667 | "$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] | 3668 | key_file=data_files/server5.key" \ |
| 3669 | 0 \ |
| 3670 | -S "skip write certificate request" \ |
| 3671 | -C "skip parse certificate request" \ |
| 3672 | -c "got a certificate request" \ |
| 3673 | -C "skip write certificate" \ |
| 3674 | -C "skip write certificate verify" \ |
| 3675 | -S "skip parse certificate verify" \ |
| 3676 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3677 | -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] | 3678 | -S "! mbedtls_ssl_handshake returned" \ |
| 3679 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3680 | -S "X509 - Certificate verification failed" |
| 3681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3682 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3683 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3684 | "$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] | 3685 | key_file=data_files/server5.key" \ |
| 3686 | 0 \ |
| 3687 | -s "skip write certificate request" \ |
| 3688 | -C "skip parse certificate request" \ |
| 3689 | -c "got no certificate request" \ |
| 3690 | -c "skip write certificate" \ |
| 3691 | -c "skip write certificate verify" \ |
| 3692 | -s "skip parse certificate verify" \ |
| 3693 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3694 | -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] | 3695 | -S "! mbedtls_ssl_handshake returned" \ |
| 3696 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3697 | -S "X509 - Certificate verification failed" |
| 3698 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3699 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3700 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3701 | "$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] | 3702 | 0 \ |
| 3703 | -S "skip write certificate request" \ |
| 3704 | -C "skip parse certificate request" \ |
| 3705 | -c "got a certificate request" \ |
| 3706 | -C "skip write certificate$" \ |
| 3707 | -C "got no certificate to send" \ |
| 3708 | -S "SSLv3 client has no certificate" \ |
| 3709 | -c "skip write certificate verify" \ |
| 3710 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3711 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3712 | -S "! mbedtls_ssl_handshake returned" \ |
| 3713 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3714 | -S "X509 - Certificate verification failed" |
| 3715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3716 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3717 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3718 | "$O_CLI" \ |
| 3719 | 0 \ |
| 3720 | -S "skip write certificate request" \ |
| 3721 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3722 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3723 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3724 | -S "X509 - Certificate verification failed" |
| 3725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3726 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3727 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3728 | "$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] | 3729 | 0 \ |
| 3730 | -C "skip parse certificate request" \ |
| 3731 | -c "got a certificate request" \ |
| 3732 | -C "skip write certificate$" \ |
| 3733 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3734 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3735 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3736 | run_test "Authentication: client no cert, openssl server required" \ |
| 3737 | "$O_SRV -Verify 10" \ |
| 3738 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3739 | 1 \ |
| 3740 | -C "skip parse certificate request" \ |
| 3741 | -c "got a certificate request" \ |
| 3742 | -C "skip write certificate$" \ |
| 3743 | -c "skip write certificate verify" \ |
| 3744 | -c "! mbedtls_ssl_handshake returned" |
| 3745 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3746 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3747 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3748 | "$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] | 3749 | "$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] | 3750 | 0 \ |
| 3751 | -S "skip write certificate request" \ |
| 3752 | -C "skip parse certificate request" \ |
| 3753 | -c "got a certificate request" \ |
| 3754 | -C "skip write certificate$" \ |
| 3755 | -c "skip write certificate verify" \ |
| 3756 | -c "got no certificate to send" \ |
| 3757 | -s "SSLv3 client has no certificate" \ |
| 3758 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3759 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3760 | -S "! mbedtls_ssl_handshake returned" \ |
| 3761 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3762 | -S "X509 - Certificate verification failed" |
| 3763 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3764 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3765 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3766 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3767 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 3768 | MAX_IM_CA_CONFIG=$( ../scripts/config.py get MBEDTLS_X509_MAX_INTERMEDIATE_CA) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3769 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3770 | 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] | 3771 | 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] | 3772 | 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] | 3773 | printf "test value of ${MAX_IM_CA}. \n" |
| 3774 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3775 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3776 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3777 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3778 | |
| 3779 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3780 | fi |
| 3781 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3782 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3783 | run_test "Authentication: server max_int chain, client default" \ |
| 3784 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3785 | key_file=data_files/dir-maxpath/09.key" \ |
| 3786 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3787 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3788 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3789 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3790 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3791 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3792 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3793 | key_file=data_files/dir-maxpath/10.key" \ |
| 3794 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3795 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3796 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3797 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3798 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3799 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3800 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3801 | key_file=data_files/dir-maxpath/10.key" \ |
| 3802 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3803 | auth_mode=optional" \ |
| 3804 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3805 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3806 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3807 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3808 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3809 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3810 | key_file=data_files/dir-maxpath/10.key" \ |
| 3811 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3812 | auth_mode=none" \ |
| 3813 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3814 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3815 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3816 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3817 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3818 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3819 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3820 | key_file=data_files/dir-maxpath/10.key" \ |
| 3821 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3822 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3823 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3824 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3825 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3826 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3827 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3828 | key_file=data_files/dir-maxpath/10.key" \ |
| 3829 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3830 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3831 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3832 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3833 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3834 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3835 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3836 | key_file=data_files/dir-maxpath/10.key" \ |
| 3837 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3838 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3839 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3840 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3841 | run_test "Authentication: client max_int chain, server required" \ |
| 3842 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3843 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3844 | key_file=data_files/dir-maxpath/09.key" \ |
| 3845 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3846 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3847 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3848 | # Tests for CA list in CertificateRequest messages |
| 3849 | |
| 3850 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3851 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3852 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3853 | key_file=data_files/server6.key" \ |
| 3854 | 0 \ |
| 3855 | -s "requested DN" |
| 3856 | |
| 3857 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3858 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3859 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3860 | key_file=data_files/server6.key" \ |
| 3861 | 0 \ |
| 3862 | -S "requested DN" |
| 3863 | |
| 3864 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3865 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3866 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3867 | key_file=data_files/server5.key" \ |
| 3868 | 1 \ |
| 3869 | -S "requested DN" \ |
| 3870 | -s "x509_verify_cert() returned" \ |
| 3871 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3872 | -s "! mbedtls_ssl_handshake returned" \ |
| 3873 | -c "! mbedtls_ssl_handshake returned" \ |
| 3874 | -s "X509 - Certificate verification failed" |
| 3875 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3876 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3877 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3878 | |
| 3879 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3880 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3881 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3882 | key_file=data_files/server5.key" \ |
| 3883 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3884 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3885 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3886 | -c "x509_verify_cert() returned" \ |
| 3887 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3888 | -c "! mbedtls_ssl_handshake returned" \ |
| 3889 | -c "X509 - Certificate verification failed" |
| 3890 | |
| 3891 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3892 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3893 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3894 | key_file=data_files/server5.key" \ |
| 3895 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3896 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3897 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3898 | -c "x509_verify_cert() returned" \ |
| 3899 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3900 | -C "! mbedtls_ssl_handshake returned" \ |
| 3901 | -C "X509 - Certificate verification failed" |
| 3902 | |
| 3903 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3904 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3905 | # the client informs the server about the supported curves - it does, though, in the |
| 3906 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3907 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3908 | # different means to have the server ignoring the client's supported curve list. |
| 3909 | |
| 3910 | requires_config_enabled MBEDTLS_ECP_C |
| 3911 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3912 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3913 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3914 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3915 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3916 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3917 | -c "use CA callback for X.509 CRT verification" \ |
| 3918 | -c "bad certificate (EC key curve)" \ |
| 3919 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3920 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3921 | |
| 3922 | requires_config_enabled MBEDTLS_ECP_C |
| 3923 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3924 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3925 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3926 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3927 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3928 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3929 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3930 | -c "bad certificate (EC key curve)"\ |
| 3931 | -c "! Certificate verification flags"\ |
| 3932 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3933 | |
| 3934 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3935 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 3936 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3937 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3938 | key_file=data_files/server6.key \ |
| 3939 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3940 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3941 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3942 | -c "Supported Signature Algorithm found: 4," \ |
| 3943 | -c "Supported Signature Algorithm found: 5," |
| 3944 | |
| 3945 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3946 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 3947 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3948 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3949 | key_file=data_files/server6.key \ |
| 3950 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3951 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3952 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3953 | -c "Supported Signature Algorithm found: 4," \ |
| 3954 | -c "Supported Signature Algorithm found: 5," |
| 3955 | |
| 3956 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3957 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 3958 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3959 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3960 | key_file=data_files/server5.key" \ |
| 3961 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3962 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3963 | -S "skip write certificate request" \ |
| 3964 | -C "skip parse certificate request" \ |
| 3965 | -c "got a certificate request" \ |
| 3966 | -C "skip write certificate" \ |
| 3967 | -C "skip write certificate verify" \ |
| 3968 | -S "skip parse certificate verify" \ |
| 3969 | -s "x509_verify_cert() returned" \ |
| 3970 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3971 | -s "! mbedtls_ssl_handshake returned" \ |
| 3972 | -s "send alert level=2 message=48" \ |
| 3973 | -c "! mbedtls_ssl_handshake returned" \ |
| 3974 | -s "X509 - Certificate verification failed" |
| 3975 | # We don't check that the client receives the alert because it might |
| 3976 | # detect that its write end of the connection is closed and abort |
| 3977 | # before reading the alert message. |
| 3978 | |
| 3979 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3980 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 3981 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3982 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3983 | key_file=data_files/server5.key" \ |
| 3984 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3985 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3986 | -S "skip write certificate request" \ |
| 3987 | -C "skip parse certificate request" \ |
| 3988 | -c "got a certificate request" \ |
| 3989 | -C "skip write certificate" \ |
| 3990 | -C "skip write certificate verify" \ |
| 3991 | -S "skip parse certificate verify" \ |
| 3992 | -s "x509_verify_cert() returned" \ |
| 3993 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3994 | -s "! mbedtls_ssl_handshake returned" \ |
| 3995 | -c "! mbedtls_ssl_handshake returned" \ |
| 3996 | -s "X509 - Certificate verification failed" |
| 3997 | |
| 3998 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3999 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4000 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4001 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4002 | key_file=data_files/server5.key" \ |
| 4003 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4004 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4005 | -S "skip write certificate request" \ |
| 4006 | -C "skip parse certificate request" \ |
| 4007 | -c "got a certificate request" \ |
| 4008 | -C "skip write certificate" \ |
| 4009 | -C "skip write certificate verify" \ |
| 4010 | -S "skip parse certificate verify" \ |
| 4011 | -s "x509_verify_cert() returned" \ |
| 4012 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4013 | -S "! mbedtls_ssl_handshake returned" \ |
| 4014 | -C "! mbedtls_ssl_handshake returned" \ |
| 4015 | -S "X509 - Certificate verification failed" |
| 4016 | |
| 4017 | requires_full_size_output_buffer |
| 4018 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4019 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4020 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4021 | key_file=data_files/dir-maxpath/09.key" \ |
| 4022 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4023 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4024 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4025 | -C "X509 - A fatal error occurred" |
| 4026 | |
| 4027 | requires_full_size_output_buffer |
| 4028 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4029 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4030 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4031 | key_file=data_files/dir-maxpath/10.key" \ |
| 4032 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4033 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4034 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4035 | -c "X509 - A fatal error occurred" |
| 4036 | |
| 4037 | requires_full_size_output_buffer |
| 4038 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4039 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4040 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4041 | key_file=data_files/dir-maxpath/10.key" \ |
| 4042 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4043 | debug_level=3 auth_mode=optional" \ |
| 4044 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4045 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4046 | -c "X509 - A fatal error occurred" |
| 4047 | |
| 4048 | requires_full_size_output_buffer |
| 4049 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4050 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4051 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4052 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4053 | key_file=data_files/dir-maxpath/10.key" \ |
| 4054 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4055 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4056 | -s "X509 - A fatal error occurred" |
| 4057 | |
| 4058 | requires_full_size_output_buffer |
| 4059 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4060 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4061 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4062 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4063 | key_file=data_files/dir-maxpath/10.key" \ |
| 4064 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4065 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4066 | -s "X509 - A fatal error occurred" |
| 4067 | |
| 4068 | requires_full_size_output_buffer |
| 4069 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4070 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4071 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4072 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4073 | key_file=data_files/dir-maxpath/09.key" \ |
| 4074 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4075 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4076 | -S "X509 - A fatal error occurred" |
| 4077 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4078 | # Tests for certificate selection based on SHA verson |
| 4079 | |
| 4080 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4081 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4082 | key_file=data_files/server5.key \ |
| 4083 | crt_file2=data_files/server5-sha1.crt \ |
| 4084 | key_file2=data_files/server5.key" \ |
| 4085 | "$P_CLI force_version=tls1_2" \ |
| 4086 | 0 \ |
| 4087 | -c "signed using.*ECDSA with SHA256" \ |
| 4088 | -C "signed using.*ECDSA with SHA1" |
| 4089 | |
| 4090 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4091 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4092 | key_file=data_files/server5.key \ |
| 4093 | crt_file2=data_files/server5-sha1.crt \ |
| 4094 | key_file2=data_files/server5.key" \ |
| 4095 | "$P_CLI force_version=tls1_1" \ |
| 4096 | 0 \ |
| 4097 | -C "signed using.*ECDSA with SHA256" \ |
| 4098 | -c "signed using.*ECDSA with SHA1" |
| 4099 | |
| 4100 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4101 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4102 | key_file=data_files/server5.key \ |
| 4103 | crt_file2=data_files/server5-sha1.crt \ |
| 4104 | key_file2=data_files/server5.key" \ |
| 4105 | "$P_CLI force_version=tls1" \ |
| 4106 | 0 \ |
| 4107 | -C "signed using.*ECDSA with SHA256" \ |
| 4108 | -c "signed using.*ECDSA with SHA1" |
| 4109 | |
| 4110 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4111 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4112 | key_file=data_files/server5.key \ |
| 4113 | crt_file2=data_files/server6.crt \ |
| 4114 | key_file2=data_files/server6.key" \ |
| 4115 | "$P_CLI force_version=tls1_1" \ |
| 4116 | 0 \ |
| 4117 | -c "serial number.*09" \ |
| 4118 | -c "signed using.*ECDSA with SHA256" \ |
| 4119 | -C "signed using.*ECDSA with SHA1" |
| 4120 | |
| 4121 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4122 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4123 | key_file=data_files/server6.key \ |
| 4124 | crt_file2=data_files/server5.crt \ |
| 4125 | key_file2=data_files/server5.key" \ |
| 4126 | "$P_CLI force_version=tls1_1" \ |
| 4127 | 0 \ |
| 4128 | -c "serial number.*0A" \ |
| 4129 | -c "signed using.*ECDSA with SHA256" \ |
| 4130 | -C "signed using.*ECDSA with SHA1" |
| 4131 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4132 | # tests for SNI |
| 4133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4134 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4135 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4136 | 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] | 4137 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4138 | 0 \ |
| 4139 | -S "parse ServerName extension" \ |
| 4140 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4141 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4142 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4143 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4144 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4145 | 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] | 4146 | 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] | 4147 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4148 | 0 \ |
| 4149 | -s "parse ServerName extension" \ |
| 4150 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4151 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4152 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4153 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4154 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4155 | 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] | 4156 | 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] | 4157 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4158 | 0 \ |
| 4159 | -s "parse ServerName extension" \ |
| 4160 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4161 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4162 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4163 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4164 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4165 | 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] | 4166 | 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] | 4167 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4168 | 1 \ |
| 4169 | -s "parse ServerName extension" \ |
| 4170 | -s "ssl_sni_wrapper() returned" \ |
| 4171 | -s "mbedtls_ssl_handshake returned" \ |
| 4172 | -c "mbedtls_ssl_handshake returned" \ |
| 4173 | -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] | 4174 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4175 | run_test "SNI: client auth no override: optional" \ |
| 4176 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4177 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4178 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4179 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4180 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4181 | -S "skip write certificate request" \ |
| 4182 | -C "skip parse certificate request" \ |
| 4183 | -c "got a certificate request" \ |
| 4184 | -C "skip write certificate" \ |
| 4185 | -C "skip write certificate verify" \ |
| 4186 | -S "skip parse certificate verify" |
| 4187 | |
| 4188 | run_test "SNI: client auth override: none -> optional" \ |
| 4189 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4190 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4191 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4192 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4193 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4194 | -S "skip write certificate request" \ |
| 4195 | -C "skip parse certificate request" \ |
| 4196 | -c "got a certificate request" \ |
| 4197 | -C "skip write certificate" \ |
| 4198 | -C "skip write certificate verify" \ |
| 4199 | -S "skip parse certificate verify" |
| 4200 | |
| 4201 | run_test "SNI: client auth override: optional -> none" \ |
| 4202 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4203 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4204 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4205 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4206 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4207 | -s "skip write certificate request" \ |
| 4208 | -C "skip parse certificate request" \ |
| 4209 | -c "got no certificate request" \ |
| 4210 | -c "skip write certificate" \ |
| 4211 | -c "skip write certificate verify" \ |
| 4212 | -s "skip parse certificate verify" |
| 4213 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4214 | run_test "SNI: CA no override" \ |
| 4215 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4216 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4217 | ca_file=data_files/test-ca.crt \ |
| 4218 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4219 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4220 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4221 | 1 \ |
| 4222 | -S "skip write certificate request" \ |
| 4223 | -C "skip parse certificate request" \ |
| 4224 | -c "got a certificate request" \ |
| 4225 | -C "skip write certificate" \ |
| 4226 | -C "skip write certificate verify" \ |
| 4227 | -S "skip parse certificate verify" \ |
| 4228 | -s "x509_verify_cert() returned" \ |
| 4229 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4230 | -S "The certificate has been revoked (is on a CRL)" |
| 4231 | |
| 4232 | run_test "SNI: CA override" \ |
| 4233 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4234 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4235 | ca_file=data_files/test-ca.crt \ |
| 4236 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4237 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4238 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4239 | 0 \ |
| 4240 | -S "skip write certificate request" \ |
| 4241 | -C "skip parse certificate request" \ |
| 4242 | -c "got a certificate request" \ |
| 4243 | -C "skip write certificate" \ |
| 4244 | -C "skip write certificate verify" \ |
| 4245 | -S "skip parse certificate verify" \ |
| 4246 | -S "x509_verify_cert() returned" \ |
| 4247 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4248 | -S "The certificate has been revoked (is on a CRL)" |
| 4249 | |
| 4250 | run_test "SNI: CA override with CRL" \ |
| 4251 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4252 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4253 | ca_file=data_files/test-ca.crt \ |
| 4254 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4255 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4256 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4257 | 1 \ |
| 4258 | -S "skip write certificate request" \ |
| 4259 | -C "skip parse certificate request" \ |
| 4260 | -c "got a certificate request" \ |
| 4261 | -C "skip write certificate" \ |
| 4262 | -C "skip write certificate verify" \ |
| 4263 | -S "skip parse certificate verify" \ |
| 4264 | -s "x509_verify_cert() returned" \ |
| 4265 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4266 | -s "The certificate has been revoked (is on a CRL)" |
| 4267 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4268 | # Tests for SNI and DTLS |
| 4269 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4270 | run_test "SNI: DTLS, no SNI callback" \ |
| 4271 | "$P_SRV debug_level=3 dtls=1 \ |
| 4272 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4273 | "$P_CLI server_name=localhost dtls=1" \ |
| 4274 | 0 \ |
| 4275 | -S "parse ServerName extension" \ |
| 4276 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4277 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4278 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4279 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4280 | "$P_SRV debug_level=3 dtls=1 \ |
| 4281 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4282 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4283 | "$P_CLI server_name=localhost dtls=1" \ |
| 4284 | 0 \ |
| 4285 | -s "parse ServerName extension" \ |
| 4286 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4287 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4288 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4289 | run_test "SNI: DTLS, matching cert 2" \ |
| 4290 | "$P_SRV debug_level=3 dtls=1 \ |
| 4291 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4292 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4293 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4294 | 0 \ |
| 4295 | -s "parse ServerName extension" \ |
| 4296 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4297 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4298 | |
| 4299 | run_test "SNI: DTLS, no matching cert" \ |
| 4300 | "$P_SRV debug_level=3 dtls=1 \ |
| 4301 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4302 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4303 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4304 | 1 \ |
| 4305 | -s "parse ServerName extension" \ |
| 4306 | -s "ssl_sni_wrapper() returned" \ |
| 4307 | -s "mbedtls_ssl_handshake returned" \ |
| 4308 | -c "mbedtls_ssl_handshake returned" \ |
| 4309 | -c "SSL - A fatal alert message was received from our peer" |
| 4310 | |
| 4311 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4312 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4313 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4314 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4315 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4316 | 0 \ |
| 4317 | -S "skip write certificate request" \ |
| 4318 | -C "skip parse certificate request" \ |
| 4319 | -c "got a certificate request" \ |
| 4320 | -C "skip write certificate" \ |
| 4321 | -C "skip write certificate verify" \ |
| 4322 | -S "skip parse certificate verify" |
| 4323 | |
| 4324 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4325 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4326 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4327 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4328 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4329 | 0 \ |
| 4330 | -S "skip write certificate request" \ |
| 4331 | -C "skip parse certificate request" \ |
| 4332 | -c "got a certificate request" \ |
| 4333 | -C "skip write certificate" \ |
| 4334 | -C "skip write certificate verify" \ |
| 4335 | -S "skip parse certificate verify" |
| 4336 | |
| 4337 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4338 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4339 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4340 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4341 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4342 | 0 \ |
| 4343 | -s "skip write certificate request" \ |
| 4344 | -C "skip parse certificate request" \ |
| 4345 | -c "got no certificate request" \ |
| 4346 | -c "skip write certificate" \ |
| 4347 | -c "skip write certificate verify" \ |
| 4348 | -s "skip parse certificate verify" |
| 4349 | |
| 4350 | run_test "SNI: DTLS, CA no override" \ |
| 4351 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4352 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4353 | ca_file=data_files/test-ca.crt \ |
| 4354 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4355 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4356 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4357 | 1 \ |
| 4358 | -S "skip write certificate request" \ |
| 4359 | -C "skip parse certificate request" \ |
| 4360 | -c "got a certificate request" \ |
| 4361 | -C "skip write certificate" \ |
| 4362 | -C "skip write certificate verify" \ |
| 4363 | -S "skip parse certificate verify" \ |
| 4364 | -s "x509_verify_cert() returned" \ |
| 4365 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4366 | -S "The certificate has been revoked (is on a CRL)" |
| 4367 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4368 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4369 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4370 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4371 | ca_file=data_files/test-ca.crt \ |
| 4372 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4373 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4374 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4375 | 0 \ |
| 4376 | -S "skip write certificate request" \ |
| 4377 | -C "skip parse certificate request" \ |
| 4378 | -c "got a certificate request" \ |
| 4379 | -C "skip write certificate" \ |
| 4380 | -C "skip write certificate verify" \ |
| 4381 | -S "skip parse certificate verify" \ |
| 4382 | -S "x509_verify_cert() returned" \ |
| 4383 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4384 | -S "The certificate has been revoked (is on a CRL)" |
| 4385 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4386 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4387 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4388 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4389 | ca_file=data_files/test-ca.crt \ |
| 4390 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4391 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4392 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4393 | 1 \ |
| 4394 | -S "skip write certificate request" \ |
| 4395 | -C "skip parse certificate request" \ |
| 4396 | -c "got a certificate request" \ |
| 4397 | -C "skip write certificate" \ |
| 4398 | -C "skip write certificate verify" \ |
| 4399 | -S "skip parse certificate verify" \ |
| 4400 | -s "x509_verify_cert() returned" \ |
| 4401 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4402 | -s "The certificate has been revoked (is on a CRL)" |
| 4403 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4404 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4405 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4406 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4407 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4408 | "$P_CLI nbio=2 tickets=0" \ |
| 4409 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4410 | -S "mbedtls_ssl_handshake returned" \ |
| 4411 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4412 | -c "Read from server: .* bytes read" |
| 4413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4414 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4415 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4416 | "$P_CLI nbio=2 tickets=0" \ |
| 4417 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4418 | -S "mbedtls_ssl_handshake returned" \ |
| 4419 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4420 | -c "Read from server: .* bytes read" |
| 4421 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4422 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4423 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4424 | "$P_CLI nbio=2 tickets=1" \ |
| 4425 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4426 | -S "mbedtls_ssl_handshake returned" \ |
| 4427 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4428 | -c "Read from server: .* bytes read" |
| 4429 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4430 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4431 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4432 | "$P_CLI nbio=2 tickets=1" \ |
| 4433 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4434 | -S "mbedtls_ssl_handshake returned" \ |
| 4435 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4436 | -c "Read from server: .* bytes read" |
| 4437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4438 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4439 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4440 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4441 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4442 | -S "mbedtls_ssl_handshake returned" \ |
| 4443 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4444 | -c "Read from server: .* bytes read" |
| 4445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4446 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4447 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4448 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4449 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4450 | -S "mbedtls_ssl_handshake returned" \ |
| 4451 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4452 | -c "Read from server: .* bytes read" |
| 4453 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4454 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4455 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4456 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4457 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4458 | -S "mbedtls_ssl_handshake returned" \ |
| 4459 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4460 | -c "Read from server: .* bytes read" |
| 4461 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4462 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4463 | |
| 4464 | run_test "Event-driven I/O: basic handshake" \ |
| 4465 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4466 | "$P_CLI event=1 tickets=0" \ |
| 4467 | 0 \ |
| 4468 | -S "mbedtls_ssl_handshake returned" \ |
| 4469 | -C "mbedtls_ssl_handshake returned" \ |
| 4470 | -c "Read from server: .* bytes read" |
| 4471 | |
| 4472 | run_test "Event-driven I/O: client auth" \ |
| 4473 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4474 | "$P_CLI event=1 tickets=0" \ |
| 4475 | 0 \ |
| 4476 | -S "mbedtls_ssl_handshake returned" \ |
| 4477 | -C "mbedtls_ssl_handshake returned" \ |
| 4478 | -c "Read from server: .* bytes read" |
| 4479 | |
| 4480 | run_test "Event-driven I/O: ticket" \ |
| 4481 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4482 | "$P_CLI event=1 tickets=1" \ |
| 4483 | 0 \ |
| 4484 | -S "mbedtls_ssl_handshake returned" \ |
| 4485 | -C "mbedtls_ssl_handshake returned" \ |
| 4486 | -c "Read from server: .* bytes read" |
| 4487 | |
| 4488 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4489 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4490 | "$P_CLI event=1 tickets=1" \ |
| 4491 | 0 \ |
| 4492 | -S "mbedtls_ssl_handshake returned" \ |
| 4493 | -C "mbedtls_ssl_handshake returned" \ |
| 4494 | -c "Read from server: .* bytes read" |
| 4495 | |
| 4496 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4497 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4498 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4499 | 0 \ |
| 4500 | -S "mbedtls_ssl_handshake returned" \ |
| 4501 | -C "mbedtls_ssl_handshake returned" \ |
| 4502 | -c "Read from server: .* bytes read" |
| 4503 | |
| 4504 | run_test "Event-driven I/O: ticket + resume" \ |
| 4505 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4506 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4507 | 0 \ |
| 4508 | -S "mbedtls_ssl_handshake returned" \ |
| 4509 | -C "mbedtls_ssl_handshake returned" \ |
| 4510 | -c "Read from server: .* bytes read" |
| 4511 | |
| 4512 | run_test "Event-driven I/O: session-id resume" \ |
| 4513 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4514 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4515 | 0 \ |
| 4516 | -S "mbedtls_ssl_handshake returned" \ |
| 4517 | -C "mbedtls_ssl_handshake returned" \ |
| 4518 | -c "Read from server: .* bytes read" |
| 4519 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4520 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4521 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4522 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4523 | 0 \ |
| 4524 | -c "Read from server: .* bytes read" |
| 4525 | |
| 4526 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4527 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4528 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4529 | 0 \ |
| 4530 | -c "Read from server: .* bytes read" |
| 4531 | |
| 4532 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4533 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4534 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4535 | 0 \ |
| 4536 | -c "Read from server: .* bytes read" |
| 4537 | |
| 4538 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4539 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4540 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4541 | 0 \ |
| 4542 | -c "Read from server: .* bytes read" |
| 4543 | |
| 4544 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4545 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4546 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4547 | 0 \ |
| 4548 | -c "Read from server: .* bytes read" |
| 4549 | |
| 4550 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4551 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4552 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4553 | 0 \ |
| 4554 | -c "Read from server: .* bytes read" |
| 4555 | |
| 4556 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4557 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4558 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4559 | 0 \ |
| 4560 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4561 | |
| 4562 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4563 | # During session resumption, the client will send its ApplicationData record |
| 4564 | # within the same datagram as the Finished messages. In this situation, the |
| 4565 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4566 | # because the ApplicationData request has already been queued internally. |
| 4567 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4568 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4569 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4570 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4571 | 0 \ |
| 4572 | -c "Read from server: .* bytes read" |
| 4573 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4574 | # Tests for version negotiation |
| 4575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4576 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4577 | "$P_SRV" \ |
| 4578 | "$P_CLI" \ |
| 4579 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4580 | -S "mbedtls_ssl_handshake returned" \ |
| 4581 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4582 | -s "Protocol is TLSv1.2" \ |
| 4583 | -c "Protocol is TLSv1.2" |
| 4584 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4585 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4586 | "$P_SRV" \ |
| 4587 | "$P_CLI max_version=tls1_1" \ |
| 4588 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4589 | -S "mbedtls_ssl_handshake returned" \ |
| 4590 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4591 | -s "Protocol is TLSv1.1" \ |
| 4592 | -c "Protocol is TLSv1.1" |
| 4593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4594 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4595 | "$P_SRV max_version=tls1_1" \ |
| 4596 | "$P_CLI" \ |
| 4597 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4598 | -S "mbedtls_ssl_handshake returned" \ |
| 4599 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4600 | -s "Protocol is TLSv1.1" \ |
| 4601 | -c "Protocol is TLSv1.1" |
| 4602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4603 | 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] | 4604 | "$P_SRV max_version=tls1_1" \ |
| 4605 | "$P_CLI max_version=tls1_1" \ |
| 4606 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4607 | -S "mbedtls_ssl_handshake returned" \ |
| 4608 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4609 | -s "Protocol is TLSv1.1" \ |
| 4610 | -c "Protocol is TLSv1.1" |
| 4611 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4612 | 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] | 4613 | "$P_SRV min_version=tls1_1" \ |
| 4614 | "$P_CLI max_version=tls1_1" \ |
| 4615 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4616 | -S "mbedtls_ssl_handshake returned" \ |
| 4617 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4618 | -s "Protocol is TLSv1.1" \ |
| 4619 | -c "Protocol is TLSv1.1" |
| 4620 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4621 | 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] | 4622 | "$P_SRV max_version=tls1_1" \ |
| 4623 | "$P_CLI min_version=tls1_1" \ |
| 4624 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4625 | -S "mbedtls_ssl_handshake returned" \ |
| 4626 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4627 | -s "Protocol is TLSv1.1" \ |
| 4628 | -c "Protocol is TLSv1.1" |
| 4629 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4630 | 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] | 4631 | "$P_SRV max_version=tls1_1" \ |
| 4632 | "$P_CLI min_version=tls1_2" \ |
| 4633 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4634 | -s "mbedtls_ssl_handshake returned" \ |
| 4635 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4636 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4638 | 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] | 4639 | "$P_SRV min_version=tls1_2" \ |
| 4640 | "$P_CLI max_version=tls1_1" \ |
| 4641 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4642 | -s "mbedtls_ssl_handshake returned" \ |
| 4643 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4644 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4645 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4646 | # Tests for ALPN extension |
| 4647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4648 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4649 | "$P_SRV debug_level=3" \ |
| 4650 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4651 | 0 \ |
| 4652 | -C "client hello, adding alpn extension" \ |
| 4653 | -S "found alpn extension" \ |
| 4654 | -C "got an alert message, type: \\[2:120]" \ |
| 4655 | -S "server hello, adding alpn extension" \ |
| 4656 | -C "found alpn extension " \ |
| 4657 | -C "Application Layer Protocol is" \ |
| 4658 | -S "Application Layer Protocol is" |
| 4659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4660 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4661 | "$P_SRV debug_level=3" \ |
| 4662 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4663 | 0 \ |
| 4664 | -c "client hello, adding alpn extension" \ |
| 4665 | -s "found alpn extension" \ |
| 4666 | -C "got an alert message, type: \\[2:120]" \ |
| 4667 | -S "server hello, adding alpn extension" \ |
| 4668 | -C "found alpn extension " \ |
| 4669 | -c "Application Layer Protocol is (none)" \ |
| 4670 | -S "Application Layer Protocol is" |
| 4671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4672 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4673 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4674 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4675 | 0 \ |
| 4676 | -C "client hello, adding alpn extension" \ |
| 4677 | -S "found alpn extension" \ |
| 4678 | -C "got an alert message, type: \\[2:120]" \ |
| 4679 | -S "server hello, adding alpn extension" \ |
| 4680 | -C "found alpn extension " \ |
| 4681 | -C "Application Layer Protocol is" \ |
| 4682 | -s "Application Layer Protocol is (none)" |
| 4683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4684 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4685 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4686 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4687 | 0 \ |
| 4688 | -c "client hello, adding alpn extension" \ |
| 4689 | -s "found alpn extension" \ |
| 4690 | -C "got an alert message, type: \\[2:120]" \ |
| 4691 | -s "server hello, adding alpn extension" \ |
| 4692 | -c "found alpn extension" \ |
| 4693 | -c "Application Layer Protocol is abc" \ |
| 4694 | -s "Application Layer Protocol is abc" |
| 4695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4696 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4697 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4698 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4699 | 0 \ |
| 4700 | -c "client hello, adding alpn extension" \ |
| 4701 | -s "found alpn extension" \ |
| 4702 | -C "got an alert message, type: \\[2:120]" \ |
| 4703 | -s "server hello, adding alpn extension" \ |
| 4704 | -c "found alpn extension" \ |
| 4705 | -c "Application Layer Protocol is abc" \ |
| 4706 | -s "Application Layer Protocol is abc" |
| 4707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4708 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4709 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4710 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4711 | 0 \ |
| 4712 | -c "client hello, adding alpn extension" \ |
| 4713 | -s "found alpn extension" \ |
| 4714 | -C "got an alert message, type: \\[2:120]" \ |
| 4715 | -s "server hello, adding alpn extension" \ |
| 4716 | -c "found alpn extension" \ |
| 4717 | -c "Application Layer Protocol is 1234" \ |
| 4718 | -s "Application Layer Protocol is 1234" |
| 4719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4720 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4721 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4722 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4723 | 1 \ |
| 4724 | -c "client hello, adding alpn extension" \ |
| 4725 | -s "found alpn extension" \ |
| 4726 | -c "got an alert message, type: \\[2:120]" \ |
| 4727 | -S "server hello, adding alpn extension" \ |
| 4728 | -C "found alpn extension" \ |
| 4729 | -C "Application Layer Protocol is 1234" \ |
| 4730 | -S "Application Layer Protocol is 1234" |
| 4731 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4732 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4733 | # Tests for keyUsage in leaf certificates, part 1: |
| 4734 | # server-side certificate/suite selection |
| 4735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4736 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4737 | "$P_SRV key_file=data_files/server2.key \ |
| 4738 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4739 | "$P_CLI" \ |
| 4740 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4741 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4742 | |
| 4743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4744 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4745 | "$P_SRV key_file=data_files/server2.key \ |
| 4746 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4747 | "$P_CLI" \ |
| 4748 | 0 \ |
| 4749 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4752 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4753 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4754 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4755 | 1 \ |
| 4756 | -C "Ciphersuite is " |
| 4757 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4758 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4759 | "$P_SRV key_file=data_files/server5.key \ |
| 4760 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4761 | "$P_CLI" \ |
| 4762 | 0 \ |
| 4763 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4764 | |
| 4765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4766 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4767 | "$P_SRV key_file=data_files/server5.key \ |
| 4768 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4769 | "$P_CLI" \ |
| 4770 | 0 \ |
| 4771 | -c "Ciphersuite is TLS-ECDH-" |
| 4772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4773 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4774 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4775 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4776 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4777 | 1 \ |
| 4778 | -C "Ciphersuite is " |
| 4779 | |
| 4780 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4781 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4782 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4783 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4784 | "$O_SRV -key data_files/server2.key \ |
| 4785 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4786 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4787 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4788 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4789 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4790 | -C "Processing of the Certificate handshake message failed" \ |
| 4791 | -c "Ciphersuite is TLS-" |
| 4792 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4793 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4794 | "$O_SRV -key data_files/server2.key \ |
| 4795 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4796 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4797 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4798 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4799 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4800 | -C "Processing of the Certificate handshake message failed" \ |
| 4801 | -c "Ciphersuite is TLS-" |
| 4802 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4803 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4804 | "$O_SRV -key data_files/server2.key \ |
| 4805 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4806 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4807 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4808 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4809 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4810 | -C "Processing of the Certificate handshake message failed" \ |
| 4811 | -c "Ciphersuite is TLS-" |
| 4812 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4813 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4814 | "$O_SRV -key data_files/server2.key \ |
| 4815 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4816 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4817 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4818 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4819 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4820 | -c "Processing of the Certificate handshake message failed" \ |
| 4821 | -C "Ciphersuite is TLS-" |
| 4822 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4823 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4824 | "$O_SRV -key data_files/server2.key \ |
| 4825 | -cert data_files/server2.ku-ke.crt" \ |
| 4826 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4827 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4828 | 0 \ |
| 4829 | -c "bad certificate (usage extensions)" \ |
| 4830 | -C "Processing of the Certificate handshake message failed" \ |
| 4831 | -c "Ciphersuite is TLS-" \ |
| 4832 | -c "! Usage does not match the keyUsage extension" |
| 4833 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4834 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4835 | "$O_SRV -key data_files/server2.key \ |
| 4836 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4837 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4838 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4839 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4840 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4841 | -C "Processing of the Certificate handshake message failed" \ |
| 4842 | -c "Ciphersuite is TLS-" |
| 4843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4844 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4845 | "$O_SRV -key data_files/server2.key \ |
| 4846 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4847 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4848 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4849 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4850 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4851 | -c "Processing of the Certificate handshake message failed" \ |
| 4852 | -C "Ciphersuite is TLS-" |
| 4853 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4854 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4855 | "$O_SRV -key data_files/server2.key \ |
| 4856 | -cert data_files/server2.ku-ds.crt" \ |
| 4857 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4858 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4859 | 0 \ |
| 4860 | -c "bad certificate (usage extensions)" \ |
| 4861 | -C "Processing of the Certificate handshake message failed" \ |
| 4862 | -c "Ciphersuite is TLS-" \ |
| 4863 | -c "! Usage does not match the keyUsage extension" |
| 4864 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4865 | # Tests for keyUsage in leaf certificates, part 3: |
| 4866 | # server-side checking of client cert |
| 4867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4868 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4869 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4870 | "$O_CLI -key data_files/server2.key \ |
| 4871 | -cert data_files/server2.ku-ds.crt" \ |
| 4872 | 0 \ |
| 4873 | -S "bad certificate (usage extensions)" \ |
| 4874 | -S "Processing of the Certificate handshake message failed" |
| 4875 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4876 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4877 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4878 | "$O_CLI -key data_files/server2.key \ |
| 4879 | -cert data_files/server2.ku-ke.crt" \ |
| 4880 | 0 \ |
| 4881 | -s "bad certificate (usage extensions)" \ |
| 4882 | -S "Processing of the Certificate handshake message failed" |
| 4883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4884 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4885 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4886 | "$O_CLI -key data_files/server2.key \ |
| 4887 | -cert data_files/server2.ku-ke.crt" \ |
| 4888 | 1 \ |
| 4889 | -s "bad certificate (usage extensions)" \ |
| 4890 | -s "Processing of the Certificate handshake message failed" |
| 4891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4892 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4893 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4894 | "$O_CLI -key data_files/server5.key \ |
| 4895 | -cert data_files/server5.ku-ds.crt" \ |
| 4896 | 0 \ |
| 4897 | -S "bad certificate (usage extensions)" \ |
| 4898 | -S "Processing of the Certificate handshake message failed" |
| 4899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4900 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4901 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4902 | "$O_CLI -key data_files/server5.key \ |
| 4903 | -cert data_files/server5.ku-ka.crt" \ |
| 4904 | 0 \ |
| 4905 | -s "bad certificate (usage extensions)" \ |
| 4906 | -S "Processing of the Certificate handshake message failed" |
| 4907 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4908 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4909 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4910 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4911 | "$P_SRV key_file=data_files/server5.key \ |
| 4912 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4913 | "$P_CLI" \ |
| 4914 | 0 |
| 4915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4916 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4917 | "$P_SRV key_file=data_files/server5.key \ |
| 4918 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4919 | "$P_CLI" \ |
| 4920 | 0 |
| 4921 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4922 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4923 | "$P_SRV key_file=data_files/server5.key \ |
| 4924 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4925 | "$P_CLI" \ |
| 4926 | 0 |
| 4927 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4928 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4929 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4930 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4931 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4932 | 1 |
| 4933 | |
| 4934 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4935 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4936 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4937 | "$O_SRV -key data_files/server5.key \ |
| 4938 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4939 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4940 | 0 \ |
| 4941 | -C "bad certificate (usage extensions)" \ |
| 4942 | -C "Processing of the Certificate handshake message failed" \ |
| 4943 | -c "Ciphersuite is TLS-" |
| 4944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4945 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4946 | "$O_SRV -key data_files/server5.key \ |
| 4947 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4948 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4949 | 0 \ |
| 4950 | -C "bad certificate (usage extensions)" \ |
| 4951 | -C "Processing of the Certificate handshake message failed" \ |
| 4952 | -c "Ciphersuite is TLS-" |
| 4953 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4954 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4955 | "$O_SRV -key data_files/server5.key \ |
| 4956 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4957 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4958 | 0 \ |
| 4959 | -C "bad certificate (usage extensions)" \ |
| 4960 | -C "Processing of the Certificate handshake message failed" \ |
| 4961 | -c "Ciphersuite is TLS-" |
| 4962 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4963 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4964 | "$O_SRV -key data_files/server5.key \ |
| 4965 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4966 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4967 | 1 \ |
| 4968 | -c "bad certificate (usage extensions)" \ |
| 4969 | -c "Processing of the Certificate handshake message failed" \ |
| 4970 | -C "Ciphersuite is TLS-" |
| 4971 | |
| 4972 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4975 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4976 | "$O_CLI -key data_files/server5.key \ |
| 4977 | -cert data_files/server5.eku-cli.crt" \ |
| 4978 | 0 \ |
| 4979 | -S "bad certificate (usage extensions)" \ |
| 4980 | -S "Processing of the Certificate handshake message failed" |
| 4981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4983 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4984 | "$O_CLI -key data_files/server5.key \ |
| 4985 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4986 | 0 \ |
| 4987 | -S "bad certificate (usage extensions)" \ |
| 4988 | -S "Processing of the Certificate handshake message failed" |
| 4989 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4990 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4991 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4992 | "$O_CLI -key data_files/server5.key \ |
| 4993 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4994 | 0 \ |
| 4995 | -S "bad certificate (usage extensions)" \ |
| 4996 | -S "Processing of the Certificate handshake message failed" |
| 4997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4998 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4999 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5000 | "$O_CLI -key data_files/server5.key \ |
| 5001 | -cert data_files/server5.eku-cs.crt" \ |
| 5002 | 0 \ |
| 5003 | -s "bad certificate (usage extensions)" \ |
| 5004 | -S "Processing of the Certificate handshake message failed" |
| 5005 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5006 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5007 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5008 | "$O_CLI -key data_files/server5.key \ |
| 5009 | -cert data_files/server5.eku-cs.crt" \ |
| 5010 | 1 \ |
| 5011 | -s "bad certificate (usage extensions)" \ |
| 5012 | -s "Processing of the Certificate handshake message failed" |
| 5013 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5014 | # Tests for DHM parameters loading |
| 5015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5016 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5017 | "$P_SRV" \ |
| 5018 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5019 | debug_level=3" \ |
| 5020 | 0 \ |
| 5021 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5022 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5024 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5025 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5026 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5027 | debug_level=3" \ |
| 5028 | 0 \ |
| 5029 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5030 | -c "value of 'DHM: G ' (2 bits)" |
| 5031 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5032 | # Tests for DHM client-side size checking |
| 5033 | |
| 5034 | run_test "DHM size: server default, client default, OK" \ |
| 5035 | "$P_SRV" \ |
| 5036 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5037 | debug_level=1" \ |
| 5038 | 0 \ |
| 5039 | -C "DHM prime too short:" |
| 5040 | |
| 5041 | run_test "DHM size: server default, client 2048, OK" \ |
| 5042 | "$P_SRV" \ |
| 5043 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5044 | debug_level=1 dhmlen=2048" \ |
| 5045 | 0 \ |
| 5046 | -C "DHM prime too short:" |
| 5047 | |
| 5048 | run_test "DHM size: server 1024, client default, OK" \ |
| 5049 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5050 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5051 | debug_level=1" \ |
| 5052 | 0 \ |
| 5053 | -C "DHM prime too short:" |
| 5054 | |
| 5055 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5056 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5057 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5058 | debug_level=1" \ |
| 5059 | 1 \ |
| 5060 | -c "DHM prime too short:" |
| 5061 | |
| 5062 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5063 | "$P_SRV" \ |
| 5064 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5065 | debug_level=1 dhmlen=2049" \ |
| 5066 | 1 \ |
| 5067 | -c "DHM prime too short:" |
| 5068 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5069 | # Tests for PSK callback |
| 5070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5071 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5072 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5073 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5074 | psk_identity=foo psk=abc123" \ |
| 5075 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5076 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5077 | -S "SSL - Unknown identity received" \ |
| 5078 | -S "SSL - Verification of the message MAC failed" |
| 5079 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5080 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5081 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5082 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5083 | "$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] | 5084 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5085 | 0 \ |
| 5086 | -c "skip PMS generation for opaque PSK"\ |
| 5087 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5088 | -C "session hash for extended master secret"\ |
| 5089 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5090 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5091 | -S "SSL - Unknown identity received" \ |
| 5092 | -S "SSL - Verification of the message MAC failed" |
| 5093 | |
| 5094 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5095 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5096 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5097 | "$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] | 5098 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5099 | 0 \ |
| 5100 | -c "skip PMS generation for opaque PSK"\ |
| 5101 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5102 | -C "session hash for extended master secret"\ |
| 5103 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5104 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5105 | -S "SSL - Unknown identity received" \ |
| 5106 | -S "SSL - Verification of the message MAC failed" |
| 5107 | |
| 5108 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5109 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5110 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5111 | "$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] | 5112 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5113 | 0 \ |
| 5114 | -c "skip PMS generation for opaque PSK"\ |
| 5115 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5116 | -c "session hash for extended master secret"\ |
| 5117 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5118 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5119 | -S "SSL - Unknown identity received" \ |
| 5120 | -S "SSL - Verification of the message MAC failed" |
| 5121 | |
| 5122 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5123 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5124 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5125 | "$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] | 5126 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5127 | 0 \ |
| 5128 | -c "skip PMS generation for opaque PSK"\ |
| 5129 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5130 | -c "session hash for extended master secret"\ |
| 5131 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5132 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5133 | -S "SSL - Unknown identity received" \ |
| 5134 | -S "SSL - Verification of the message MAC failed" |
| 5135 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5136 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5137 | 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] | 5138 | "$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] | 5139 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5140 | psk_identity=foo psk=abc123" \ |
| 5141 | 0 \ |
| 5142 | -C "skip PMS generation for opaque PSK"\ |
| 5143 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5144 | -C "session hash for extended master secret"\ |
| 5145 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5146 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5147 | -S "SSL - Unknown identity received" \ |
| 5148 | -S "SSL - Verification of the message MAC failed" |
| 5149 | |
| 5150 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5151 | 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] | 5152 | "$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] | 5153 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5154 | psk_identity=foo psk=abc123" \ |
| 5155 | 0 \ |
| 5156 | -C "skip PMS generation for opaque PSK"\ |
| 5157 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5158 | -C "session hash for extended master secret"\ |
| 5159 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5160 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5161 | -S "SSL - Unknown identity received" \ |
| 5162 | -S "SSL - Verification of the message MAC failed" |
| 5163 | |
| 5164 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5165 | 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] | 5166 | "$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] | 5167 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5168 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5169 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5170 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5171 | -c "session hash for extended master secret"\ |
| 5172 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5173 | -C "skip PMS generation for opaque PSK"\ |
| 5174 | -s "skip PMS generation for opaque PSK"\ |
| 5175 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5176 | -S "SSL - Unknown identity received" \ |
| 5177 | -S "SSL - Verification of the message MAC failed" |
| 5178 | |
| 5179 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5180 | 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] | 5181 | "$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] | 5182 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5183 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5184 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5185 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5186 | -c "session hash for extended master secret"\ |
| 5187 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5188 | -C "skip PMS generation for opaque PSK"\ |
| 5189 | -s "skip PMS generation for opaque PSK"\ |
| 5190 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5191 | -S "SSL - Unknown identity received" \ |
| 5192 | -S "SSL - Verification of the message MAC failed" |
| 5193 | |
| 5194 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5195 | 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] | 5196 | "$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] | 5197 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5198 | psk_identity=def psk=beef" \ |
| 5199 | 0 \ |
| 5200 | -C "skip PMS generation for opaque PSK"\ |
| 5201 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5202 | -C "session hash for extended master secret"\ |
| 5203 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5204 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5205 | -S "SSL - Unknown identity received" \ |
| 5206 | -S "SSL - Verification of the message MAC failed" |
| 5207 | |
| 5208 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5209 | 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] | 5210 | "$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] | 5211 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5212 | psk_identity=def psk=beef" \ |
| 5213 | 0 \ |
| 5214 | -C "skip PMS generation for opaque PSK"\ |
| 5215 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5216 | -C "session hash for extended master secret"\ |
| 5217 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5218 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5219 | -S "SSL - Unknown identity received" \ |
| 5220 | -S "SSL - Verification of the message MAC failed" |
| 5221 | |
| 5222 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5223 | 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] | 5224 | "$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] | 5225 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5226 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5227 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5228 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5229 | -c "session hash for extended master secret"\ |
| 5230 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5231 | -C "skip PMS generation for opaque PSK"\ |
| 5232 | -s "skip PMS generation for opaque PSK"\ |
| 5233 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5234 | -S "SSL - Unknown identity received" \ |
| 5235 | -S "SSL - Verification of the message MAC failed" |
| 5236 | |
| 5237 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5238 | 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] | 5239 | "$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] | 5240 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5241 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5242 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5243 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5244 | -c "session hash for extended master secret"\ |
| 5245 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5246 | -C "skip PMS generation for opaque PSK"\ |
| 5247 | -s "skip PMS generation for opaque PSK"\ |
| 5248 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5249 | -S "SSL - Unknown identity received" \ |
| 5250 | -S "SSL - Verification of the message MAC failed" |
| 5251 | |
| 5252 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5253 | 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] | 5254 | "$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] | 5255 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5256 | psk_identity=def psk=beef" \ |
| 5257 | 0 \ |
| 5258 | -C "skip PMS generation for opaque PSK"\ |
| 5259 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5260 | -C "session hash for extended master secret"\ |
| 5261 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5262 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5263 | -S "SSL - Unknown identity received" \ |
| 5264 | -S "SSL - Verification of the message MAC failed" |
| 5265 | |
| 5266 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5267 | 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] | 5268 | "$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] | 5269 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5270 | psk_identity=def psk=beef" \ |
| 5271 | 0 \ |
| 5272 | -C "skip PMS generation for opaque PSK"\ |
| 5273 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5274 | -C "session hash for extended master secret"\ |
| 5275 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5276 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5277 | -S "SSL - Unknown identity received" \ |
| 5278 | -S "SSL - Verification of the message MAC failed" |
| 5279 | |
| 5280 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5281 | 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] | 5282 | "$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] | 5283 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5284 | psk_identity=def psk=beef" \ |
| 5285 | 0 \ |
| 5286 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5287 | -C "session hash for extended master secret"\ |
| 5288 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5289 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5290 | -S "SSL - Unknown identity received" \ |
| 5291 | -S "SSL - Verification of the message MAC failed" |
| 5292 | |
| 5293 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5294 | 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] | 5295 | "$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] | 5296 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5297 | psk_identity=def psk=beef" \ |
| 5298 | 0 \ |
| 5299 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5300 | -C "session hash for extended master secret"\ |
| 5301 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5302 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5303 | -S "SSL - Unknown identity received" \ |
| 5304 | -S "SSL - Verification of the message MAC failed" |
| 5305 | |
| 5306 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5307 | 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] | 5308 | "$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] | 5309 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5310 | psk_identity=def psk=beef" \ |
| 5311 | 1 \ |
| 5312 | -s "SSL - Verification of the message MAC failed" |
| 5313 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5315 | "$P_SRV" \ |
| 5316 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5317 | psk_identity=foo psk=abc123" \ |
| 5318 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5319 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5320 | -S "SSL - Unknown identity received" \ |
| 5321 | -S "SSL - Verification of the message MAC failed" |
| 5322 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5323 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5324 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5325 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5326 | psk_identity=foo psk=abc123" \ |
| 5327 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5328 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5329 | -s "SSL - Unknown identity received" \ |
| 5330 | -S "SSL - Verification of the message MAC failed" |
| 5331 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5332 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5333 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5334 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5335 | psk_identity=abc psk=dead" \ |
| 5336 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5337 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5338 | -S "SSL - Unknown identity received" \ |
| 5339 | -S "SSL - Verification of the message MAC failed" |
| 5340 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5341 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5342 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5343 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5344 | psk_identity=def psk=beef" \ |
| 5345 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5346 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5347 | -S "SSL - Unknown identity received" \ |
| 5348 | -S "SSL - Verification of the message MAC failed" |
| 5349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5350 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5351 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5352 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5353 | psk_identity=ghi psk=beef" \ |
| 5354 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5355 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5356 | -s "SSL - Unknown identity received" \ |
| 5357 | -S "SSL - Verification of the message MAC failed" |
| 5358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5359 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5360 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5361 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5362 | psk_identity=abc psk=beef" \ |
| 5363 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5364 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5365 | -S "SSL - Unknown identity received" \ |
| 5366 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5367 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5368 | # Tests for EC J-PAKE |
| 5369 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5371 | run_test "ECJPAKE: client not configured" \ |
| 5372 | "$P_SRV debug_level=3" \ |
| 5373 | "$P_CLI debug_level=3" \ |
| 5374 | 0 \ |
| 5375 | -C "add ciphersuite: c0ff" \ |
| 5376 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5377 | -S "found ecjpake kkpp extension" \ |
| 5378 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5379 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5380 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5381 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5382 | -S "None of the common ciphersuites is usable" |
| 5383 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5384 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5385 | run_test "ECJPAKE: server not configured" \ |
| 5386 | "$P_SRV debug_level=3" \ |
| 5387 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5388 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5389 | 1 \ |
| 5390 | -c "add ciphersuite: c0ff" \ |
| 5391 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5392 | -s "found ecjpake kkpp extension" \ |
| 5393 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5394 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5395 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5396 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5397 | -s "None of the common ciphersuites is usable" |
| 5398 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5399 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5400 | run_test "ECJPAKE: working, TLS" \ |
| 5401 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5402 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5403 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5404 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5405 | -c "add ciphersuite: c0ff" \ |
| 5406 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5407 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5408 | -s "found ecjpake kkpp extension" \ |
| 5409 | -S "skip ecjpake kkpp extension" \ |
| 5410 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5411 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5412 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5413 | -S "None of the common ciphersuites is usable" \ |
| 5414 | -S "SSL - Verification of the message MAC failed" |
| 5415 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5416 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5417 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5418 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5419 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5420 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5421 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5422 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5423 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5424 | -s "SSL - Verification of the message MAC failed" |
| 5425 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5426 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5427 | run_test "ECJPAKE: working, DTLS" \ |
| 5428 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5429 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5430 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5431 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5432 | -c "re-using cached ecjpake parameters" \ |
| 5433 | -S "SSL - Verification of the message MAC failed" |
| 5434 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5435 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5436 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5437 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5438 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5439 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5440 | 0 \ |
| 5441 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5442 | -S "SSL - Verification of the message MAC failed" |
| 5443 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5444 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5445 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5446 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5447 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5448 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5449 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5450 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5451 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5452 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5453 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5454 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5455 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5456 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5457 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5458 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5459 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5460 | 0 |
| 5461 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5462 | # Tests for ciphersuites per version |
| 5463 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5464 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5465 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5466 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5467 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5468 | "$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] | 5469 | "$P_CLI force_version=ssl3" \ |
| 5470 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5471 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5472 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5473 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5474 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5475 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5476 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5477 | "$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] | 5478 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5479 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5480 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5481 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5482 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5483 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5484 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5485 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5486 | "$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] | 5487 | "$P_CLI force_version=tls1_1" \ |
| 5488 | 0 \ |
| 5489 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5490 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5492 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5493 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5494 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5495 | "$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] | 5496 | "$P_CLI force_version=tls1_2" \ |
| 5497 | 0 \ |
| 5498 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5499 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5500 | # Test for ClientHello without extensions |
| 5501 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5502 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5503 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5504 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5505 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5506 | 0 \ |
| 5507 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5508 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5509 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5510 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5511 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5512 | "$P_SRV" \ |
| 5513 | "$P_CLI request_size=100" \ |
| 5514 | 0 \ |
| 5515 | -s "Read from client: 100 bytes read$" |
| 5516 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5517 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5518 | "$P_SRV" \ |
| 5519 | "$P_CLI request_size=500" \ |
| 5520 | 0 \ |
| 5521 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5522 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5523 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5524 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5525 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5526 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5527 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5528 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5529 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5530 | 0 \ |
| 5531 | -s "Read from client: 1 bytes read" |
| 5532 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5533 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5534 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5535 | "$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] | 5536 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5537 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5538 | 0 \ |
| 5539 | -s "Read from client: 1 bytes read" |
| 5540 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5541 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5542 | "$P_SRV" \ |
| 5543 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5544 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5545 | 0 \ |
| 5546 | -s "Read from client: 1 bytes read" |
| 5547 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5548 | 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] | 5549 | "$P_SRV" \ |
| 5550 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5551 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5552 | 0 \ |
| 5553 | -s "Read from client: 1 bytes read" |
| 5554 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5555 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5556 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5557 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5558 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5559 | 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] | 5560 | 0 \ |
| 5561 | -s "Read from client: 1 bytes read" |
| 5562 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5563 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5564 | 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] | 5565 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5566 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5567 | 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] | 5568 | 0 \ |
| 5569 | -s "Read from client: 1 bytes read" |
| 5570 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5571 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5572 | "$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] | 5573 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5574 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5575 | 0 \ |
| 5576 | -s "Read from client: 1 bytes read" |
| 5577 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5578 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5579 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5580 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5581 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5582 | 0 \ |
| 5583 | -s "Read from client: 1 bytes read" |
| 5584 | |
| 5585 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5586 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5587 | "$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] | 5588 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5589 | 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] | 5590 | 0 \ |
| 5591 | -s "Read from client: 1 bytes read" |
| 5592 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5593 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5594 | 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] | 5595 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5596 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5597 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5598 | 0 \ |
| 5599 | -s "Read from client: 1 bytes read" |
| 5600 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5601 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5602 | "$P_SRV" \ |
| 5603 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5604 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5605 | 0 \ |
| 5606 | -s "Read from client: 1 bytes read" |
| 5607 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5608 | 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] | 5609 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5610 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5611 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5612 | 0 \ |
| 5613 | -s "Read from client: 1 bytes read" |
| 5614 | |
| 5615 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5616 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5617 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5618 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5619 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5620 | 0 \ |
| 5621 | -s "Read from client: 1 bytes read" |
| 5622 | |
| 5623 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5624 | 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] | 5625 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5626 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5627 | 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] | 5628 | 0 \ |
| 5629 | -s "Read from client: 1 bytes read" |
| 5630 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5631 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5632 | "$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] | 5633 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5634 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5635 | 0 \ |
| 5636 | -s "Read from client: 1 bytes read" |
| 5637 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5638 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5639 | "$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] | 5640 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5641 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5642 | 0 \ |
| 5643 | -s "Read from client: 1 bytes read" |
| 5644 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5645 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5646 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5647 | "$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] | 5648 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5649 | 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] | 5650 | 0 \ |
| 5651 | -s "Read from client: 1 bytes read" |
| 5652 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5654 | 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] | 5655 | "$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] | 5656 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5657 | 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] | 5658 | 0 \ |
| 5659 | -s "Read from client: 1 bytes read" |
| 5660 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5661 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5662 | "$P_SRV" \ |
| 5663 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5664 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5665 | 0 \ |
| 5666 | -s "Read from client: 1 bytes read" |
| 5667 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5668 | 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] | 5669 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5670 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5671 | 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] | 5672 | 0 \ |
| 5673 | -s "Read from client: 1 bytes read" |
| 5674 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5675 | 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] | 5676 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5677 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5678 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5679 | 0 \ |
| 5680 | -s "Read from client: 1 bytes read" |
| 5681 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5682 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5683 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5684 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5685 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5686 | 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] | 5687 | 0 \ |
| 5688 | -s "Read from client: 1 bytes read" |
| 5689 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5690 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5691 | 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] | 5692 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5693 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5694 | 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] | 5695 | 0 \ |
| 5696 | -s "Read from client: 1 bytes read" |
| 5697 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5698 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5699 | "$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] | 5700 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5701 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5702 | 0 \ |
| 5703 | -s "Read from client: 1 bytes read" |
| 5704 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5705 | 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] | 5706 | "$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] | 5707 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5708 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5709 | 0 \ |
| 5710 | -s "Read from client: 1 bytes read" |
| 5711 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5712 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5713 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5714 | "$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] | 5715 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5716 | 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] | 5717 | 0 \ |
| 5718 | -s "Read from client: 1 bytes read" |
| 5719 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5721 | 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] | 5722 | "$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] | 5723 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5724 | 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] | 5725 | 0 \ |
| 5726 | -s "Read from client: 1 bytes read" |
| 5727 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5728 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5729 | "$P_SRV" \ |
| 5730 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5731 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5732 | 0 \ |
| 5733 | -s "Read from client: 1 bytes read" |
| 5734 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5735 | 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] | 5736 | "$P_SRV" \ |
| 5737 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5738 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5739 | 0 \ |
| 5740 | -s "Read from client: 1 bytes read" |
| 5741 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5742 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5743 | |
| 5744 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5745 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5746 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5747 | "$P_CLI dtls=1 request_size=1 \ |
| 5748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5749 | 0 \ |
| 5750 | -s "Read from client: 1 bytes read" |
| 5751 | |
| 5752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5753 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5754 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5755 | "$P_CLI dtls=1 request_size=1 \ |
| 5756 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5757 | 0 \ |
| 5758 | -s "Read from client: 1 bytes read" |
| 5759 | |
| 5760 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5761 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5762 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5763 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5764 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5765 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5766 | 0 \ |
| 5767 | -s "Read from client: 1 bytes read" |
| 5768 | |
| 5769 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5770 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5771 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5772 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5773 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5774 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5775 | 0 \ |
| 5776 | -s "Read from client: 1 bytes read" |
| 5777 | |
| 5778 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5779 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5780 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5781 | "$P_CLI dtls=1 request_size=1 \ |
| 5782 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5783 | 0 \ |
| 5784 | -s "Read from client: 1 bytes read" |
| 5785 | |
| 5786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5787 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5788 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5789 | "$P_CLI dtls=1 request_size=1 \ |
| 5790 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5791 | 0 \ |
| 5792 | -s "Read from client: 1 bytes read" |
| 5793 | |
| 5794 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5795 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5796 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5797 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5798 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5800 | 0 \ |
| 5801 | -s "Read from client: 1 bytes read" |
| 5802 | |
| 5803 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5804 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5805 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5806 | "$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] | 5807 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5809 | 0 \ |
| 5810 | -s "Read from client: 1 bytes read" |
| 5811 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5812 | # Tests for small server packets |
| 5813 | |
| 5814 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5815 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5816 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5817 | "$P_CLI force_version=ssl3 \ |
| 5818 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5819 | 0 \ |
| 5820 | -c "Read from server: 1 bytes read" |
| 5821 | |
| 5822 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5823 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5824 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5825 | "$P_CLI force_version=ssl3 \ |
| 5826 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5827 | 0 \ |
| 5828 | -c "Read from server: 1 bytes read" |
| 5829 | |
| 5830 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5831 | "$P_SRV response_size=1" \ |
| 5832 | "$P_CLI force_version=tls1 \ |
| 5833 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5834 | 0 \ |
| 5835 | -c "Read from server: 1 bytes read" |
| 5836 | |
| 5837 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5838 | "$P_SRV response_size=1" \ |
| 5839 | "$P_CLI force_version=tls1 etm=0 \ |
| 5840 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5841 | 0 \ |
| 5842 | -c "Read from server: 1 bytes read" |
| 5843 | |
| 5844 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5845 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5846 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5847 | "$P_CLI force_version=tls1 \ |
| 5848 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5849 | 0 \ |
| 5850 | -c "Read from server: 1 bytes read" |
| 5851 | |
| 5852 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5853 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5854 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5855 | "$P_CLI force_version=tls1 \ |
| 5856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5857 | 0 \ |
| 5858 | -c "Read from server: 1 bytes read" |
| 5859 | |
| 5860 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5861 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5862 | "$P_CLI force_version=tls1 \ |
| 5863 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5864 | 0 \ |
| 5865 | -c "Read from server: 1 bytes read" |
| 5866 | |
| 5867 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5868 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5869 | "$P_CLI force_version=tls1 \ |
| 5870 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5871 | 0 \ |
| 5872 | -c "Read from server: 1 bytes read" |
| 5873 | |
| 5874 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5875 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5876 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5877 | "$P_CLI force_version=tls1 \ |
| 5878 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5879 | 0 \ |
| 5880 | -c "Read from server: 1 bytes read" |
| 5881 | |
| 5882 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5883 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5884 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5885 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5886 | trunc_hmac=1 etm=0" \ |
| 5887 | 0 \ |
| 5888 | -c "Read from server: 1 bytes read" |
| 5889 | |
| 5890 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5891 | "$P_SRV response_size=1" \ |
| 5892 | "$P_CLI force_version=tls1_1 \ |
| 5893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5894 | 0 \ |
| 5895 | -c "Read from server: 1 bytes read" |
| 5896 | |
| 5897 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5898 | "$P_SRV response_size=1" \ |
| 5899 | "$P_CLI force_version=tls1_1 \ |
| 5900 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5901 | 0 \ |
| 5902 | -c "Read from server: 1 bytes read" |
| 5903 | |
| 5904 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5905 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5906 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5907 | "$P_CLI force_version=tls1_1 \ |
| 5908 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5909 | 0 \ |
| 5910 | -c "Read from server: 1 bytes read" |
| 5911 | |
| 5912 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5913 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5914 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5915 | "$P_CLI force_version=tls1_1 \ |
| 5916 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5917 | 0 \ |
| 5918 | -c "Read from server: 1 bytes read" |
| 5919 | |
| 5920 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5921 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5922 | "$P_CLI force_version=tls1_1 \ |
| 5923 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5924 | 0 \ |
| 5925 | -c "Read from server: 1 bytes read" |
| 5926 | |
| 5927 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5928 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5929 | "$P_CLI force_version=tls1_1 \ |
| 5930 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5931 | 0 \ |
| 5932 | -c "Read from server: 1 bytes read" |
| 5933 | |
| 5934 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5935 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5936 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5937 | "$P_CLI force_version=tls1_1 \ |
| 5938 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5939 | 0 \ |
| 5940 | -c "Read from server: 1 bytes read" |
| 5941 | |
| 5942 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5943 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5944 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5945 | "$P_CLI force_version=tls1_1 \ |
| 5946 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5947 | 0 \ |
| 5948 | -c "Read from server: 1 bytes read" |
| 5949 | |
| 5950 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5951 | "$P_SRV response_size=1" \ |
| 5952 | "$P_CLI force_version=tls1_2 \ |
| 5953 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5954 | 0 \ |
| 5955 | -c "Read from server: 1 bytes read" |
| 5956 | |
| 5957 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5958 | "$P_SRV response_size=1" \ |
| 5959 | "$P_CLI force_version=tls1_2 \ |
| 5960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5961 | 0 \ |
| 5962 | -c "Read from server: 1 bytes read" |
| 5963 | |
| 5964 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5965 | "$P_SRV response_size=1" \ |
| 5966 | "$P_CLI force_version=tls1_2 \ |
| 5967 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5968 | 0 \ |
| 5969 | -c "Read from server: 1 bytes read" |
| 5970 | |
| 5971 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5972 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5973 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5974 | "$P_CLI force_version=tls1_2 \ |
| 5975 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5976 | 0 \ |
| 5977 | -c "Read from server: 1 bytes read" |
| 5978 | |
| 5979 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5980 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5981 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5982 | "$P_CLI force_version=tls1_2 \ |
| 5983 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5984 | 0 \ |
| 5985 | -c "Read from server: 1 bytes read" |
| 5986 | |
| 5987 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5988 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5989 | "$P_CLI force_version=tls1_2 \ |
| 5990 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5991 | 0 \ |
| 5992 | -c "Read from server: 1 bytes read" |
| 5993 | |
| 5994 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5995 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5996 | "$P_CLI force_version=tls1_2 \ |
| 5997 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5998 | 0 \ |
| 5999 | -c "Read from server: 1 bytes read" |
| 6000 | |
| 6001 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6002 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6003 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6004 | "$P_CLI force_version=tls1_2 \ |
| 6005 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6006 | 0 \ |
| 6007 | -c "Read from server: 1 bytes read" |
| 6008 | |
| 6009 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6010 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6011 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6012 | "$P_CLI force_version=tls1_2 \ |
| 6013 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6014 | 0 \ |
| 6015 | -c "Read from server: 1 bytes read" |
| 6016 | |
| 6017 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6018 | "$P_SRV response_size=1" \ |
| 6019 | "$P_CLI force_version=tls1_2 \ |
| 6020 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6021 | 0 \ |
| 6022 | -c "Read from server: 1 bytes read" |
| 6023 | |
| 6024 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6025 | "$P_SRV response_size=1" \ |
| 6026 | "$P_CLI force_version=tls1_2 \ |
| 6027 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6028 | 0 \ |
| 6029 | -c "Read from server: 1 bytes read" |
| 6030 | |
| 6031 | # Tests for small server packets in DTLS |
| 6032 | |
| 6033 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6034 | run_test "Small server packet DTLS 1.0" \ |
| 6035 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6036 | "$P_CLI dtls=1 \ |
| 6037 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6038 | 0 \ |
| 6039 | -c "Read from server: 1 bytes read" |
| 6040 | |
| 6041 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6042 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6043 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6044 | "$P_CLI dtls=1 \ |
| 6045 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6046 | 0 \ |
| 6047 | -c "Read from server: 1 bytes read" |
| 6048 | |
| 6049 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6050 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6051 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6052 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6053 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6054 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6055 | 0 \ |
| 6056 | -c "Read from server: 1 bytes read" |
| 6057 | |
| 6058 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6059 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6060 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6061 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6062 | "$P_CLI dtls=1 \ |
| 6063 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6064 | 0 \ |
| 6065 | -c "Read from server: 1 bytes read" |
| 6066 | |
| 6067 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6068 | run_test "Small server packet DTLS 1.2" \ |
| 6069 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6070 | "$P_CLI dtls=1 \ |
| 6071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6072 | 0 \ |
| 6073 | -c "Read from server: 1 bytes read" |
| 6074 | |
| 6075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6076 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6077 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6078 | "$P_CLI dtls=1 \ |
| 6079 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6080 | 0 \ |
| 6081 | -c "Read from server: 1 bytes read" |
| 6082 | |
| 6083 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6084 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6085 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6086 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6087 | "$P_CLI dtls=1 \ |
| 6088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6089 | 0 \ |
| 6090 | -c "Read from server: 1 bytes read" |
| 6091 | |
| 6092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6093 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6094 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6095 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6096 | "$P_CLI dtls=1 \ |
| 6097 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6098 | 0 \ |
| 6099 | -c "Read from server: 1 bytes read" |
| 6100 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6101 | # A test for extensions in SSLv3 |
| 6102 | |
| 6103 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6104 | run_test "SSLv3 with extensions, server side" \ |
| 6105 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6106 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6107 | 0 \ |
| 6108 | -S "dumping 'client hello extensions'" \ |
| 6109 | -S "server hello, total extension length:" |
| 6110 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6111 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6112 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6113 | # How many fragments do we expect to write $1 bytes? |
| 6114 | fragments_for_write() { |
| 6115 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6116 | } |
| 6117 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6118 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6119 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6120 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6121 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6122 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6123 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6124 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6125 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6126 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6127 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6128 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6129 | "$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] | 6130 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6131 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6132 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6133 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6134 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6135 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6136 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6137 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6138 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6139 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6140 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6141 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6142 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6143 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6144 | 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] | 6145 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6146 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6147 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6148 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6149 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6150 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6151 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6152 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6153 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6154 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6155 | 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] | 6156 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6157 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6158 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6159 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6160 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6161 | 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] | 6162 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6163 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6164 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6165 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6166 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6167 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6168 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6169 | "$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] | 6170 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6171 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6172 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6173 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6174 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6175 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6176 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6177 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6178 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6179 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6180 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6181 | |
| 6182 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6183 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6184 | "$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] | 6185 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6186 | 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] | 6187 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6188 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6189 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6191 | 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] | 6192 | "$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] | 6193 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6194 | 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] | 6195 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6196 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6197 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6198 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6199 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6200 | "$P_SRV" \ |
| 6201 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6202 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6203 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6204 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6205 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6206 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6207 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6208 | "$P_SRV" \ |
| 6209 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6210 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6211 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6212 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6213 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6214 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6215 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6216 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6217 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6218 | 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] | 6219 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6220 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6221 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6222 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6223 | 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] | 6224 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6225 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6226 | 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] | 6227 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6228 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6229 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6230 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6231 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6232 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6233 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6234 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6235 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6236 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6237 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6238 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6239 | "$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] | 6240 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6241 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6242 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6243 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6244 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6245 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6246 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6247 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6248 | "$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] | 6249 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6250 | 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] | 6251 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6252 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6253 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6255 | 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] | 6256 | "$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] | 6257 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6258 | 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] | 6259 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6260 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6261 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6262 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6263 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6264 | "$P_SRV" \ |
| 6265 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6266 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6267 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6268 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6269 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6270 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6271 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6272 | "$P_SRV" \ |
| 6273 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6274 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6275 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6276 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6277 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6278 | 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] | 6279 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6280 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6281 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6282 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6283 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6284 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6285 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6286 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6287 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6288 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6289 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6290 | 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] | 6291 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6292 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6293 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6294 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6295 | 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] | 6296 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6297 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6298 | 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] | 6299 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6300 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6301 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6302 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6303 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6304 | "$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] | 6305 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6306 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6307 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6308 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6309 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6310 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6311 | 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] | 6312 | "$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] | 6313 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6314 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6315 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6316 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6317 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6318 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6319 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6320 | "$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] | 6321 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6322 | 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] | 6323 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6324 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6325 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6326 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6327 | 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] | 6328 | "$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] | 6329 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6330 | 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] | 6331 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6332 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6333 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6334 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6335 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6336 | "$P_SRV" \ |
| 6337 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6338 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6339 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6340 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6341 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6342 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6343 | 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] | 6344 | "$P_SRV" \ |
| 6345 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6346 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6347 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6348 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6349 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6350 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6351 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6352 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6353 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6354 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6355 | "$P_CLI force_version=ssl3 \ |
| 6356 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6357 | 0 \ |
| 6358 | -c "Read from server: 16384 bytes read" |
| 6359 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6360 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6361 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6362 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6363 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6364 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6365 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6366 | 0 \ |
| 6367 | -c "Read from server: 1 bytes read"\ |
| 6368 | -c "16383 bytes read"\ |
| 6369 | -C "Read from server: 16384 bytes read" |
| 6370 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6371 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6372 | "$P_SRV response_size=16384" \ |
| 6373 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6374 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6375 | 0 \ |
| 6376 | -c "Read from server: 1 bytes read"\ |
| 6377 | -c "16383 bytes read"\ |
| 6378 | -C "Read from server: 16384 bytes read" |
| 6379 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6380 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6381 | "$P_SRV response_size=16384" \ |
| 6382 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6383 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6384 | 0 \ |
| 6385 | -c "Read from server: 1 bytes read"\ |
| 6386 | -c "16383 bytes read"\ |
| 6387 | -C "Read from server: 16384 bytes read" |
| 6388 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6389 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6390 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6391 | "$P_SRV response_size=16384" \ |
| 6392 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6393 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6394 | trunc_hmac=1" \ |
| 6395 | 0 \ |
| 6396 | -c "Read from server: 1 bytes read"\ |
| 6397 | -c "16383 bytes read"\ |
| 6398 | -C "Read from server: 16384 bytes read" |
| 6399 | |
| 6400 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6401 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6402 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6403 | "$P_CLI force_version=tls1 \ |
| 6404 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6405 | trunc_hmac=1" \ |
| 6406 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6407 | -s "16384 bytes written in 1 fragments" \ |
| 6408 | -c "Read from server: 16384 bytes read" |
| 6409 | |
| 6410 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6411 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6412 | "$P_CLI force_version=tls1 \ |
| 6413 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6414 | 0 \ |
| 6415 | -s "16384 bytes written in 1 fragments" \ |
| 6416 | -c "Read from server: 16384 bytes read" |
| 6417 | |
| 6418 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6419 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6420 | "$P_CLI force_version=tls1 \ |
| 6421 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6422 | 0 \ |
| 6423 | -s "16384 bytes written in 1 fragments" \ |
| 6424 | -c "Read from server: 16384 bytes read" |
| 6425 | |
| 6426 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6427 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6428 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6429 | "$P_CLI force_version=tls1 \ |
| 6430 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6431 | 0 \ |
| 6432 | -s "16384 bytes written in 1 fragments" \ |
| 6433 | -c "Read from server: 16384 bytes read" |
| 6434 | |
| 6435 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6436 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6437 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6438 | "$P_CLI force_version=tls1 \ |
| 6439 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6440 | 0 \ |
| 6441 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6442 | -c "Read from server: 16384 bytes read" |
| 6443 | |
| 6444 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6445 | "$P_SRV response_size=16384" \ |
| 6446 | "$P_CLI force_version=tls1_1 \ |
| 6447 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6448 | 0 \ |
| 6449 | -c "Read from server: 16384 bytes read" |
| 6450 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6451 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6452 | "$P_SRV response_size=16384" \ |
| 6453 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6454 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6455 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6456 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6457 | -c "Read from server: 16384 bytes read" |
| 6458 | |
| 6459 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6460 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6461 | "$P_SRV response_size=16384" \ |
| 6462 | "$P_CLI force_version=tls1_1 \ |
| 6463 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6464 | trunc_hmac=1" \ |
| 6465 | 0 \ |
| 6466 | -c "Read from server: 16384 bytes read" |
| 6467 | |
| 6468 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6469 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6470 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6471 | "$P_CLI force_version=tls1_1 \ |
| 6472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6473 | 0 \ |
| 6474 | -s "16384 bytes written in 1 fragments" \ |
| 6475 | -c "Read from server: 16384 bytes read" |
| 6476 | |
| 6477 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6478 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6479 | "$P_CLI force_version=tls1_1 \ |
| 6480 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6481 | 0 \ |
| 6482 | -c "Read from server: 16384 bytes read" |
| 6483 | |
| 6484 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6485 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6486 | "$P_CLI force_version=tls1_1 \ |
| 6487 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6488 | 0 \ |
| 6489 | -s "16384 bytes written in 1 fragments" \ |
| 6490 | -c "Read from server: 16384 bytes read" |
| 6491 | |
| 6492 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6493 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6494 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6495 | "$P_CLI force_version=tls1_1 \ |
| 6496 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6497 | trunc_hmac=1" \ |
| 6498 | 0 \ |
| 6499 | -c "Read from server: 16384 bytes read" |
| 6500 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6501 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6502 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6503 | "$P_CLI force_version=tls1_1 \ |
| 6504 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6505 | 0 \ |
| 6506 | -s "16384 bytes written in 1 fragments" \ |
| 6507 | -c "Read from server: 16384 bytes read" |
| 6508 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6509 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6510 | "$P_SRV response_size=16384" \ |
| 6511 | "$P_CLI force_version=tls1_2 \ |
| 6512 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6513 | 0 \ |
| 6514 | -c "Read from server: 16384 bytes read" |
| 6515 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6516 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6517 | "$P_SRV response_size=16384" \ |
| 6518 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6520 | 0 \ |
| 6521 | -s "16384 bytes written in 1 fragments" \ |
| 6522 | -c "Read from server: 16384 bytes read" |
| 6523 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6524 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6525 | "$P_SRV response_size=16384" \ |
| 6526 | "$P_CLI force_version=tls1_2 \ |
| 6527 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6528 | 0 \ |
| 6529 | -c "Read from server: 16384 bytes read" |
| 6530 | |
| 6531 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6532 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6533 | "$P_SRV response_size=16384" \ |
| 6534 | "$P_CLI force_version=tls1_2 \ |
| 6535 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6536 | trunc_hmac=1" \ |
| 6537 | 0 \ |
| 6538 | -c "Read from server: 16384 bytes read" |
| 6539 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6540 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6541 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6542 | "$P_CLI force_version=tls1_2 \ |
| 6543 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6544 | 0 \ |
| 6545 | -s "16384 bytes written in 1 fragments" \ |
| 6546 | -c "Read from server: 16384 bytes read" |
| 6547 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6548 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6549 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6550 | "$P_CLI force_version=tls1_2 \ |
| 6551 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6552 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6553 | -s "16384 bytes written in 1 fragments" \ |
| 6554 | -c "Read from server: 16384 bytes read" |
| 6555 | |
| 6556 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6557 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6558 | "$P_CLI force_version=tls1_2 \ |
| 6559 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6560 | 0 \ |
| 6561 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6562 | -c "Read from server: 16384 bytes read" |
| 6563 | |
| 6564 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6565 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6566 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6567 | "$P_CLI force_version=tls1_2 \ |
| 6568 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6569 | trunc_hmac=1" \ |
| 6570 | 0 \ |
| 6571 | -c "Read from server: 16384 bytes read" |
| 6572 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6573 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6574 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6575 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6576 | "$P_CLI force_version=tls1_2 \ |
| 6577 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6578 | 0 \ |
| 6579 | -s "16384 bytes written in 1 fragments" \ |
| 6580 | -c "Read from server: 16384 bytes read" |
| 6581 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6582 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6583 | "$P_SRV response_size=16384" \ |
| 6584 | "$P_CLI force_version=tls1_2 \ |
| 6585 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6586 | 0 \ |
| 6587 | -c "Read from server: 16384 bytes read" |
| 6588 | |
| 6589 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6590 | "$P_SRV response_size=16384" \ |
| 6591 | "$P_CLI force_version=tls1_2 \ |
| 6592 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6593 | 0 \ |
| 6594 | -c "Read from server: 16384 bytes read" |
| 6595 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6596 | # Tests for restartable ECC |
| 6597 | |
| 6598 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6599 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6600 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6601 | "$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] | 6602 | 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] | 6603 | debug_level=1" \ |
| 6604 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6605 | -C "x509_verify_cert.*4b00" \ |
| 6606 | -C "mbedtls_pk_verify.*4b00" \ |
| 6607 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6608 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6609 | |
| 6610 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6611 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6612 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6613 | "$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] | 6614 | 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] | 6615 | debug_level=1 ec_max_ops=0" \ |
| 6616 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6617 | -C "x509_verify_cert.*4b00" \ |
| 6618 | -C "mbedtls_pk_verify.*4b00" \ |
| 6619 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6620 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6621 | |
| 6622 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6623 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6624 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6625 | "$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] | 6626 | 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] | 6627 | debug_level=1 ec_max_ops=65535" \ |
| 6628 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6629 | -C "x509_verify_cert.*4b00" \ |
| 6630 | -C "mbedtls_pk_verify.*4b00" \ |
| 6631 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6632 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6633 | |
| 6634 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6635 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6636 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6637 | "$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] | 6638 | 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] | 6639 | debug_level=1 ec_max_ops=1000" \ |
| 6640 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6641 | -c "x509_verify_cert.*4b00" \ |
| 6642 | -c "mbedtls_pk_verify.*4b00" \ |
| 6643 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6644 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6645 | |
| 6646 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6647 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6648 | "$P_SRV auth_mode=required \ |
| 6649 | crt_file=data_files/server5-badsign.crt \ |
| 6650 | key_file=data_files/server5.key" \ |
| 6651 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6652 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6653 | debug_level=1 ec_max_ops=1000" \ |
| 6654 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6655 | -c "x509_verify_cert.*4b00" \ |
| 6656 | -C "mbedtls_pk_verify.*4b00" \ |
| 6657 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6658 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6659 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6660 | -c "! mbedtls_ssl_handshake returned" \ |
| 6661 | -c "X509 - Certificate verification failed" |
| 6662 | |
| 6663 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6664 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6665 | "$P_SRV auth_mode=required \ |
| 6666 | crt_file=data_files/server5-badsign.crt \ |
| 6667 | key_file=data_files/server5.key" \ |
| 6668 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6669 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6670 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6671 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6672 | -c "x509_verify_cert.*4b00" \ |
| 6673 | -c "mbedtls_pk_verify.*4b00" \ |
| 6674 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6675 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6676 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6677 | -C "! mbedtls_ssl_handshake returned" \ |
| 6678 | -C "X509 - Certificate verification failed" |
| 6679 | |
| 6680 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6681 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6682 | "$P_SRV auth_mode=required \ |
| 6683 | crt_file=data_files/server5-badsign.crt \ |
| 6684 | key_file=data_files/server5.key" \ |
| 6685 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6686 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6687 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6688 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6689 | -C "x509_verify_cert.*4b00" \ |
| 6690 | -c "mbedtls_pk_verify.*4b00" \ |
| 6691 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6692 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6693 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6694 | -C "! mbedtls_ssl_handshake returned" \ |
| 6695 | -C "X509 - Certificate verification failed" |
| 6696 | |
| 6697 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6698 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6699 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6700 | "$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] | 6701 | 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] | 6702 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6703 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6704 | -c "x509_verify_cert.*4b00" \ |
| 6705 | -c "mbedtls_pk_verify.*4b00" \ |
| 6706 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6707 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6708 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6709 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6710 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6711 | "$P_SRV" \ |
| 6712 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6713 | debug_level=1 ec_max_ops=1000" \ |
| 6714 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6715 | -c "x509_verify_cert.*4b00" \ |
| 6716 | -c "mbedtls_pk_verify.*4b00" \ |
| 6717 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6718 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6719 | |
| 6720 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6721 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6722 | "$P_SRV psk=abc123" \ |
| 6723 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6724 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6725 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6726 | -C "x509_verify_cert.*4b00" \ |
| 6727 | -C "mbedtls_pk_verify.*4b00" \ |
| 6728 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6729 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6730 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6731 | # Tests of asynchronous private key support in SSL |
| 6732 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6734 | run_test "SSL async private: sign, delay=0" \ |
| 6735 | "$P_SRV \ |
| 6736 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6737 | "$P_CLI" \ |
| 6738 | 0 \ |
| 6739 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6740 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6741 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6743 | run_test "SSL async private: sign, delay=1" \ |
| 6744 | "$P_SRV \ |
| 6745 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6746 | "$P_CLI" \ |
| 6747 | 0 \ |
| 6748 | -s "Async sign callback: using key slot " \ |
| 6749 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6750 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6751 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6752 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6753 | run_test "SSL async private: sign, delay=2" \ |
| 6754 | "$P_SRV \ |
| 6755 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6756 | "$P_CLI" \ |
| 6757 | 0 \ |
| 6758 | -s "Async sign callback: using key slot " \ |
| 6759 | -U "Async sign callback: using key slot " \ |
| 6760 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6761 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6762 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6763 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6764 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6765 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6766 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6768 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6769 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6770 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6771 | "$P_CLI force_version=tls1_1" \ |
| 6772 | 0 \ |
| 6773 | -s "Async sign callback: using key slot " \ |
| 6774 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6775 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6776 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6777 | run_test "SSL async private: sign, SNI" \ |
| 6778 | "$P_SRV debug_level=3 \ |
| 6779 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6780 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6781 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6782 | "$P_CLI server_name=polarssl.example" \ |
| 6783 | 0 \ |
| 6784 | -s "Async sign callback: using key slot " \ |
| 6785 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6786 | -s "parse ServerName extension" \ |
| 6787 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6788 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6789 | |
| 6790 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6791 | run_test "SSL async private: decrypt, delay=0" \ |
| 6792 | "$P_SRV \ |
| 6793 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6794 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6795 | 0 \ |
| 6796 | -s "Async decrypt callback: using key slot " \ |
| 6797 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6798 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6799 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6800 | run_test "SSL async private: decrypt, delay=1" \ |
| 6801 | "$P_SRV \ |
| 6802 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6803 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6804 | 0 \ |
| 6805 | -s "Async decrypt callback: using key slot " \ |
| 6806 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6807 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6808 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6809 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6810 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6811 | "$P_SRV psk=abc123 \ |
| 6812 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6813 | "$P_CLI psk=abc123 \ |
| 6814 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6815 | 0 \ |
| 6816 | -s "Async decrypt callback: using key slot " \ |
| 6817 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6818 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6819 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6820 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6821 | "$P_SRV psk=abc123 \ |
| 6822 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6823 | "$P_CLI psk=abc123 \ |
| 6824 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6825 | 0 \ |
| 6826 | -s "Async decrypt callback: using key slot " \ |
| 6827 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6828 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6829 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6831 | run_test "SSL async private: sign callback not present" \ |
| 6832 | "$P_SRV \ |
| 6833 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6834 | "$P_CLI; [ \$? -eq 1 ] && |
| 6835 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6836 | 0 \ |
| 6837 | -S "Async sign callback" \ |
| 6838 | -s "! mbedtls_ssl_handshake returned" \ |
| 6839 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6840 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6841 | -s "Successful connection" |
| 6842 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6843 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6844 | run_test "SSL async private: decrypt callback not present" \ |
| 6845 | "$P_SRV debug_level=1 \ |
| 6846 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6847 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6848 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6849 | 0 \ |
| 6850 | -S "Async decrypt callback" \ |
| 6851 | -s "! mbedtls_ssl_handshake returned" \ |
| 6852 | -s "got no RSA private key" \ |
| 6853 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6854 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6855 | |
| 6856 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6857 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6858 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6859 | "$P_SRV \ |
| 6860 | async_operations=s async_private_delay1=1 \ |
| 6861 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6862 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6863 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6864 | 0 \ |
| 6865 | -s "Async sign callback: using key slot 0," \ |
| 6866 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6867 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6868 | |
| 6869 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6870 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6871 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6872 | "$P_SRV \ |
| 6873 | async_operations=s async_private_delay2=1 \ |
| 6874 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6875 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6876 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6877 | 0 \ |
| 6878 | -s "Async sign callback: using key slot 0," \ |
| 6879 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6880 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6881 | |
| 6882 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6883 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6884 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6885 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6886 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6887 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6888 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6889 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6890 | 0 \ |
| 6891 | -s "Async sign callback: using key slot 1," \ |
| 6892 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6893 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6894 | |
| 6895 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6896 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6897 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6898 | "$P_SRV \ |
| 6899 | async_operations=s async_private_delay1=1 \ |
| 6900 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6901 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6902 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6903 | 0 \ |
| 6904 | -s "Async sign callback: no key matches this certificate." |
| 6905 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6906 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6907 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6908 | "$P_SRV \ |
| 6909 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6910 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6911 | "$P_CLI" \ |
| 6912 | 1 \ |
| 6913 | -s "Async sign callback: injected error" \ |
| 6914 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6915 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6916 | -s "! mbedtls_ssl_handshake returned" |
| 6917 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6918 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6919 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6920 | "$P_SRV \ |
| 6921 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6922 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6923 | "$P_CLI" \ |
| 6924 | 1 \ |
| 6925 | -s "Async sign callback: using key slot " \ |
| 6926 | -S "Async resume" \ |
| 6927 | -s "Async cancel" |
| 6928 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6929 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6930 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6931 | "$P_SRV \ |
| 6932 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6933 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6934 | "$P_CLI" \ |
| 6935 | 1 \ |
| 6936 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6937 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6938 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6939 | -s "! mbedtls_ssl_handshake returned" |
| 6940 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6941 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6942 | run_test "SSL async private: decrypt, error in start" \ |
| 6943 | "$P_SRV \ |
| 6944 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6945 | async_private_error=1" \ |
| 6946 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6947 | 1 \ |
| 6948 | -s "Async decrypt callback: injected error" \ |
| 6949 | -S "Async resume" \ |
| 6950 | -S "Async cancel" \ |
| 6951 | -s "! mbedtls_ssl_handshake returned" |
| 6952 | |
| 6953 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6954 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6955 | "$P_SRV \ |
| 6956 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6957 | async_private_error=2" \ |
| 6958 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6959 | 1 \ |
| 6960 | -s "Async decrypt callback: using key slot " \ |
| 6961 | -S "Async resume" \ |
| 6962 | -s "Async cancel" |
| 6963 | |
| 6964 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6965 | run_test "SSL async private: decrypt, error in resume" \ |
| 6966 | "$P_SRV \ |
| 6967 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6968 | async_private_error=3" \ |
| 6969 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6970 | 1 \ |
| 6971 | -s "Async decrypt callback: using key slot " \ |
| 6972 | -s "Async resume callback: decrypt done but injected error" \ |
| 6973 | -S "Async cancel" \ |
| 6974 | -s "! mbedtls_ssl_handshake returned" |
| 6975 | |
| 6976 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6977 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6978 | "$P_SRV \ |
| 6979 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6980 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6981 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6982 | 0 \ |
| 6983 | -s "Async cancel" \ |
| 6984 | -s "! mbedtls_ssl_handshake returned" \ |
| 6985 | -s "Async resume" \ |
| 6986 | -s "Successful connection" |
| 6987 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6988 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6989 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6990 | "$P_SRV \ |
| 6991 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6992 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6993 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6994 | 0 \ |
| 6995 | -s "! mbedtls_ssl_handshake returned" \ |
| 6996 | -s "Async resume" \ |
| 6997 | -s "Successful connection" |
| 6998 | |
| 6999 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7000 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7001 | 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] | 7002 | "$P_SRV \ |
| 7003 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7004 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7005 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7006 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7007 | [ \$? -eq 1 ] && |
| 7008 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7009 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7010 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7011 | -S "Async resume" \ |
| 7012 | -s "Async cancel" \ |
| 7013 | -s "! mbedtls_ssl_handshake returned" \ |
| 7014 | -s "Async sign callback: no key matches this certificate." \ |
| 7015 | -s "Successful connection" |
| 7016 | |
| 7017 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7018 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7019 | 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] | 7020 | "$P_SRV \ |
| 7021 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7022 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7023 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7024 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7025 | [ \$? -eq 1 ] && |
| 7026 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7027 | 0 \ |
| 7028 | -s "Async resume" \ |
| 7029 | -s "! mbedtls_ssl_handshake returned" \ |
| 7030 | -s "Async sign callback: no key matches this certificate." \ |
| 7031 | -s "Successful connection" |
| 7032 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7033 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7035 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7036 | "$P_SRV \ |
| 7037 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7038 | exchanges=2 renegotiation=1" \ |
| 7039 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7040 | 0 \ |
| 7041 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7042 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7043 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7044 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7046 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7047 | "$P_SRV \ |
| 7048 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7049 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7050 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7051 | 0 \ |
| 7052 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7053 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7054 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7055 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7056 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7057 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7058 | "$P_SRV \ |
| 7059 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7060 | exchanges=2 renegotiation=1" \ |
| 7061 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7062 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7063 | 0 \ |
| 7064 | -s "Async decrypt callback: using key slot " \ |
| 7065 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7066 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7069 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7070 | "$P_SRV \ |
| 7071 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7072 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7073 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7074 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7075 | 0 \ |
| 7076 | -s "Async decrypt callback: using key slot " \ |
| 7077 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7078 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7079 | # Tests for ECC extensions (rfc 4492) |
| 7080 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7081 | requires_config_enabled MBEDTLS_AES_C |
| 7082 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7083 | requires_config_enabled MBEDTLS_SHA256_C |
| 7084 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7085 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7086 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7087 | "$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] | 7088 | 0 \ |
| 7089 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7090 | -C "client hello, adding supported_point_formats extension" \ |
| 7091 | -S "found supported elliptic curves extension" \ |
| 7092 | -S "found supported point formats extension" |
| 7093 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7094 | requires_config_enabled MBEDTLS_AES_C |
| 7095 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7096 | requires_config_enabled MBEDTLS_SHA256_C |
| 7097 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7098 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7099 | "$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] | 7100 | "$P_CLI debug_level=3" \ |
| 7101 | 0 \ |
| 7102 | -C "found supported_point_formats extension" \ |
| 7103 | -S "server hello, supported_point_formats extension" |
| 7104 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_AES_C |
| 7106 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7107 | requires_config_enabled MBEDTLS_SHA256_C |
| 7108 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7109 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7110 | "$P_SRV debug_level=3" \ |
| 7111 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7112 | 0 \ |
| 7113 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7114 | -c "client hello, adding supported_point_formats extension" \ |
| 7115 | -s "found supported elliptic curves extension" \ |
| 7116 | -s "found supported point formats extension" |
| 7117 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_AES_C |
| 7119 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7120 | requires_config_enabled MBEDTLS_SHA256_C |
| 7121 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7122 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7123 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7124 | "$P_CLI debug_level=3" \ |
| 7125 | 0 \ |
| 7126 | -c "found supported_point_formats extension" \ |
| 7127 | -s "server hello, supported_point_formats extension" |
| 7128 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7129 | # Tests for DTLS HelloVerifyRequest |
| 7130 | |
| 7131 | run_test "DTLS cookie: enabled" \ |
| 7132 | "$P_SRV dtls=1 debug_level=2" \ |
| 7133 | "$P_CLI dtls=1 debug_level=2" \ |
| 7134 | 0 \ |
| 7135 | -s "cookie verification failed" \ |
| 7136 | -s "cookie verification passed" \ |
| 7137 | -S "cookie verification skipped" \ |
| 7138 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7139 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7140 | -S "SSL - The requested feature is not available" |
| 7141 | |
| 7142 | run_test "DTLS cookie: disabled" \ |
| 7143 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7144 | "$P_CLI dtls=1 debug_level=2" \ |
| 7145 | 0 \ |
| 7146 | -S "cookie verification failed" \ |
| 7147 | -S "cookie verification passed" \ |
| 7148 | -s "cookie verification skipped" \ |
| 7149 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7150 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7151 | -S "SSL - The requested feature is not available" |
| 7152 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7153 | run_test "DTLS cookie: default (failing)" \ |
| 7154 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7155 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7156 | 1 \ |
| 7157 | -s "cookie verification failed" \ |
| 7158 | -S "cookie verification passed" \ |
| 7159 | -S "cookie verification skipped" \ |
| 7160 | -C "received hello verify request" \ |
| 7161 | -S "hello verification requested" \ |
| 7162 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7163 | |
| 7164 | requires_ipv6 |
| 7165 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7166 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7167 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7168 | 0 \ |
| 7169 | -s "cookie verification failed" \ |
| 7170 | -s "cookie verification passed" \ |
| 7171 | -S "cookie verification skipped" \ |
| 7172 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7173 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7174 | -S "SSL - The requested feature is not available" |
| 7175 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7176 | run_test "DTLS cookie: enabled, nbio" \ |
| 7177 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7178 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7179 | 0 \ |
| 7180 | -s "cookie verification failed" \ |
| 7181 | -s "cookie verification passed" \ |
| 7182 | -S "cookie verification skipped" \ |
| 7183 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7184 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7185 | -S "SSL - The requested feature is not available" |
| 7186 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7187 | # Tests for client reconnecting from the same port with DTLS |
| 7188 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7189 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7190 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7191 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7192 | "$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] | 7193 | 0 \ |
| 7194 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7195 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7196 | -S "Client initiated reconnection from same port" |
| 7197 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7198 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7199 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7200 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7201 | "$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] | 7202 | 0 \ |
| 7203 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7204 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7205 | -s "Client initiated reconnection from same port" |
| 7206 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7207 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7208 | 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] | 7209 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7210 | "$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] | 7211 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7212 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7213 | -s "Client initiated reconnection from same port" |
| 7214 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7215 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7216 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7217 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7218 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7219 | 0 \ |
| 7220 | -S "The operation timed out" \ |
| 7221 | -s "Client initiated reconnection from same port" |
| 7222 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7223 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7224 | "$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] | 7225 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7226 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7227 | -s "The operation timed out" \ |
| 7228 | -S "Client initiated reconnection from same port" |
| 7229 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7230 | # Tests for various cases of client authentication with DTLS |
| 7231 | # (focused on handshake flows and message parsing) |
| 7232 | |
| 7233 | run_test "DTLS client auth: required" \ |
| 7234 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7235 | "$P_CLI dtls=1" \ |
| 7236 | 0 \ |
| 7237 | -s "Verifying peer X.509 certificate... ok" |
| 7238 | |
| 7239 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7240 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7241 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7242 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7243 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7244 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7245 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7246 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7247 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7248 | 0 \ |
| 7249 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7250 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7251 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7252 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7253 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7254 | "$P_CLI dtls=1 psk=abc124" \ |
| 7255 | 1 \ |
| 7256 | -s "SSL - Verification of the message MAC failed" \ |
| 7257 | -c "SSL - A fatal alert message was received from our peer" |
| 7258 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7259 | # Tests for receiving fragmented handshake messages with DTLS |
| 7260 | |
| 7261 | requires_gnutls |
| 7262 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7263 | "$G_SRV -u --mtu 2048 -a" \ |
| 7264 | "$P_CLI dtls=1 debug_level=2" \ |
| 7265 | 0 \ |
| 7266 | -C "found fragmented DTLS handshake message" \ |
| 7267 | -C "error" |
| 7268 | |
| 7269 | requires_gnutls |
| 7270 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7271 | "$G_SRV -u --mtu 512" \ |
| 7272 | "$P_CLI dtls=1 debug_level=2" \ |
| 7273 | 0 \ |
| 7274 | -c "found fragmented DTLS handshake message" \ |
| 7275 | -C "error" |
| 7276 | |
| 7277 | requires_gnutls |
| 7278 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7279 | "$G_SRV -u --mtu 128" \ |
| 7280 | "$P_CLI dtls=1 debug_level=2" \ |
| 7281 | 0 \ |
| 7282 | -c "found fragmented DTLS handshake message" \ |
| 7283 | -C "error" |
| 7284 | |
| 7285 | requires_gnutls |
| 7286 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7287 | "$G_SRV -u --mtu 128" \ |
| 7288 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7289 | 0 \ |
| 7290 | -c "found fragmented DTLS handshake message" \ |
| 7291 | -C "error" |
| 7292 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7293 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7294 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7295 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7296 | "$G_SRV -u --mtu 256" \ |
| 7297 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7298 | 0 \ |
| 7299 | -c "found fragmented DTLS handshake message" \ |
| 7300 | -c "client hello, adding renegotiation extension" \ |
| 7301 | -c "found renegotiation extension" \ |
| 7302 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7303 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7304 | -C "error" \ |
| 7305 | -s "Extra-header:" |
| 7306 | |
| 7307 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7308 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7309 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7310 | "$G_SRV -u --mtu 256" \ |
| 7311 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7312 | 0 \ |
| 7313 | -c "found fragmented DTLS handshake message" \ |
| 7314 | -c "client hello, adding renegotiation extension" \ |
| 7315 | -c "found renegotiation extension" \ |
| 7316 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7317 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7318 | -C "error" \ |
| 7319 | -s "Extra-header:" |
| 7320 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7321 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7322 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7323 | "$P_CLI dtls=1 debug_level=2" \ |
| 7324 | 0 \ |
| 7325 | -C "found fragmented DTLS handshake message" \ |
| 7326 | -C "error" |
| 7327 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7328 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7329 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7330 | "$P_CLI dtls=1 debug_level=2" \ |
| 7331 | 0 \ |
| 7332 | -c "found fragmented DTLS handshake message" \ |
| 7333 | -C "error" |
| 7334 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7335 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7336 | "$O_SRV -dtls1 -mtu 256" \ |
| 7337 | "$P_CLI dtls=1 debug_level=2" \ |
| 7338 | 0 \ |
| 7339 | -c "found fragmented DTLS handshake message" \ |
| 7340 | -C "error" |
| 7341 | |
| 7342 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7343 | "$O_SRV -dtls1 -mtu 256" \ |
| 7344 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7345 | 0 \ |
| 7346 | -c "found fragmented DTLS handshake message" \ |
| 7347 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7348 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7349 | # Tests for sending fragmented handshake messages with DTLS |
| 7350 | # |
| 7351 | # Use client auth when we need the client to send large messages, |
| 7352 | # and use large cert chains on both sides too (the long chains we have all use |
| 7353 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7354 | # Sizes reached (UDP payload): |
| 7355 | # - 2037B for server certificate |
| 7356 | # - 1542B for client certificate |
| 7357 | # - 1013B for newsessionticket |
| 7358 | # - all others below 512B |
| 7359 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7360 | |
| 7361 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7362 | requires_config_enabled MBEDTLS_RSA_C |
| 7363 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7364 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7365 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7366 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7367 | crt_file=data_files/server7_int-ca.crt \ |
| 7368 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7369 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7370 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7371 | "$P_CLI dtls=1 debug_level=2 \ |
| 7372 | crt_file=data_files/server8_int-ca2.crt \ |
| 7373 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7374 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7375 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7376 | 0 \ |
| 7377 | -S "found fragmented DTLS handshake message" \ |
| 7378 | -C "found fragmented DTLS handshake message" \ |
| 7379 | -C "error" |
| 7380 | |
| 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7382 | requires_config_enabled MBEDTLS_RSA_C |
| 7383 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7384 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7385 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7386 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7387 | crt_file=data_files/server7_int-ca.crt \ |
| 7388 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7389 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7390 | max_frag_len=1024" \ |
| 7391 | "$P_CLI dtls=1 debug_level=2 \ |
| 7392 | crt_file=data_files/server8_int-ca2.crt \ |
| 7393 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7394 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7395 | max_frag_len=2048" \ |
| 7396 | 0 \ |
| 7397 | -S "found fragmented DTLS handshake message" \ |
| 7398 | -c "found fragmented DTLS handshake message" \ |
| 7399 | -C "error" |
| 7400 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7401 | # With the MFL extension, the server has no way of forcing |
| 7402 | # the client to not exceed a certain MTU; hence, the following |
| 7403 | # test can't be replicated with an MTU proxy such as the one |
| 7404 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7405 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7406 | requires_config_enabled MBEDTLS_RSA_C |
| 7407 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7408 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7409 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7410 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7411 | crt_file=data_files/server7_int-ca.crt \ |
| 7412 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7413 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7414 | max_frag_len=512" \ |
| 7415 | "$P_CLI dtls=1 debug_level=2 \ |
| 7416 | crt_file=data_files/server8_int-ca2.crt \ |
| 7417 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7418 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7419 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7420 | 0 \ |
| 7421 | -S "found fragmented DTLS handshake message" \ |
| 7422 | -c "found fragmented DTLS handshake message" \ |
| 7423 | -C "error" |
| 7424 | |
| 7425 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7426 | requires_config_enabled MBEDTLS_RSA_C |
| 7427 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7428 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7429 | 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] | 7430 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7431 | crt_file=data_files/server7_int-ca.crt \ |
| 7432 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7433 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7434 | max_frag_len=2048" \ |
| 7435 | "$P_CLI dtls=1 debug_level=2 \ |
| 7436 | crt_file=data_files/server8_int-ca2.crt \ |
| 7437 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7438 | hs_timeout=2500-60000 \ |
| 7439 | max_frag_len=1024" \ |
| 7440 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7441 | -S "found fragmented DTLS handshake message" \ |
| 7442 | -c "found fragmented DTLS handshake message" \ |
| 7443 | -C "error" |
| 7444 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7445 | # While not required by the standard defining the MFL extension |
| 7446 | # (according to which it only applies to records, not to datagrams), |
| 7447 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7448 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7449 | # to the peer. |
| 7450 | # The next test checks that no datagrams significantly larger than the |
| 7451 | # negotiated MFL are sent. |
| 7452 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7453 | requires_config_enabled MBEDTLS_RSA_C |
| 7454 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7455 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7456 | 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] | 7457 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7458 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7459 | crt_file=data_files/server7_int-ca.crt \ |
| 7460 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7461 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7462 | max_frag_len=2048" \ |
| 7463 | "$P_CLI dtls=1 debug_level=2 \ |
| 7464 | crt_file=data_files/server8_int-ca2.crt \ |
| 7465 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7466 | hs_timeout=2500-60000 \ |
| 7467 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7468 | 0 \ |
| 7469 | -S "found fragmented DTLS handshake message" \ |
| 7470 | -c "found fragmented DTLS handshake message" \ |
| 7471 | -C "error" |
| 7472 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7474 | requires_config_enabled MBEDTLS_RSA_C |
| 7475 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7476 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7477 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7478 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7479 | crt_file=data_files/server7_int-ca.crt \ |
| 7480 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7481 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7482 | max_frag_len=2048" \ |
| 7483 | "$P_CLI dtls=1 debug_level=2 \ |
| 7484 | crt_file=data_files/server8_int-ca2.crt \ |
| 7485 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7486 | hs_timeout=2500-60000 \ |
| 7487 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7488 | 0 \ |
| 7489 | -s "found fragmented DTLS handshake message" \ |
| 7490 | -c "found fragmented DTLS handshake message" \ |
| 7491 | -C "error" |
| 7492 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7493 | # While not required by the standard defining the MFL extension |
| 7494 | # (according to which it only applies to records, not to datagrams), |
| 7495 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7496 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7497 | # to the peer. |
| 7498 | # The next test checks that no datagrams significantly larger than the |
| 7499 | # negotiated MFL are sent. |
| 7500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7501 | requires_config_enabled MBEDTLS_RSA_C |
| 7502 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7503 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7504 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7505 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7506 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7507 | crt_file=data_files/server7_int-ca.crt \ |
| 7508 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7509 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7510 | max_frag_len=2048" \ |
| 7511 | "$P_CLI dtls=1 debug_level=2 \ |
| 7512 | crt_file=data_files/server8_int-ca2.crt \ |
| 7513 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7514 | hs_timeout=2500-60000 \ |
| 7515 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7516 | 0 \ |
| 7517 | -s "found fragmented DTLS handshake message" \ |
| 7518 | -c "found fragmented DTLS handshake message" \ |
| 7519 | -C "error" |
| 7520 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7521 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7522 | requires_config_enabled MBEDTLS_RSA_C |
| 7523 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7524 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7525 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7526 | crt_file=data_files/server7_int-ca.crt \ |
| 7527 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7528 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7529 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7530 | "$P_CLI dtls=1 debug_level=2 \ |
| 7531 | crt_file=data_files/server8_int-ca2.crt \ |
| 7532 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7533 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7534 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7535 | 0 \ |
| 7536 | -S "found fragmented DTLS handshake message" \ |
| 7537 | -C "found fragmented DTLS handshake message" \ |
| 7538 | -C "error" |
| 7539 | |
| 7540 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7541 | requires_config_enabled MBEDTLS_RSA_C |
| 7542 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7543 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7544 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7545 | crt_file=data_files/server7_int-ca.crt \ |
| 7546 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7547 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7548 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7549 | "$P_CLI dtls=1 debug_level=2 \ |
| 7550 | crt_file=data_files/server8_int-ca2.crt \ |
| 7551 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7552 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7553 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7554 | 0 \ |
| 7555 | -s "found fragmented DTLS handshake message" \ |
| 7556 | -C "found fragmented DTLS handshake message" \ |
| 7557 | -C "error" |
| 7558 | |
| 7559 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7560 | requires_config_enabled MBEDTLS_RSA_C |
| 7561 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7562 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7563 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7564 | crt_file=data_files/server7_int-ca.crt \ |
| 7565 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7566 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7567 | mtu=512" \ |
| 7568 | "$P_CLI dtls=1 debug_level=2 \ |
| 7569 | crt_file=data_files/server8_int-ca2.crt \ |
| 7570 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7571 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7572 | mtu=2048" \ |
| 7573 | 0 \ |
| 7574 | -S "found fragmented DTLS handshake message" \ |
| 7575 | -c "found fragmented DTLS handshake message" \ |
| 7576 | -C "error" |
| 7577 | |
| 7578 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7579 | requires_config_enabled MBEDTLS_RSA_C |
| 7580 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7581 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7582 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7583 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7584 | crt_file=data_files/server7_int-ca.crt \ |
| 7585 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7586 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7587 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7588 | "$P_CLI dtls=1 debug_level=2 \ |
| 7589 | crt_file=data_files/server8_int-ca2.crt \ |
| 7590 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7591 | hs_timeout=2500-60000 \ |
| 7592 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7593 | 0 \ |
| 7594 | -s "found fragmented DTLS handshake message" \ |
| 7595 | -c "found fragmented DTLS handshake message" \ |
| 7596 | -C "error" |
| 7597 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7598 | # 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] | 7599 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7600 | requires_config_enabled MBEDTLS_RSA_C |
| 7601 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7602 | requires_config_enabled MBEDTLS_SHA256_C |
| 7603 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7604 | requires_config_enabled MBEDTLS_AES_C |
| 7605 | requires_config_enabled MBEDTLS_GCM_C |
| 7606 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7607 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7608 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7609 | crt_file=data_files/server7_int-ca.crt \ |
| 7610 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7611 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7612 | mtu=512" \ |
| 7613 | "$P_CLI dtls=1 debug_level=2 \ |
| 7614 | crt_file=data_files/server8_int-ca2.crt \ |
| 7615 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7616 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7617 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7618 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7619 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7620 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7621 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7622 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7623 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7624 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7625 | # 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] | 7626 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7627 | # retransmissions, but in some cases (like both the server and client using |
| 7628 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7629 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7630 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7632 | requires_config_enabled MBEDTLS_RSA_C |
| 7633 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7634 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7635 | requires_config_enabled MBEDTLS_AES_C |
| 7636 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7637 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7638 | -p "$P_PXY mtu=508" \ |
| 7639 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7640 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7641 | key_file=data_files/server7.key \ |
| 7642 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7643 | "$P_CLI dtls=1 debug_level=2 \ |
| 7644 | crt_file=data_files/server8_int-ca2.crt \ |
| 7645 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7646 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7647 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7648 | 0 \ |
| 7649 | -s "found fragmented DTLS handshake message" \ |
| 7650 | -c "found fragmented DTLS handshake message" \ |
| 7651 | -C "error" |
| 7652 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7653 | # 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] | 7654 | only_with_valgrind |
| 7655 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7656 | requires_config_enabled MBEDTLS_RSA_C |
| 7657 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7658 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7659 | requires_config_enabled MBEDTLS_AES_C |
| 7660 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7661 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7662 | -p "$P_PXY mtu=508" \ |
| 7663 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7664 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7665 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7666 | hs_timeout=250-10000" \ |
| 7667 | "$P_CLI dtls=1 debug_level=2 \ |
| 7668 | crt_file=data_files/server8_int-ca2.crt \ |
| 7669 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7670 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7671 | hs_timeout=250-10000" \ |
| 7672 | 0 \ |
| 7673 | -s "found fragmented DTLS handshake message" \ |
| 7674 | -c "found fragmented DTLS handshake message" \ |
| 7675 | -C "error" |
| 7676 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7677 | # 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] | 7678 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7679 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7680 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7681 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7682 | requires_config_enabled MBEDTLS_RSA_C |
| 7683 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7684 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7685 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7686 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7687 | crt_file=data_files/server7_int-ca.crt \ |
| 7688 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7689 | hs_timeout=10000-60000 \ |
| 7690 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7691 | "$P_CLI dtls=1 debug_level=2 \ |
| 7692 | crt_file=data_files/server8_int-ca2.crt \ |
| 7693 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7694 | hs_timeout=10000-60000 \ |
| 7695 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7696 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7697 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7698 | -s "found fragmented DTLS handshake message" \ |
| 7699 | -c "found fragmented DTLS handshake message" \ |
| 7700 | -C "error" |
| 7701 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7702 | # 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] | 7703 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7704 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7705 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7706 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7707 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7708 | requires_config_enabled MBEDTLS_RSA_C |
| 7709 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7710 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7711 | requires_config_enabled MBEDTLS_AES_C |
| 7712 | requires_config_enabled MBEDTLS_GCM_C |
| 7713 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7714 | -p "$P_PXY mtu=512" \ |
| 7715 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7716 | crt_file=data_files/server7_int-ca.crt \ |
| 7717 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7718 | hs_timeout=10000-60000 \ |
| 7719 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7720 | "$P_CLI dtls=1 debug_level=2 \ |
| 7721 | crt_file=data_files/server8_int-ca2.crt \ |
| 7722 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7723 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7724 | hs_timeout=10000-60000 \ |
| 7725 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7726 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7727 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7728 | -s "found fragmented DTLS handshake message" \ |
| 7729 | -c "found fragmented DTLS handshake message" \ |
| 7730 | -C "error" |
| 7731 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7732 | not_with_valgrind # spurious autoreduction due to timeout |
| 7733 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7734 | requires_config_enabled MBEDTLS_RSA_C |
| 7735 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7736 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7737 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7738 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7739 | crt_file=data_files/server7_int-ca.crt \ |
| 7740 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7741 | hs_timeout=10000-60000 \ |
| 7742 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7743 | "$P_CLI dtls=1 debug_level=2 \ |
| 7744 | crt_file=data_files/server8_int-ca2.crt \ |
| 7745 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7746 | hs_timeout=10000-60000 \ |
| 7747 | mtu=1024 nbio=2" \ |
| 7748 | 0 \ |
| 7749 | -S "autoreduction" \ |
| 7750 | -s "found fragmented DTLS handshake message" \ |
| 7751 | -c "found fragmented DTLS handshake message" \ |
| 7752 | -C "error" |
| 7753 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7754 | # 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] | 7755 | not_with_valgrind # spurious autoreduction due to timeout |
| 7756 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7757 | requires_config_enabled MBEDTLS_RSA_C |
| 7758 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7759 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7760 | requires_config_enabled MBEDTLS_AES_C |
| 7761 | requires_config_enabled MBEDTLS_GCM_C |
| 7762 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7763 | -p "$P_PXY mtu=512" \ |
| 7764 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7765 | crt_file=data_files/server7_int-ca.crt \ |
| 7766 | key_file=data_files/server7.key \ |
| 7767 | hs_timeout=10000-60000 \ |
| 7768 | mtu=512 nbio=2" \ |
| 7769 | "$P_CLI dtls=1 debug_level=2 \ |
| 7770 | crt_file=data_files/server8_int-ca2.crt \ |
| 7771 | key_file=data_files/server8.key \ |
| 7772 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7773 | hs_timeout=10000-60000 \ |
| 7774 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7775 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7776 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7777 | -s "found fragmented DTLS handshake message" \ |
| 7778 | -c "found fragmented DTLS handshake message" \ |
| 7779 | -C "error" |
| 7780 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7781 | # 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] | 7782 | # This ensures things still work after session_reset(). |
| 7783 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7784 | # Since we don't support reading fragmented ClientHello yet, |
| 7785 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7786 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7787 | # An autoreduction on the client-side might happen if the server is |
| 7788 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7789 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7790 | # resumed listening, which would result in a spurious autoreduction. |
| 7791 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7793 | requires_config_enabled MBEDTLS_RSA_C |
| 7794 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7795 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7796 | requires_config_enabled MBEDTLS_AES_C |
| 7797 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7798 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7799 | -p "$P_PXY mtu=1450" \ |
| 7800 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7801 | crt_file=data_files/server7_int-ca.crt \ |
| 7802 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7803 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7804 | mtu=1450" \ |
| 7805 | "$P_CLI dtls=1 debug_level=2 \ |
| 7806 | crt_file=data_files/server8_int-ca2.crt \ |
| 7807 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7808 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7809 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7810 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7811 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7812 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7813 | -s "found fragmented DTLS handshake message" \ |
| 7814 | -c "found fragmented DTLS handshake message" \ |
| 7815 | -C "error" |
| 7816 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7817 | # An autoreduction on the client-side might happen if the server is |
| 7818 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7819 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7820 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7821 | requires_config_enabled MBEDTLS_RSA_C |
| 7822 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7823 | requires_config_enabled MBEDTLS_SHA256_C |
| 7824 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7825 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7826 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7827 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7828 | -p "$P_PXY mtu=512" \ |
| 7829 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7830 | crt_file=data_files/server7_int-ca.crt \ |
| 7831 | key_file=data_files/server7.key \ |
| 7832 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7833 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7834 | mtu=512" \ |
| 7835 | "$P_CLI dtls=1 debug_level=2 \ |
| 7836 | crt_file=data_files/server8_int-ca2.crt \ |
| 7837 | key_file=data_files/server8.key \ |
| 7838 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7839 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7840 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7841 | mtu=512" \ |
| 7842 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7843 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7844 | -s "found fragmented DTLS handshake message" \ |
| 7845 | -c "found fragmented DTLS handshake message" \ |
| 7846 | -C "error" |
| 7847 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7848 | # An autoreduction on the client-side might happen if the server is |
| 7849 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7850 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7851 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7852 | requires_config_enabled MBEDTLS_RSA_C |
| 7853 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7854 | requires_config_enabled MBEDTLS_SHA256_C |
| 7855 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7856 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7857 | requires_config_enabled MBEDTLS_AES_C |
| 7858 | requires_config_enabled MBEDTLS_GCM_C |
| 7859 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7860 | -p "$P_PXY mtu=512" \ |
| 7861 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7862 | crt_file=data_files/server7_int-ca.crt \ |
| 7863 | key_file=data_files/server7.key \ |
| 7864 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7865 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7866 | mtu=512" \ |
| 7867 | "$P_CLI dtls=1 debug_level=2 \ |
| 7868 | crt_file=data_files/server8_int-ca2.crt \ |
| 7869 | key_file=data_files/server8.key \ |
| 7870 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7871 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7872 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7873 | mtu=512" \ |
| 7874 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7875 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7876 | -s "found fragmented DTLS handshake message" \ |
| 7877 | -c "found fragmented DTLS handshake message" \ |
| 7878 | -C "error" |
| 7879 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7880 | # An autoreduction on the client-side might happen if the server is |
| 7881 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7882 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7883 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7884 | requires_config_enabled MBEDTLS_RSA_C |
| 7885 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7886 | requires_config_enabled MBEDTLS_SHA256_C |
| 7887 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7888 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7889 | requires_config_enabled MBEDTLS_AES_C |
| 7890 | requires_config_enabled MBEDTLS_CCM_C |
| 7891 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7892 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7893 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7894 | crt_file=data_files/server7_int-ca.crt \ |
| 7895 | key_file=data_files/server7.key \ |
| 7896 | exchanges=2 renegotiation=1 \ |
| 7897 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7898 | hs_timeout=10000-60000 \ |
| 7899 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7900 | "$P_CLI dtls=1 debug_level=2 \ |
| 7901 | crt_file=data_files/server8_int-ca2.crt \ |
| 7902 | key_file=data_files/server8.key \ |
| 7903 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7904 | hs_timeout=10000-60000 \ |
| 7905 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7906 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7907 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7908 | -s "found fragmented DTLS handshake message" \ |
| 7909 | -c "found fragmented DTLS handshake message" \ |
| 7910 | -C "error" |
| 7911 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7912 | # An autoreduction on the client-side might happen if the server is |
| 7913 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7914 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7915 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7916 | requires_config_enabled MBEDTLS_RSA_C |
| 7917 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7918 | requires_config_enabled MBEDTLS_SHA256_C |
| 7919 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7920 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7921 | requires_config_enabled MBEDTLS_AES_C |
| 7922 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7923 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7924 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7925 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7926 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7927 | crt_file=data_files/server7_int-ca.crt \ |
| 7928 | key_file=data_files/server7.key \ |
| 7929 | exchanges=2 renegotiation=1 \ |
| 7930 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7931 | hs_timeout=10000-60000 \ |
| 7932 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7933 | "$P_CLI dtls=1 debug_level=2 \ |
| 7934 | crt_file=data_files/server8_int-ca2.crt \ |
| 7935 | key_file=data_files/server8.key \ |
| 7936 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7937 | hs_timeout=10000-60000 \ |
| 7938 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7939 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7940 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7941 | -s "found fragmented DTLS handshake message" \ |
| 7942 | -c "found fragmented DTLS handshake message" \ |
| 7943 | -C "error" |
| 7944 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7945 | # An autoreduction on the client-side might happen if the server is |
| 7946 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7947 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7948 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7949 | requires_config_enabled MBEDTLS_RSA_C |
| 7950 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7951 | requires_config_enabled MBEDTLS_SHA256_C |
| 7952 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7953 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7954 | requires_config_enabled MBEDTLS_AES_C |
| 7955 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7956 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7957 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7958 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7959 | crt_file=data_files/server7_int-ca.crt \ |
| 7960 | key_file=data_files/server7.key \ |
| 7961 | exchanges=2 renegotiation=1 \ |
| 7962 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7963 | hs_timeout=10000-60000 \ |
| 7964 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7965 | "$P_CLI dtls=1 debug_level=2 \ |
| 7966 | crt_file=data_files/server8_int-ca2.crt \ |
| 7967 | key_file=data_files/server8.key \ |
| 7968 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7969 | hs_timeout=10000-60000 \ |
| 7970 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7971 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7972 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7973 | -s "found fragmented DTLS handshake message" \ |
| 7974 | -c "found fragmented DTLS handshake message" \ |
| 7975 | -C "error" |
| 7976 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7977 | # 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] | 7978 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7979 | requires_config_enabled MBEDTLS_RSA_C |
| 7980 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7981 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7982 | requires_config_enabled MBEDTLS_AES_C |
| 7983 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7984 | client_needs_more_time 2 |
| 7985 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7986 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7987 | "$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] | 7988 | crt_file=data_files/server7_int-ca.crt \ |
| 7989 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7990 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7991 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7992 | crt_file=data_files/server8_int-ca2.crt \ |
| 7993 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7994 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7995 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7996 | 0 \ |
| 7997 | -s "found fragmented DTLS handshake message" \ |
| 7998 | -c "found fragmented DTLS handshake message" \ |
| 7999 | -C "error" |
| 8000 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8001 | # 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] | 8002 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8003 | requires_config_enabled MBEDTLS_RSA_C |
| 8004 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8005 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8006 | requires_config_enabled MBEDTLS_AES_C |
| 8007 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8008 | client_needs_more_time 2 |
| 8009 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8010 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8011 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8012 | crt_file=data_files/server7_int-ca.crt \ |
| 8013 | key_file=data_files/server7.key \ |
| 8014 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8015 | "$P_CLI dtls=1 debug_level=2 \ |
| 8016 | crt_file=data_files/server8_int-ca2.crt \ |
| 8017 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8018 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8019 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8020 | 0 \ |
| 8021 | -s "found fragmented DTLS handshake message" \ |
| 8022 | -c "found fragmented DTLS handshake message" \ |
| 8023 | -C "error" |
| 8024 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8025 | # interop tests for DTLS fragmentating with reliable connection |
| 8026 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8027 | # here and below we just want to test that the we fragment in a way that |
| 8028 | # pleases other implementations, so we don't need the peer to fragment |
| 8029 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8030 | requires_config_enabled MBEDTLS_RSA_C |
| 8031 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8033 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8034 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8035 | "$G_SRV -u" \ |
| 8036 | "$P_CLI dtls=1 debug_level=2 \ |
| 8037 | crt_file=data_files/server8_int-ca2.crt \ |
| 8038 | key_file=data_files/server8.key \ |
| 8039 | mtu=512 force_version=dtls1_2" \ |
| 8040 | 0 \ |
| 8041 | -c "fragmenting handshake message" \ |
| 8042 | -C "error" |
| 8043 | |
| 8044 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8045 | requires_config_enabled MBEDTLS_RSA_C |
| 8046 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8047 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8048 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8049 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8050 | "$G_SRV -u" \ |
| 8051 | "$P_CLI dtls=1 debug_level=2 \ |
| 8052 | crt_file=data_files/server8_int-ca2.crt \ |
| 8053 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8054 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8055 | 0 \ |
| 8056 | -c "fragmenting handshake message" \ |
| 8057 | -C "error" |
| 8058 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8059 | # We use --insecure for the GnuTLS client because it expects |
| 8060 | # the hostname / IP it connects to to be the name used in the |
| 8061 | # certificate obtained from the server. Here, however, it |
| 8062 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8063 | # as the server name in the certificate. This will make the |
| 8064 | # certifiate validation fail, but passing --insecure makes |
| 8065 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8066 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8067 | requires_config_enabled MBEDTLS_RSA_C |
| 8068 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8070 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8071 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8072 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8073 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8074 | crt_file=data_files/server7_int-ca.crt \ |
| 8075 | key_file=data_files/server7.key \ |
| 8076 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8077 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8078 | 0 \ |
| 8079 | -s "fragmenting handshake message" |
| 8080 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8081 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8082 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8083 | requires_config_enabled MBEDTLS_RSA_C |
| 8084 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8086 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8087 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8088 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8089 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8090 | crt_file=data_files/server7_int-ca.crt \ |
| 8091 | key_file=data_files/server7.key \ |
| 8092 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8093 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8094 | 0 \ |
| 8095 | -s "fragmenting handshake message" |
| 8096 | |
| 8097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8098 | requires_config_enabled MBEDTLS_RSA_C |
| 8099 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8101 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8102 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8103 | "$P_CLI dtls=1 debug_level=2 \ |
| 8104 | crt_file=data_files/server8_int-ca2.crt \ |
| 8105 | key_file=data_files/server8.key \ |
| 8106 | mtu=512 force_version=dtls1_2" \ |
| 8107 | 0 \ |
| 8108 | -c "fragmenting handshake message" \ |
| 8109 | -C "error" |
| 8110 | |
| 8111 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8112 | requires_config_enabled MBEDTLS_RSA_C |
| 8113 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8115 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8116 | "$O_SRV -dtls1 -verify 10" \ |
| 8117 | "$P_CLI dtls=1 debug_level=2 \ |
| 8118 | crt_file=data_files/server8_int-ca2.crt \ |
| 8119 | key_file=data_files/server8.key \ |
| 8120 | mtu=512 force_version=dtls1" \ |
| 8121 | 0 \ |
| 8122 | -c "fragmenting handshake message" \ |
| 8123 | -C "error" |
| 8124 | |
| 8125 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8126 | requires_config_enabled MBEDTLS_RSA_C |
| 8127 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8128 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8129 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8130 | "$P_SRV dtls=1 debug_level=2 \ |
| 8131 | crt_file=data_files/server7_int-ca.crt \ |
| 8132 | key_file=data_files/server7.key \ |
| 8133 | mtu=512 force_version=dtls1_2" \ |
| 8134 | "$O_CLI -dtls1_2" \ |
| 8135 | 0 \ |
| 8136 | -s "fragmenting handshake message" |
| 8137 | |
| 8138 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8139 | requires_config_enabled MBEDTLS_RSA_C |
| 8140 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8141 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8142 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8143 | "$P_SRV dtls=1 debug_level=2 \ |
| 8144 | crt_file=data_files/server7_int-ca.crt \ |
| 8145 | key_file=data_files/server7.key \ |
| 8146 | mtu=512 force_version=dtls1" \ |
| 8147 | "$O_CLI -dtls1" \ |
| 8148 | 0 \ |
| 8149 | -s "fragmenting handshake message" |
| 8150 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8151 | # interop tests for DTLS fragmentating with unreliable connection |
| 8152 | # |
| 8153 | # again we just want to test that the we fragment in a way that |
| 8154 | # pleases other implementations, so we don't need the peer to fragment |
| 8155 | requires_gnutls_next |
| 8156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8157 | requires_config_enabled MBEDTLS_RSA_C |
| 8158 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8159 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8160 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8161 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8162 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8163 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8164 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8165 | crt_file=data_files/server8_int-ca2.crt \ |
| 8166 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8167 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8168 | 0 \ |
| 8169 | -c "fragmenting handshake message" \ |
| 8170 | -C "error" |
| 8171 | |
| 8172 | requires_gnutls_next |
| 8173 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8174 | requires_config_enabled MBEDTLS_RSA_C |
| 8175 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8176 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8177 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8178 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8179 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8180 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8181 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8182 | crt_file=data_files/server8_int-ca2.crt \ |
| 8183 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8184 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8185 | 0 \ |
| 8186 | -c "fragmenting handshake message" \ |
| 8187 | -C "error" |
| 8188 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8189 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8190 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8191 | requires_config_enabled MBEDTLS_RSA_C |
| 8192 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8194 | client_needs_more_time 4 |
| 8195 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8196 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8197 | "$P_SRV dtls=1 debug_level=2 \ |
| 8198 | crt_file=data_files/server7_int-ca.crt \ |
| 8199 | key_file=data_files/server7.key \ |
| 8200 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8201 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8202 | 0 \ |
| 8203 | -s "fragmenting handshake message" |
| 8204 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8205 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8206 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8207 | requires_config_enabled MBEDTLS_RSA_C |
| 8208 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8210 | client_needs_more_time 4 |
| 8211 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8212 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8213 | "$P_SRV dtls=1 debug_level=2 \ |
| 8214 | crt_file=data_files/server7_int-ca.crt \ |
| 8215 | key_file=data_files/server7.key \ |
| 8216 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8217 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8218 | 0 \ |
| 8219 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8220 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8221 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8222 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8223 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8224 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8225 | ## (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] | 8226 | skip_next_test |
| 8227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8228 | requires_config_enabled MBEDTLS_RSA_C |
| 8229 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8230 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8231 | client_needs_more_time 4 |
| 8232 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8233 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8234 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8235 | "$P_CLI dtls=1 debug_level=2 \ |
| 8236 | crt_file=data_files/server8_int-ca2.crt \ |
| 8237 | key_file=data_files/server8.key \ |
| 8238 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8239 | 0 \ |
| 8240 | -c "fragmenting handshake message" \ |
| 8241 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8242 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8243 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8244 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8245 | requires_config_enabled MBEDTLS_RSA_C |
| 8246 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8248 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8249 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8250 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8251 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8252 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8253 | crt_file=data_files/server8_int-ca2.crt \ |
| 8254 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8255 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8256 | 0 \ |
| 8257 | -c "fragmenting handshake message" \ |
| 8258 | -C "error" |
| 8259 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8260 | skip_next_test |
| 8261 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8262 | requires_config_enabled MBEDTLS_RSA_C |
| 8263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8265 | client_needs_more_time 4 |
| 8266 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8267 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8268 | "$P_SRV dtls=1 debug_level=2 \ |
| 8269 | crt_file=data_files/server7_int-ca.crt \ |
| 8270 | key_file=data_files/server7.key \ |
| 8271 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8272 | "$O_CLI -dtls1_2" \ |
| 8273 | 0 \ |
| 8274 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8275 | |
| 8276 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8277 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8278 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8279 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8280 | requires_config_enabled MBEDTLS_RSA_C |
| 8281 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8282 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8283 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8284 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8285 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8286 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8287 | crt_file=data_files/server7_int-ca.crt \ |
| 8288 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8289 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8290 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8291 | 0 \ |
| 8292 | -s "fragmenting handshake message" |
| 8293 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8294 | # Tests for specific things with "unreliable" UDP connection |
| 8295 | |
| 8296 | not_with_valgrind # spurious resend due to timeout |
| 8297 | run_test "DTLS proxy: reference" \ |
| 8298 | -p "$P_PXY" \ |
| 8299 | "$P_SRV dtls=1 debug_level=2" \ |
| 8300 | "$P_CLI dtls=1 debug_level=2" \ |
| 8301 | 0 \ |
| 8302 | -C "replayed record" \ |
| 8303 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8304 | -C "Buffer record from epoch" \ |
| 8305 | -S "Buffer record from epoch" \ |
| 8306 | -C "ssl_buffer_message" \ |
| 8307 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8308 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8309 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8310 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8311 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8312 | -c "HTTP/1.0 200 OK" |
| 8313 | |
| 8314 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8315 | run_test "DTLS proxy: duplicate every packet" \ |
| 8316 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8317 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8318 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8319 | 0 \ |
| 8320 | -c "replayed record" \ |
| 8321 | -s "replayed record" \ |
| 8322 | -c "record from another epoch" \ |
| 8323 | -s "record from another epoch" \ |
| 8324 | -S "resend" \ |
| 8325 | -s "Extra-header:" \ |
| 8326 | -c "HTTP/1.0 200 OK" |
| 8327 | |
| 8328 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8329 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8330 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8331 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8332 | 0 \ |
| 8333 | -c "replayed record" \ |
| 8334 | -S "replayed record" \ |
| 8335 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8336 | -s "record from another epoch" \ |
| 8337 | -c "resend" \ |
| 8338 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8339 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8340 | -c "HTTP/1.0 200 OK" |
| 8341 | |
| 8342 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8343 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8344 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8345 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8346 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8347 | -c "next record in same datagram" \ |
| 8348 | -s "next record in same datagram" |
| 8349 | |
| 8350 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8351 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8352 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8353 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8354 | 0 \ |
| 8355 | -c "next record in same datagram" \ |
| 8356 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8357 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8358 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8359 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8360 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8361 | "$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] | 8362 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8363 | -c "discarding invalid record (mac)" \ |
| 8364 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8365 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8366 | -c "HTTP/1.0 200 OK" \ |
| 8367 | -S "too many records with bad MAC" \ |
| 8368 | -S "Verification of the message MAC failed" |
| 8369 | |
| 8370 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8371 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8372 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8373 | "$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] | 8374 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8375 | -C "discarding invalid record (mac)" \ |
| 8376 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8377 | -S "Extra-header:" \ |
| 8378 | -C "HTTP/1.0 200 OK" \ |
| 8379 | -s "too many records with bad MAC" \ |
| 8380 | -s "Verification of the message MAC failed" |
| 8381 | |
| 8382 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8383 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8384 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8385 | "$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] | 8386 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8387 | -c "discarding invalid record (mac)" \ |
| 8388 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8389 | -s "Extra-header:" \ |
| 8390 | -c "HTTP/1.0 200 OK" \ |
| 8391 | -S "too many records with bad MAC" \ |
| 8392 | -S "Verification of the message MAC failed" |
| 8393 | |
| 8394 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8395 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8396 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8397 | "$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] | 8398 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8399 | -c "discarding invalid record (mac)" \ |
| 8400 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8401 | -s "Extra-header:" \ |
| 8402 | -c "HTTP/1.0 200 OK" \ |
| 8403 | -s "too many records with bad MAC" \ |
| 8404 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8405 | |
| 8406 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8407 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8408 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8409 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8410 | 0 \ |
| 8411 | -c "record from another epoch" \ |
| 8412 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8413 | -s "Extra-header:" \ |
| 8414 | -c "HTTP/1.0 200 OK" |
| 8415 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8416 | # Tests for reordering support with DTLS |
| 8417 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8418 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8419 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8420 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8421 | hs_timeout=2500-60000" \ |
| 8422 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8423 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8424 | 0 \ |
| 8425 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8426 | -c "Next handshake message has been buffered - load"\ |
| 8427 | -S "Buffering HS message" \ |
| 8428 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8429 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8430 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8431 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8432 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8433 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8434 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8435 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8436 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8437 | hs_timeout=2500-60000" \ |
| 8438 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8439 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8440 | 0 \ |
| 8441 | -c "Buffering HS message" \ |
| 8442 | -c "found fragmented DTLS handshake message"\ |
| 8443 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8444 | -c "Next handshake message has been buffered - load"\ |
| 8445 | -S "Buffering HS message" \ |
| 8446 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8447 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8448 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8449 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8450 | -S "Remember CCS message" |
| 8451 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8452 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8453 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8454 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8455 | # while keeping the ServerKeyExchange. |
| 8456 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8457 | 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] | 8458 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8459 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8460 | hs_timeout=2500-60000" \ |
| 8461 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8462 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8463 | 0 \ |
| 8464 | -c "Buffering HS message" \ |
| 8465 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8466 | -C "attempt to make space by freeing buffered messages" \ |
| 8467 | -S "Buffering HS message" \ |
| 8468 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8469 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8470 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8471 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8472 | -S "Remember CCS message" |
| 8473 | |
| 8474 | # The size constraints ensure that the delayed certificate message can't |
| 8475 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8476 | # when dropping it first. |
| 8477 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8478 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8479 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8480 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8481 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8482 | hs_timeout=2500-60000" \ |
| 8483 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8484 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8485 | 0 \ |
| 8486 | -c "Buffering HS message" \ |
| 8487 | -c "attempt to make space by freeing buffered future messages" \ |
| 8488 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8489 | -S "Buffering HS message" \ |
| 8490 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8491 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8492 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8493 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8494 | -S "Remember CCS message" |
| 8495 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8496 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8497 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8498 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8499 | hs_timeout=2500-60000" \ |
| 8500 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8501 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8502 | 0 \ |
| 8503 | -C "Buffering HS message" \ |
| 8504 | -C "Next handshake message has been buffered - load"\ |
| 8505 | -s "Buffering HS message" \ |
| 8506 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8507 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8508 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8509 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8510 | -S "Remember CCS message" |
| 8511 | |
| 8512 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8513 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8514 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8515 | hs_timeout=2500-60000" \ |
| 8516 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8517 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8518 | 0 \ |
| 8519 | -C "Buffering HS message" \ |
| 8520 | -C "Next handshake message has been buffered - load"\ |
| 8521 | -S "Buffering HS message" \ |
| 8522 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8523 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8524 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8525 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8526 | -S "Remember CCS message" |
| 8527 | |
| 8528 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8529 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8530 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8531 | hs_timeout=2500-60000" \ |
| 8532 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8533 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8534 | 0 \ |
| 8535 | -C "Buffering HS message" \ |
| 8536 | -C "Next handshake message has been buffered - load"\ |
| 8537 | -S "Buffering HS message" \ |
| 8538 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8539 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8540 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8541 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8542 | -s "Remember CCS message" |
| 8543 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8544 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8545 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8546 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8547 | hs_timeout=2500-60000" \ |
| 8548 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8549 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8550 | 0 \ |
| 8551 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8552 | -s "Found buffered record from current epoch - load" \ |
| 8553 | -c "Buffer record from epoch 1" \ |
| 8554 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8555 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8556 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8557 | # from the server are delayed, so that the encrypted Finished message |
| 8558 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8559 | # in afterwards, the encrypted Finished message must be freed in order |
| 8560 | # to make space for the NewSessionTicket to be reassembled. |
| 8561 | # This works only in very particular circumstances: |
| 8562 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8563 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8564 | # the encrypted Finished message. |
| 8565 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8566 | # needs to be fragmented. |
| 8567 | # - All messages sent by the server must be small enough to be either sent |
| 8568 | # without fragmentation or be reassembled within the bounds of |
| 8569 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8570 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8571 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8572 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8573 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8574 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8575 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8576 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8577 | 0 \ |
| 8578 | -s "Buffer record from epoch 1" \ |
| 8579 | -s "Found buffered record from current epoch - load" \ |
| 8580 | -c "Buffer record from epoch 1" \ |
| 8581 | -C "Found buffered record from current epoch - load" \ |
| 8582 | -c "Enough space available after freeing future epoch record" |
| 8583 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8584 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8585 | |
| 8586 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8587 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8588 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8589 | "$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] | 8590 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8591 | "$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] | 8592 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8593 | 0 \ |
| 8594 | -s "Extra-header:" \ |
| 8595 | -c "HTTP/1.0 200 OK" |
| 8596 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8597 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8598 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8599 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8600 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8601 | "$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] | 8602 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8603 | 0 \ |
| 8604 | -s "Extra-header:" \ |
| 8605 | -c "HTTP/1.0 200 OK" |
| 8606 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8607 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8608 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8609 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8610 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8611 | "$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] | 8612 | 0 \ |
| 8613 | -s "Extra-header:" \ |
| 8614 | -c "HTTP/1.0 200 OK" |
| 8615 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8616 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8617 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8618 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8619 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8620 | "$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] | 8621 | 0 \ |
| 8622 | -s "Extra-header:" \ |
| 8623 | -c "HTTP/1.0 200 OK" |
| 8624 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8625 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8626 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8627 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8628 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8629 | "$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] | 8630 | 0 \ |
| 8631 | -s "Extra-header:" \ |
| 8632 | -c "HTTP/1.0 200 OK" |
| 8633 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8634 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8635 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8636 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8637 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8638 | "$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] | 8639 | 0 \ |
| 8640 | -s "Extra-header:" \ |
| 8641 | -c "HTTP/1.0 200 OK" |
| 8642 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8643 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8644 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8645 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8646 | "$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] | 8647 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8648 | "$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] | 8649 | 0 \ |
| 8650 | -s "Extra-header:" \ |
| 8651 | -c "HTTP/1.0 200 OK" |
| 8652 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8653 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8654 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8655 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8656 | "$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] | 8657 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8658 | "$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] | 8659 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8660 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8661 | 0 \ |
| 8662 | -s "a session has been resumed" \ |
| 8663 | -c "a session has been resumed" \ |
| 8664 | -s "Extra-header:" \ |
| 8665 | -c "HTTP/1.0 200 OK" |
| 8666 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8667 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8668 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8669 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8670 | "$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] | 8671 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8672 | "$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] | 8673 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8674 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8675 | 0 \ |
| 8676 | -s "a session has been resumed" \ |
| 8677 | -c "a session has been resumed" \ |
| 8678 | -s "Extra-header:" \ |
| 8679 | -c "HTTP/1.0 200 OK" |
| 8680 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8681 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8683 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8684 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8685 | "$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] | 8686 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8687 | "$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] | 8688 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8689 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8690 | 0 \ |
| 8691 | -c "=> renegotiate" \ |
| 8692 | -s "=> renegotiate" \ |
| 8693 | -s "Extra-header:" \ |
| 8694 | -c "HTTP/1.0 200 OK" |
| 8695 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8696 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8697 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8698 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8699 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8700 | "$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] | 8701 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8702 | "$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] | 8703 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8704 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8705 | 0 \ |
| 8706 | -c "=> renegotiate" \ |
| 8707 | -s "=> renegotiate" \ |
| 8708 | -s "Extra-header:" \ |
| 8709 | -c "HTTP/1.0 200 OK" |
| 8710 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8711 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8713 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8714 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8715 | "$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] | 8716 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8717 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8718 | "$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] | 8719 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8720 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8721 | 0 \ |
| 8722 | -c "=> renegotiate" \ |
| 8723 | -s "=> renegotiate" \ |
| 8724 | -s "Extra-header:" \ |
| 8725 | -c "HTTP/1.0 200 OK" |
| 8726 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8727 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8729 | 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] | 8730 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8731 | "$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] | 8732 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8733 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8734 | "$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] | 8735 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8736 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8737 | 0 \ |
| 8738 | -c "=> renegotiate" \ |
| 8739 | -s "=> renegotiate" \ |
| 8740 | -s "Extra-header:" \ |
| 8741 | -c "HTTP/1.0 200 OK" |
| 8742 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8743 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8744 | ## all versions installed on the CI machines), reported here: |
| 8745 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8746 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8747 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8748 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8749 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8750 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8751 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8752 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8753 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8754 | "$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] | 8755 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8756 | -c "HTTP/1.0 200 OK" |
| 8757 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8758 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8759 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8760 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8761 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8762 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8763 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8764 | "$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] | 8765 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8766 | -c "HTTP/1.0 200 OK" |
| 8767 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8768 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8769 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8770 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8771 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8772 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8773 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8774 | "$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] | 8775 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8776 | -c "HTTP/1.0 200 OK" |
| 8777 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8778 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8779 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8780 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8781 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8782 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8783 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8784 | "$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] | 8785 | 0 \ |
| 8786 | -s "Extra-header:" \ |
| 8787 | -c "Extra-header:" |
| 8788 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8789 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8790 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8791 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8792 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8793 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8794 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8795 | "$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] | 8796 | 0 \ |
| 8797 | -s "Extra-header:" \ |
| 8798 | -c "Extra-header:" |
| 8799 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8800 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8801 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8802 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8803 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8804 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8805 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8806 | "$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] | 8807 | 0 \ |
| 8808 | -s "Extra-header:" \ |
| 8809 | -c "Extra-header:" |
| 8810 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8811 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8812 | run_test "export keys functionality" \ |
| 8813 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8814 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8815 | 0 \ |
| 8816 | -s "exported maclen is " \ |
| 8817 | -s "exported keylen is " \ |
| 8818 | -s "exported ivlen is " \ |
| 8819 | -c "exported maclen is " \ |
| 8820 | -c "exported keylen is " \ |
| 8821 | -c "exported ivlen is " |
| 8822 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8823 | # Final report |
| 8824 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8825 | echo "------------------------------------------------------------------------" |
| 8826 | |
| 8827 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8828 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8829 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8830 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8831 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8832 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8833 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8834 | |
| 8835 | exit $FAILS |