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() { |
Piotr Nowicki | 195a8f7 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 226 | if [ -z "$($P_CLI --help 2>/dev/null | 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 | |
Piotr Nowicki | 195a8f7 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 528 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 529 | handshake_memory_get() { |
| 530 | OUTPUT_VARIABLE="$1" |
| 531 | OUTPUT_FILE="$2" |
| 532 | |
| 533 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 534 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 535 | |
| 536 | # Check if memory usage was read |
| 537 | if [ -z "$MEM_USAGE" ]; then |
| 538 | echo "Error: Can not read the value of handshake memory usage" |
| 539 | return 1 |
| 540 | else |
| 541 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 542 | return 0 |
| 543 | fi |
| 544 | } |
| 545 | |
| 546 | # Get handshake memory usage from server or client output and check if this value |
| 547 | # is not higher than the maximum given by the first argument |
| 548 | handshake_memory_check() { |
| 549 | MAX_MEMORY="$1" |
| 550 | OUTPUT_FILE="$2" |
| 551 | |
| 552 | # Get memory usage |
| 553 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 554 | return 1 |
| 555 | fi |
| 556 | |
| 557 | # Check if memory usage is below max value |
| 558 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 559 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 560 | "but should be below $MAX_MEMORY bytes" |
| 561 | return 1 |
| 562 | else |
| 563 | return 0 |
| 564 | fi |
| 565 | } |
| 566 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 567 | # wait for client to terminate and set CLI_EXIT |
| 568 | # must be called right after starting the client |
| 569 | wait_client_done() { |
| 570 | CLI_PID=$! |
| 571 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 572 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 573 | CLI_DELAY_FACTOR=1 |
| 574 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 575 | ( 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] | 576 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 577 | |
| 578 | wait $CLI_PID |
| 579 | CLI_EXIT=$? |
| 580 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 581 | kill $DOG_PID >/dev/null 2>&1 |
| 582 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 583 | |
| 584 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 585 | |
| 586 | sleep $SRV_DELAY_SECONDS |
| 587 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 588 | } |
| 589 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 590 | # check if the given command uses dtls and sets global variable DTLS |
| 591 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 592 | 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] | 593 | DTLS=1 |
| 594 | else |
| 595 | DTLS=0 |
| 596 | fi |
| 597 | } |
| 598 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 599 | # 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] | 600 | # Options: -s pattern pattern that must be present in server output |
| 601 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 602 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 603 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 604 | # -S pattern pattern that must be absent in server output |
| 605 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 606 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 607 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 608 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 609 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 610 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 611 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 612 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 613 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 614 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 615 | # 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] | 616 | return |
| 617 | fi |
| 618 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 619 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 620 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 621 | # Do we only run numbered tests? |
| 622 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 623 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 624 | else |
| 625 | SKIP_NEXT="YES" |
| 626 | fi |
| 627 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 628 | # does this test use a proxy? |
| 629 | if [ "X$1" = "X-p" ]; then |
| 630 | PXY_CMD="$2" |
| 631 | shift 2 |
| 632 | else |
| 633 | PXY_CMD="" |
| 634 | fi |
| 635 | |
| 636 | # get commands and client output |
| 637 | SRV_CMD="$1" |
| 638 | CLI_CMD="$2" |
| 639 | CLI_EXPECT="$3" |
| 640 | shift 3 |
| 641 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 642 | # Check if test uses files |
| 643 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 644 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 645 | requires_config_enabled MBEDTLS_FS_IO |
| 646 | fi |
| 647 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 648 | # Check if server forces ciphersuite |
| 649 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 650 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 651 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 652 | fi |
| 653 | |
| 654 | # Check if client forces ciphersuite |
| 655 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 656 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 657 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 658 | fi |
| 659 | |
| 660 | # should we skip? |
| 661 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 662 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 663 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 664 | SKIPS=$(( $SKIPS + 1 )) |
| 665 | return |
| 666 | fi |
| 667 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 668 | # fix client port |
| 669 | if [ -n "$PXY_CMD" ]; then |
| 670 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 671 | else |
| 672 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 673 | fi |
| 674 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 675 | # update DTLS variable |
| 676 | detect_dtls "$SRV_CMD" |
| 677 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 678 | # prepend valgrind to our commands if active |
| 679 | if [ "$MEMCHECK" -gt 0 ]; then |
| 680 | if is_polar "$SRV_CMD"; then |
| 681 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 682 | fi |
| 683 | if is_polar "$CLI_CMD"; then |
| 684 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 685 | fi |
| 686 | fi |
| 687 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 688 | TIMES_LEFT=2 |
| 689 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 690 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 691 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 692 | # run the commands |
| 693 | if [ -n "$PXY_CMD" ]; then |
| 694 | echo "$PXY_CMD" > $PXY_OUT |
| 695 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 696 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 697 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 698 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 700 | check_osrv_dtls |
| 701 | echo "$SRV_CMD" > $SRV_OUT |
| 702 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 703 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 704 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 705 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 706 | echo "$CLI_CMD" > $CLI_OUT |
| 707 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 708 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 709 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 710 | sleep 0.05 |
| 711 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 712 | # terminate the server (and the proxy) |
| 713 | kill $SRV_PID |
| 714 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 715 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 716 | if [ -n "$PXY_CMD" ]; then |
| 717 | kill $PXY_PID >/dev/null 2>&1 |
| 718 | wait $PXY_PID |
| 719 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 720 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 721 | # retry only on timeouts |
| 722 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 723 | printf "RETRY " |
| 724 | else |
| 725 | TIMES_LEFT=0 |
| 726 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 727 | done |
| 728 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 729 | # 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] | 730 | # (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] | 731 | # expected client exit to incorrectly succeed in case of catastrophic |
| 732 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 733 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 734 | 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] | 735 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 736 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 737 | return |
| 738 | fi |
| 739 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 740 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 741 | 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] | 742 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 743 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 744 | return |
| 745 | fi |
| 746 | fi |
| 747 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 748 | # check server exit code |
| 749 | if [ $? != 0 ]; then |
| 750 | fail "server fail" |
| 751 | return |
| 752 | fi |
| 753 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 754 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 755 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 756 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 757 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 758 | 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] | 759 | return |
| 760 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 761 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 762 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 763 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 764 | # 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] | 765 | while [ $# -gt 0 ] |
| 766 | do |
| 767 | case $1 in |
| 768 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 769 | 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] | 770 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 771 | return |
| 772 | fi |
| 773 | ;; |
| 774 | |
| 775 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 776 | 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] | 777 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 778 | return |
| 779 | fi |
| 780 | ;; |
| 781 | |
| 782 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 783 | 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] | 784 | 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] | 785 | return |
| 786 | fi |
| 787 | ;; |
| 788 | |
| 789 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 790 | 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] | 791 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 792 | return |
| 793 | fi |
| 794 | ;; |
| 795 | |
| 796 | # The filtering in the following two options (-u and -U) do the following |
| 797 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 798 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 799 | # - keep one of each non-unique line |
| 800 | # - count how many lines remain |
| 801 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 802 | # if there were no duplicates. |
| 803 | "-U") |
| 804 | 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 |
| 805 | fail "lines following pattern '$2' must be unique in Server output" |
| 806 | return |
| 807 | fi |
| 808 | ;; |
| 809 | |
| 810 | "-u") |
| 811 | 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 |
| 812 | 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] | 813 | return |
| 814 | fi |
| 815 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 816 | "-F") |
| 817 | if ! $2 "$SRV_OUT"; then |
| 818 | fail "function call to '$2' failed on Server output" |
| 819 | return |
| 820 | fi |
| 821 | ;; |
| 822 | "-f") |
| 823 | if ! $2 "$CLI_OUT"; then |
| 824 | fail "function call to '$2' failed on Client output" |
| 825 | return |
| 826 | fi |
| 827 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 828 | |
| 829 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 830 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 831 | exit 1 |
| 832 | esac |
| 833 | shift 2 |
| 834 | done |
| 835 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 836 | # check valgrind's results |
| 837 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 838 | 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] | 839 | fail "Server has memory errors" |
| 840 | return |
| 841 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 842 | 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] | 843 | fail "Client has memory errors" |
| 844 | return |
| 845 | fi |
| 846 | fi |
| 847 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 848 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 849 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 850 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 851 | mv $SRV_OUT o-srv-${TESTS}.log |
| 852 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 853 | if [ -n "$PXY_CMD" ]; then |
| 854 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 855 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 856 | fi |
| 857 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 858 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 859 | } |
| 860 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 861 | run_test_psa() { |
| 862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 863 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 864 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 865 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 866 | 0 \ |
| 867 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 868 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 869 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 870 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 871 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 872 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 873 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 874 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 875 | -C "Failed to setup PSA-based cipher context"\ |
| 876 | -S "Failed to setup PSA-based cipher context"\ |
| 877 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 878 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 879 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 880 | -S "error" \ |
| 881 | -C "error" |
| 882 | } |
| 883 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 884 | run_test_psa_force_curve() { |
| 885 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 886 | run_test "PSA - ECDH with $1" \ |
| 887 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 888 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 889 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 890 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 891 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 892 | -c "PSA calc verify" \ |
| 893 | -c "calc PSA finished" \ |
| 894 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 895 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 896 | -s "PSA calc verify" \ |
| 897 | -s "calc PSA finished" \ |
| 898 | -C "Failed to setup PSA-based cipher context"\ |
| 899 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 900 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 901 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 902 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 903 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 904 | -C "error" |
| 905 | } |
| 906 | |
Piotr Nowicki | 195a8f7 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 907 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 908 | # a maximum fragment length. |
| 909 | # first argument ($1) is MFL for SSL client |
| 910 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 911 | run_test_memory_after_hanshake_with_mfl() |
| 912 | { |
| 913 | # The test passes if the difference is around 2*(16k-MFL) |
| 914 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
| 915 | |
| 916 | # Leave some margin for robustness |
| 917 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 918 | |
| 919 | run_test "Handshake memory usage (MFL $1)" \ |
| 920 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 921 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 922 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 923 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 924 | 0 \ |
| 925 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 926 | } |
| 927 | |
| 928 | |
| 929 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 930 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 931 | run_tests_memory_after_hanshake() |
| 932 | { |
| 933 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 934 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 935 | |
| 936 | # first test with default MFU is to get reference memory usage |
| 937 | MEMORY_USAGE_MFL_16K=0 |
| 938 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 939 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 940 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 941 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 942 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 943 | 0 \ |
| 944 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 945 | |
| 946 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 947 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 948 | |
| 949 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 950 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 951 | |
| 952 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 953 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 954 | |
| 955 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 956 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 957 | } |
| 958 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 959 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 960 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 961 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 962 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 963 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 964 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 965 | exit 1 |
| 966 | } |
| 967 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 968 | # |
| 969 | # MAIN |
| 970 | # |
| 971 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 972 | get_options "$@" |
| 973 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 974 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 975 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 976 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 977 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 978 | if [ ! -x "$P_SRV_BIN" ]; then |
| 979 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 980 | exit 1 |
| 981 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 982 | if [ ! -x "$P_CLI_BIN" ]; then |
| 983 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 984 | exit 1 |
| 985 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 986 | if [ ! -x "$P_PXY_BIN" ]; then |
| 987 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 988 | exit 1 |
| 989 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 990 | if [ "$MEMCHECK" -gt 0 ]; then |
| 991 | if which valgrind >/dev/null 2>&1; then :; else |
| 992 | echo "Memcheck not possible. Valgrind not found" |
| 993 | exit 1 |
| 994 | fi |
| 995 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 996 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 997 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 998 | exit 1 |
| 999 | fi |
| 1000 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1001 | # used by watchdog |
| 1002 | MAIN_PID="$$" |
| 1003 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1004 | # We use somewhat arbitrary delays for tests: |
| 1005 | # - how long do we wait for the server to start (when lsof not available)? |
| 1006 | # - how long do we allow for the client to finish? |
| 1007 | # (not to check performance, just to avoid waiting indefinitely) |
| 1008 | # Things are slower with valgrind, so give extra time here. |
| 1009 | # |
| 1010 | # Note: without lsof, there is a trade-off between the running time of this |
| 1011 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1012 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1013 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1014 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1015 | START_DELAY=6 |
| 1016 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1017 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1018 | START_DELAY=2 |
| 1019 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1020 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1021 | |
| 1022 | # some particular tests need more time: |
| 1023 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1024 | # - for the server, we sleep for a number of seconds after the client exits |
| 1025 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1026 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1027 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1028 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1029 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 1030 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1031 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1032 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 1033 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 1034 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1035 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 1036 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1037 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1038 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1039 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1040 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1041 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1042 | fi |
| 1043 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1044 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1045 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1046 | fi |
| 1047 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1048 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1049 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1050 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1051 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1052 | # Allow SHA-1, because many of our test certificates use it |
| 1053 | P_SRV="$P_SRV allow_sha1=1" |
| 1054 | P_CLI="$P_CLI allow_sha1=1" |
| 1055 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1056 | # Also pick a unique name for intermediate files |
| 1057 | SRV_OUT="srv_out.$$" |
| 1058 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1059 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1060 | SESSION="session.$$" |
| 1061 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1062 | SKIP_NEXT="NO" |
| 1063 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1064 | trap cleanup INT TERM HUP |
| 1065 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1066 | # Basic test |
| 1067 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1068 | # Checks that: |
| 1069 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1070 | # - the expected (highest security) parameters are selected |
| 1071 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1072 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1073 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1074 | "$P_CLI" \ |
| 1075 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1076 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1077 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1078 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1079 | -s "ECDHE curve: secp521r1" \ |
| 1080 | -S "error" \ |
| 1081 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1082 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1083 | run_test "Default, DTLS" \ |
| 1084 | "$P_SRV dtls=1" \ |
| 1085 | "$P_CLI dtls=1" \ |
| 1086 | 0 \ |
| 1087 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1088 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1089 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1090 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1091 | run_test "Default (compression enabled)" \ |
| 1092 | "$P_SRV debug_level=3" \ |
| 1093 | "$P_CLI debug_level=3" \ |
| 1094 | 0 \ |
| 1095 | -s "Allocating compression buffer" \ |
| 1096 | -c "Allocating compression buffer" \ |
| 1097 | -s "Record expansion is unknown (compression)" \ |
| 1098 | -c "Record expansion is unknown (compression)" \ |
| 1099 | -S "error" \ |
| 1100 | -C "error" |
| 1101 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1102 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1103 | run_test "CA callback on client" \ |
| 1104 | "$P_SRV debug_level=3" \ |
| 1105 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1106 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1107 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1108 | -S "error" \ |
| 1109 | -C "error" |
| 1110 | |
| 1111 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1112 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1113 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1114 | requires_config_enabled MBEDTLS_SHA256_C |
| 1115 | run_test "CA callback on server" \ |
| 1116 | "$P_SRV auth_mode=required" \ |
| 1117 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1118 | key_file=data_files/server5.key" \ |
| 1119 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1120 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1121 | -s "Verifying peer X.509 certificate... ok" \ |
| 1122 | -S "error" \ |
| 1123 | -C "error" |
| 1124 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1125 | # Test using an opaque private key for client authentication |
| 1126 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1127 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1128 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1129 | requires_config_enabled MBEDTLS_SHA256_C |
| 1130 | run_test "Opaque key for client authentication" \ |
| 1131 | "$P_SRV auth_mode=required" \ |
| 1132 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1133 | key_file=data_files/server5.key" \ |
| 1134 | 0 \ |
| 1135 | -c "key type: Opaque" \ |
| 1136 | -s "Verifying peer X.509 certificate... ok" \ |
| 1137 | -S "error" \ |
| 1138 | -C "error" |
| 1139 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1140 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1141 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1142 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1143 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1144 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1145 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1146 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1147 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1148 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1149 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1150 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1151 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1152 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1153 | run_test_psa_force_curve "secp521r1" |
| 1154 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1155 | run_test_psa_force_curve "brainpoolP512r1" |
| 1156 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1157 | run_test_psa_force_curve "secp384r1" |
| 1158 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1159 | run_test_psa_force_curve "brainpoolP384r1" |
| 1160 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1161 | run_test_psa_force_curve "secp256r1" |
| 1162 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1163 | run_test_psa_force_curve "secp256k1" |
| 1164 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1165 | run_test_psa_force_curve "brainpoolP256r1" |
| 1166 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1167 | run_test_psa_force_curve "secp224r1" |
| 1168 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1169 | run_test_psa_force_curve "secp224k1" |
| 1170 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1171 | run_test_psa_force_curve "secp192r1" |
| 1172 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1173 | run_test_psa_force_curve "secp192k1" |
| 1174 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1175 | # Test current time in ServerHello |
| 1176 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1177 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1178 | "$P_SRV debug_level=3" \ |
| 1179 | "$P_CLI debug_level=3" \ |
| 1180 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1181 | -f "check_server_hello_time" \ |
| 1182 | -F "check_server_hello_time" |
| 1183 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1184 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1185 | run_test "Unique IV in GCM" \ |
| 1186 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1187 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1188 | 0 \ |
| 1189 | -u "IV used" \ |
| 1190 | -U "IV used" |
| 1191 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1192 | # Tests for certificate verification callback |
| 1193 | run_test "Configuration-specific CRT verification callback" \ |
| 1194 | "$P_SRV debug_level=3" \ |
| 1195 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1196 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1197 | -S "error" \ |
| 1198 | -c "Verify requested for " \ |
| 1199 | -c "Use configuration-specific verification callback" \ |
| 1200 | -C "Use context-specific verification callback" \ |
| 1201 | -C "error" |
| 1202 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1203 | run_test "Context-specific CRT verification callback" \ |
| 1204 | "$P_SRV debug_level=3" \ |
| 1205 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1206 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1207 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1208 | -c "Verify requested for " \ |
| 1209 | -c "Use context-specific verification callback" \ |
| 1210 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1211 | -C "error" |
| 1212 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1213 | # Tests for rc4 option |
| 1214 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1215 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1216 | run_test "RC4: server disabled, client enabled" \ |
| 1217 | "$P_SRV" \ |
| 1218 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1219 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1220 | -s "SSL - The server has no ciphersuites in common" |
| 1221 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1222 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1223 | run_test "RC4: server half, client enabled" \ |
| 1224 | "$P_SRV arc4=1" \ |
| 1225 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1226 | 1 \ |
| 1227 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1228 | |
| 1229 | run_test "RC4: server enabled, client disabled" \ |
| 1230 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1231 | "$P_CLI" \ |
| 1232 | 1 \ |
| 1233 | -s "SSL - The server has no ciphersuites in common" |
| 1234 | |
| 1235 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1236 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1237 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1238 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1239 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1240 | -S "SSL - The server has no ciphersuites in common" |
| 1241 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1242 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1243 | |
| 1244 | requires_gnutls |
| 1245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1246 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1247 | "$G_SRV"\ |
| 1248 | "$P_CLI force_version=tls1_1" \ |
| 1249 | 0 |
| 1250 | |
| 1251 | requires_gnutls |
| 1252 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1253 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1254 | "$G_SRV"\ |
| 1255 | "$P_CLI force_version=tls1" \ |
| 1256 | 0 |
| 1257 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1258 | # Tests for SHA-1 support |
| 1259 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1260 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1261 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1262 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1263 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1264 | 1 \ |
| 1265 | -c "The certificate is signed with an unacceptable hash" |
| 1266 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1267 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1268 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1269 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1270 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1271 | 0 |
| 1272 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1273 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1274 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1275 | "$P_CLI allow_sha1=1" \ |
| 1276 | 0 |
| 1277 | |
| 1278 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1279 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1280 | "$P_CLI allow_sha1=0" \ |
| 1281 | 0 |
| 1282 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1283 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1284 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1285 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1286 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1287 | 1 \ |
| 1288 | -s "The certificate is signed with an unacceptable hash" |
| 1289 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1290 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1291 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1292 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1293 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1294 | 0 |
| 1295 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1296 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1297 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1298 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1299 | 0 |
| 1300 | |
| 1301 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1302 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1303 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1304 | 0 |
| 1305 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1306 | # Tests for datagram packing |
| 1307 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1308 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1309 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1310 | 0 \ |
| 1311 | -c "next record in same datagram" \ |
| 1312 | -s "next record in same datagram" |
| 1313 | |
| 1314 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1315 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1316 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1317 | 0 \ |
| 1318 | -s "next record in same datagram" \ |
| 1319 | -C "next record in same datagram" |
| 1320 | |
| 1321 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1322 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1323 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1324 | 0 \ |
| 1325 | -S "next record in same datagram" \ |
| 1326 | -c "next record in same datagram" |
| 1327 | |
| 1328 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1329 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1330 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1331 | 0 \ |
| 1332 | -S "next record in same datagram" \ |
| 1333 | -C "next record in same datagram" |
| 1334 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1335 | # Tests for Truncated HMAC extension |
| 1336 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1337 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1338 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1339 | "$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] | 1340 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1341 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1342 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1343 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1344 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1345 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1346 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1347 | "$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] | 1348 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1349 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1350 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1351 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1352 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1353 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1354 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1355 | "$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] | 1356 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1357 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1358 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1359 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1360 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1361 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1362 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1363 | "$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] | 1364 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1365 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1366 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1367 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1368 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1369 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1370 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1371 | "$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] | 1372 | 0 \ |
| 1373 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1374 | -S "dumping 'expected mac' (10 bytes)" |
| 1375 | |
| 1376 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1377 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1378 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1379 | "$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] | 1380 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1381 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1382 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1383 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1384 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1385 | "$P_SRV dtls=1 debug_level=4" \ |
| 1386 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1387 | 0 \ |
| 1388 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1389 | -S "dumping 'expected mac' (10 bytes)" |
| 1390 | |
| 1391 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1392 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1393 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1394 | "$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] | 1395 | 0 \ |
| 1396 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1397 | -S "dumping 'expected mac' (10 bytes)" |
| 1398 | |
| 1399 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1400 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1401 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1402 | "$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] | 1403 | 0 \ |
| 1404 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1405 | -S "dumping 'expected mac' (10 bytes)" |
| 1406 | |
| 1407 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1408 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1409 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1410 | "$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] | 1411 | 0 \ |
| 1412 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1413 | -S "dumping 'expected mac' (10 bytes)" |
| 1414 | |
| 1415 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1416 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1417 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1418 | "$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] | 1419 | 0 \ |
| 1420 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1421 | -S "dumping 'expected mac' (10 bytes)" |
| 1422 | |
| 1423 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1424 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1425 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1426 | "$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] | 1427 | 0 \ |
| 1428 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1429 | -s "dumping 'expected mac' (10 bytes)" |
| 1430 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1431 | # Tests for Context serialization |
| 1432 | |
| 1433 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1434 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1435 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1436 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1437 | 0 \ |
| 1438 | -c "Deserializing connection..." \ |
| 1439 | -S "Deserializing connection..." |
| 1440 | |
| 1441 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1442 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1443 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1444 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1445 | 0 \ |
| 1446 | -c "Deserializing connection..." \ |
| 1447 | -S "Deserializing connection..." |
| 1448 | |
| 1449 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1450 | run_test "Context serialization, client serializes, GCM" \ |
| 1451 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1452 | "$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] | 1453 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1454 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1455 | -S "Deserializing connection..." |
| 1456 | |
| 1457 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1458 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1459 | run_test "Context serialization, client serializes, with CID" \ |
| 1460 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1461 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1462 | 0 \ |
| 1463 | -c "Deserializing connection..." \ |
| 1464 | -S "Deserializing connection..." |
| 1465 | |
| 1466 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1467 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1468 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1469 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1470 | 0 \ |
| 1471 | -C "Deserializing connection..." \ |
| 1472 | -s "Deserializing connection..." |
| 1473 | |
| 1474 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1475 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1476 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1477 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1478 | 0 \ |
| 1479 | -C "Deserializing connection..." \ |
| 1480 | -s "Deserializing connection..." |
| 1481 | |
| 1482 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1483 | run_test "Context serialization, server serializes, GCM" \ |
| 1484 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1485 | "$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] | 1486 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1487 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1488 | -s "Deserializing connection..." |
| 1489 | |
| 1490 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1491 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1492 | run_test "Context serialization, server serializes, with CID" \ |
| 1493 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1494 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1495 | 0 \ |
| 1496 | -C "Deserializing connection..." \ |
| 1497 | -s "Deserializing connection..." |
| 1498 | |
| 1499 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1500 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1501 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1502 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1503 | 0 \ |
| 1504 | -c "Deserializing connection..." \ |
| 1505 | -s "Deserializing connection..." |
| 1506 | |
| 1507 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1508 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1509 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1510 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1511 | 0 \ |
| 1512 | -c "Deserializing connection..." \ |
| 1513 | -s "Deserializing connection..." |
| 1514 | |
| 1515 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1516 | run_test "Context serialization, both serialize, GCM" \ |
| 1517 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1518 | "$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] | 1519 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1520 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1521 | -s "Deserializing connection..." |
| 1522 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1523 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1524 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1525 | run_test "Context serialization, both serialize, with CID" \ |
| 1526 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1527 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1528 | 0 \ |
| 1529 | -c "Deserializing connection..." \ |
| 1530 | -s "Deserializing connection..." |
| 1531 | |
| 1532 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1533 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1534 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1535 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1536 | 0 \ |
| 1537 | -c "Deserializing connection..." \ |
| 1538 | -S "Deserializing connection..." |
| 1539 | |
| 1540 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1541 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1542 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1543 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1544 | 0 \ |
| 1545 | -c "Deserializing connection..." \ |
| 1546 | -S "Deserializing connection..." |
| 1547 | |
| 1548 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1549 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1550 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1551 | "$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] | 1552 | 0 \ |
| 1553 | -c "Deserializing connection..." \ |
| 1554 | -S "Deserializing connection..." |
| 1555 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1556 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1557 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1558 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1559 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1560 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1561 | 0 \ |
| 1562 | -c "Deserializing connection..." \ |
| 1563 | -S "Deserializing connection..." |
| 1564 | |
| 1565 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1566 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1567 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1568 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1569 | 0 \ |
| 1570 | -C "Deserializing connection..." \ |
| 1571 | -s "Deserializing connection..." |
| 1572 | |
| 1573 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1574 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1575 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1576 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1577 | 0 \ |
| 1578 | -C "Deserializing connection..." \ |
| 1579 | -s "Deserializing connection..." |
| 1580 | |
| 1581 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1582 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1583 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1584 | "$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] | 1585 | 0 \ |
| 1586 | -C "Deserializing connection..." \ |
| 1587 | -s "Deserializing connection..." |
| 1588 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1589 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1590 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1591 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1592 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1593 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1594 | 0 \ |
| 1595 | -C "Deserializing connection..." \ |
| 1596 | -s "Deserializing connection..." |
| 1597 | |
| 1598 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1599 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1600 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1601 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1602 | 0 \ |
| 1603 | -c "Deserializing connection..." \ |
| 1604 | -s "Deserializing connection..." |
| 1605 | |
| 1606 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1607 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1608 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1609 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1610 | 0 \ |
| 1611 | -c "Deserializing connection..." \ |
| 1612 | -s "Deserializing connection..." |
| 1613 | |
| 1614 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1615 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1616 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1617 | "$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] | 1618 | 0 \ |
| 1619 | -c "Deserializing connection..." \ |
| 1620 | -s "Deserializing connection..." |
| 1621 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1622 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1623 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1624 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1625 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1626 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1627 | 0 \ |
| 1628 | -c "Deserializing connection..." \ |
| 1629 | -s "Deserializing connection..." |
| 1630 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1631 | # Tests for DTLS Connection ID extension |
| 1632 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1633 | # So far, the CID API isn't implemented, so we can't |
| 1634 | # grep for output witnessing its use. This needs to be |
| 1635 | # changed once the CID extension is implemented. |
| 1636 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1637 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1638 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1639 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1640 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1641 | 0 \ |
| 1642 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1643 | -s "found CID extension" \ |
| 1644 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1645 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1646 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1647 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1648 | -C "found CID extension" \ |
| 1649 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1650 | -C "Copy CIDs into SSL transform" \ |
| 1651 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1652 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1653 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1654 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1655 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1656 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1657 | 0 \ |
| 1658 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1659 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1660 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1661 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1662 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1663 | -C "found CID extension" \ |
| 1664 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1665 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1666 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1667 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1668 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1669 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1670 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1671 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1672 | 0 \ |
| 1673 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1674 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1675 | -c "client hello, adding CID extension" \ |
| 1676 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1677 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1678 | -s "server hello, adding CID extension" \ |
| 1679 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1680 | -c "Use of CID extension negotiated" \ |
| 1681 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1682 | -c "Copy CIDs into SSL transform" \ |
| 1683 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1684 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1685 | -s "Use of Connection ID has been negotiated" \ |
| 1686 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1687 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1688 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1689 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1690 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1691 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1692 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1693 | 0 \ |
| 1694 | -c "Enable use of CID extension." \ |
| 1695 | -s "Enable use of CID extension." \ |
| 1696 | -c "client hello, adding CID extension" \ |
| 1697 | -s "found CID extension" \ |
| 1698 | -s "Use of CID extension negotiated" \ |
| 1699 | -s "server hello, adding CID extension" \ |
| 1700 | -c "found CID extension" \ |
| 1701 | -c "Use of CID extension negotiated" \ |
| 1702 | -s "Copy CIDs into SSL transform" \ |
| 1703 | -c "Copy CIDs into SSL transform" \ |
| 1704 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1705 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1706 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1707 | -c "Use of Connection ID has been negotiated" \ |
| 1708 | -c "ignoring unexpected CID" \ |
| 1709 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1710 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1711 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1712 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1713 | -p "$P_PXY mtu=800" \ |
| 1714 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1715 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1716 | 0 \ |
| 1717 | -c "Enable use of CID extension." \ |
| 1718 | -s "Enable use of CID extension." \ |
| 1719 | -c "client hello, adding CID extension" \ |
| 1720 | -s "found CID extension" \ |
| 1721 | -s "Use of CID extension negotiated" \ |
| 1722 | -s "server hello, adding CID extension" \ |
| 1723 | -c "found CID extension" \ |
| 1724 | -c "Use of CID extension negotiated" \ |
| 1725 | -s "Copy CIDs into SSL transform" \ |
| 1726 | -c "Copy CIDs into SSL transform" \ |
| 1727 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1728 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1729 | -s "Use of Connection ID has been negotiated" \ |
| 1730 | -c "Use of Connection ID has been negotiated" |
| 1731 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1732 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1733 | 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] | 1734 | -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] | 1735 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1736 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1737 | 0 \ |
| 1738 | -c "Enable use of CID extension." \ |
| 1739 | -s "Enable use of CID extension." \ |
| 1740 | -c "client hello, adding CID extension" \ |
| 1741 | -s "found CID extension" \ |
| 1742 | -s "Use of CID extension negotiated" \ |
| 1743 | -s "server hello, adding CID extension" \ |
| 1744 | -c "found CID extension" \ |
| 1745 | -c "Use of CID extension negotiated" \ |
| 1746 | -s "Copy CIDs into SSL transform" \ |
| 1747 | -c "Copy CIDs into SSL transform" \ |
| 1748 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1749 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1750 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1751 | -c "Use of Connection ID has been negotiated" \ |
| 1752 | -c "ignoring unexpected CID" \ |
| 1753 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1754 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1755 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1756 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1757 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1758 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1759 | 0 \ |
| 1760 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1761 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1762 | -c "client hello, adding CID extension" \ |
| 1763 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1764 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1765 | -s "server hello, adding CID extension" \ |
| 1766 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1767 | -c "Use of CID extension negotiated" \ |
| 1768 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1769 | -c "Copy CIDs into SSL transform" \ |
| 1770 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1771 | -s "Peer CID (length 0 Bytes):" \ |
| 1772 | -s "Use of Connection ID has been negotiated" \ |
| 1773 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1774 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1775 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1776 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1777 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1778 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1779 | 0 \ |
| 1780 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1781 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1782 | -c "client hello, adding CID extension" \ |
| 1783 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1784 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1785 | -s "server hello, adding CID extension" \ |
| 1786 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1787 | -c "Use of CID extension negotiated" \ |
| 1788 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1789 | -c "Copy CIDs into SSL transform" \ |
| 1790 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1791 | -c "Peer CID (length 0 Bytes):" \ |
| 1792 | -s "Use of Connection ID has been negotiated" \ |
| 1793 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1794 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1796 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1797 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1798 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1799 | 0 \ |
| 1800 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1801 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1802 | -c "client hello, adding CID extension" \ |
| 1803 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1804 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1805 | -s "server hello, adding CID extension" \ |
| 1806 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1807 | -c "Use of CID extension negotiated" \ |
| 1808 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1809 | -c "Copy CIDs into SSL transform" \ |
| 1810 | -S "Use of Connection ID has been negotiated" \ |
| 1811 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1812 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1813 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1814 | 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] | 1815 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1816 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1817 | 0 \ |
| 1818 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1819 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1820 | -c "client hello, adding CID extension" \ |
| 1821 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1822 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1823 | -s "server hello, adding CID extension" \ |
| 1824 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1825 | -c "Use of CID extension negotiated" \ |
| 1826 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1827 | -c "Copy CIDs into SSL transform" \ |
| 1828 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1829 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1830 | -s "Use of Connection ID has been negotiated" \ |
| 1831 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1832 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1833 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1834 | 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] | 1835 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1836 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1837 | 0 \ |
| 1838 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1839 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1840 | -c "client hello, adding CID extension" \ |
| 1841 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1842 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1843 | -s "server hello, adding CID extension" \ |
| 1844 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1845 | -c "Use of CID extension negotiated" \ |
| 1846 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1847 | -c "Copy CIDs into SSL transform" \ |
| 1848 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1849 | -s "Peer CID (length 0 Bytes):" \ |
| 1850 | -s "Use of Connection ID has been negotiated" \ |
| 1851 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1852 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1853 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1854 | 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] | 1855 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1856 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1857 | 0 \ |
| 1858 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1859 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1860 | -c "client hello, adding CID extension" \ |
| 1861 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1862 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1863 | -s "server hello, adding CID extension" \ |
| 1864 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1865 | -c "Use of CID extension negotiated" \ |
| 1866 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1867 | -c "Copy CIDs into SSL transform" \ |
| 1868 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1869 | -c "Peer CID (length 0 Bytes):" \ |
| 1870 | -s "Use of Connection ID has been negotiated" \ |
| 1871 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1872 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1873 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1874 | 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] | 1875 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1876 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1877 | 0 \ |
| 1878 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1879 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1880 | -c "client hello, adding CID extension" \ |
| 1881 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1882 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1883 | -s "server hello, adding CID extension" \ |
| 1884 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1885 | -c "Use of CID extension negotiated" \ |
| 1886 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1887 | -c "Copy CIDs into SSL transform" \ |
| 1888 | -S "Use of Connection ID has been negotiated" \ |
| 1889 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1890 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1892 | 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] | 1893 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1894 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1895 | 0 \ |
| 1896 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1897 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1898 | -c "client hello, adding CID extension" \ |
| 1899 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1900 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1901 | -s "server hello, adding CID extension" \ |
| 1902 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1903 | -c "Use of CID extension negotiated" \ |
| 1904 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1905 | -c "Copy CIDs into SSL transform" \ |
| 1906 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1907 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1908 | -s "Use of Connection ID has been negotiated" \ |
| 1909 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1910 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | 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] | 1913 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1914 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1915 | 0 \ |
| 1916 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1917 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1918 | -c "client hello, adding CID extension" \ |
| 1919 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1920 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1921 | -s "server hello, adding CID extension" \ |
| 1922 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1923 | -c "Use of CID extension negotiated" \ |
| 1924 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1925 | -c "Copy CIDs into SSL transform" \ |
| 1926 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1927 | -s "Peer CID (length 0 Bytes):" \ |
| 1928 | -s "Use of Connection ID has been negotiated" \ |
| 1929 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1930 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1931 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1932 | 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] | 1933 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1934 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1935 | 0 \ |
| 1936 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1937 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1938 | -c "client hello, adding CID extension" \ |
| 1939 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1940 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1941 | -s "server hello, adding CID extension" \ |
| 1942 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1943 | -c "Use of CID extension negotiated" \ |
| 1944 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1945 | -c "Copy CIDs into SSL transform" \ |
| 1946 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1947 | -c "Peer CID (length 0 Bytes):" \ |
| 1948 | -s "Use of Connection ID has been negotiated" \ |
| 1949 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1950 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1951 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1952 | 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] | 1953 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1954 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1955 | 0 \ |
| 1956 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1957 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1958 | -c "client hello, adding CID extension" \ |
| 1959 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1960 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1961 | -s "server hello, adding CID extension" \ |
| 1962 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1963 | -c "Use of CID extension negotiated" \ |
| 1964 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1965 | -c "Copy CIDs into SSL transform" \ |
| 1966 | -S "Use of Connection ID has been negotiated" \ |
| 1967 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1968 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1972 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1974 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1975 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1976 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1977 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1978 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1979 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1980 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1981 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1982 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1983 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1985 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1986 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1987 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1988 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1989 | 0 \ |
| 1990 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1991 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1992 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1993 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1994 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1995 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1996 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1997 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1998 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2001 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2002 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2003 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2004 | 0 \ |
| 2005 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2006 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2007 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2008 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2009 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2010 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2011 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2012 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2013 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2014 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2016 | 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] | 2017 | -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] | 2018 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2019 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2020 | 0 \ |
| 2021 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2022 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2023 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2024 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2025 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2026 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2027 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2028 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2029 | -c "ignoring unexpected CID" \ |
| 2030 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2031 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2032 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2033 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2034 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2035 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2036 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2037 | 0 \ |
| 2038 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2039 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2040 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2041 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2042 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2043 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2044 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2045 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2049 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2050 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2051 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2052 | 0 \ |
| 2053 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2054 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2055 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2056 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2057 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2058 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2059 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2060 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2061 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2063 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2064 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2065 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2066 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2067 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2068 | 0 \ |
| 2069 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2070 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2071 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2072 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2073 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2074 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2075 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2076 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2077 | -c "ignoring unexpected CID" \ |
| 2078 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2079 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2080 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2082 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2083 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2084 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2085 | 0 \ |
| 2086 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2087 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2088 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2089 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2090 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2091 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2092 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2093 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2095 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2096 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2097 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2098 | 0 \ |
| 2099 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2100 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2101 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2102 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2103 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2104 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2105 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2106 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2107 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2108 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2109 | -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] | 2110 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2111 | "$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" \ |
| 2112 | 0 \ |
| 2113 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2114 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2115 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2116 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2117 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2118 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2119 | -c "ignoring unexpected CID" \ |
| 2120 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2121 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2122 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2123 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2124 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2125 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2126 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2127 | 0 \ |
| 2128 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2129 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2130 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2131 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2132 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2133 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2134 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2135 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2136 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2137 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2138 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2140 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2141 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2142 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2143 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2144 | 0 \ |
| 2145 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2146 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2147 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2148 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2149 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2150 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2151 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2152 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2153 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2154 | -c "ignoring unexpected CID" \ |
| 2155 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2156 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2159 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2160 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2161 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2162 | 0 \ |
| 2163 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2164 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2165 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2166 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2167 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2168 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2169 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2170 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2171 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2172 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2173 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2174 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2175 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2176 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2177 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2178 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2179 | 0 \ |
| 2180 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2181 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2182 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2183 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2184 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2185 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2186 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2187 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2188 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2189 | -c "ignoring unexpected CID" \ |
| 2190 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2191 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2192 | # Tests for Encrypt-then-MAC extension |
| 2193 | |
| 2194 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2195 | "$P_SRV debug_level=3 \ |
| 2196 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2197 | "$P_CLI debug_level=3" \ |
| 2198 | 0 \ |
| 2199 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2200 | -s "found encrypt then mac extension" \ |
| 2201 | -s "server hello, adding encrypt then mac extension" \ |
| 2202 | -c "found encrypt_then_mac extension" \ |
| 2203 | -c "using encrypt then mac" \ |
| 2204 | -s "using encrypt then mac" |
| 2205 | |
| 2206 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2207 | "$P_SRV debug_level=3 etm=0 \ |
| 2208 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2209 | "$P_CLI debug_level=3 etm=1" \ |
| 2210 | 0 \ |
| 2211 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2212 | -s "found encrypt then mac extension" \ |
| 2213 | -S "server hello, adding encrypt then mac extension" \ |
| 2214 | -C "found encrypt_then_mac extension" \ |
| 2215 | -C "using encrypt then mac" \ |
| 2216 | -S "using encrypt then mac" |
| 2217 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2218 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2219 | "$P_SRV debug_level=3 etm=1 \ |
| 2220 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2221 | "$P_CLI debug_level=3 etm=1" \ |
| 2222 | 0 \ |
| 2223 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2224 | -s "found encrypt then mac extension" \ |
| 2225 | -S "server hello, adding encrypt then mac extension" \ |
| 2226 | -C "found encrypt_then_mac extension" \ |
| 2227 | -C "using encrypt then mac" \ |
| 2228 | -S "using encrypt then mac" |
| 2229 | |
| 2230 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2231 | "$P_SRV debug_level=3 etm=1 \ |
| 2232 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2233 | "$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] | 2234 | 0 \ |
| 2235 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2236 | -s "found encrypt then mac extension" \ |
| 2237 | -S "server hello, adding encrypt then mac extension" \ |
| 2238 | -C "found encrypt_then_mac extension" \ |
| 2239 | -C "using encrypt then mac" \ |
| 2240 | -S "using encrypt then mac" |
| 2241 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2242 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2243 | "$P_SRV debug_level=3 etm=1 \ |
| 2244 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2245 | "$P_CLI debug_level=3 etm=0" \ |
| 2246 | 0 \ |
| 2247 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2248 | -S "found encrypt then mac extension" \ |
| 2249 | -S "server hello, adding encrypt then mac extension" \ |
| 2250 | -C "found encrypt_then_mac extension" \ |
| 2251 | -C "using encrypt then mac" \ |
| 2252 | -S "using encrypt then mac" |
| 2253 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2254 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2255 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2256 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2257 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2258 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2259 | 0 \ |
| 2260 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2261 | -S "found encrypt then mac extension" \ |
| 2262 | -S "server hello, adding encrypt then mac extension" \ |
| 2263 | -C "found encrypt_then_mac extension" \ |
| 2264 | -C "using encrypt then mac" \ |
| 2265 | -S "using encrypt then mac" |
| 2266 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2268 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2269 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2270 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2271 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2272 | 0 \ |
| 2273 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2274 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2275 | -S "server hello, adding encrypt then mac extension" \ |
| 2276 | -C "found encrypt_then_mac extension" \ |
| 2277 | -C "using encrypt then mac" \ |
| 2278 | -S "using encrypt then mac" |
| 2279 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2280 | # Tests for Extended Master Secret extension |
| 2281 | |
| 2282 | run_test "Extended Master Secret: default" \ |
| 2283 | "$P_SRV debug_level=3" \ |
| 2284 | "$P_CLI debug_level=3" \ |
| 2285 | 0 \ |
| 2286 | -c "client hello, adding extended_master_secret extension" \ |
| 2287 | -s "found extended master secret extension" \ |
| 2288 | -s "server hello, adding extended master secret extension" \ |
| 2289 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2290 | -c "session hash for extended master secret" \ |
| 2291 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2292 | |
| 2293 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2294 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2295 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2296 | 0 \ |
| 2297 | -c "client hello, adding extended_master_secret extension" \ |
| 2298 | -s "found extended master secret extension" \ |
| 2299 | -S "server hello, adding extended master secret extension" \ |
| 2300 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2301 | -C "session hash for extended master secret" \ |
| 2302 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2303 | |
| 2304 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2305 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2306 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2307 | 0 \ |
| 2308 | -C "client hello, adding extended_master_secret extension" \ |
| 2309 | -S "found extended master secret extension" \ |
| 2310 | -S "server hello, adding extended master secret extension" \ |
| 2311 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2312 | -C "session hash for extended master secret" \ |
| 2313 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2314 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2316 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2317 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2318 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2319 | 0 \ |
| 2320 | -C "client hello, adding extended_master_secret extension" \ |
| 2321 | -S "found extended master secret extension" \ |
| 2322 | -S "server hello, adding extended master secret extension" \ |
| 2323 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2324 | -C "session hash for extended master secret" \ |
| 2325 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2326 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2328 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2329 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2330 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2331 | 0 \ |
| 2332 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2333 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2334 | -S "server hello, adding extended master secret extension" \ |
| 2335 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2336 | -C "session hash for extended master secret" \ |
| 2337 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2338 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2339 | # Tests for FALLBACK_SCSV |
| 2340 | |
| 2341 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2342 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2343 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2344 | 0 \ |
| 2345 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2346 | -S "received FALLBACK_SCSV" \ |
| 2347 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2348 | -C "is a fatal alert message (msg 86)" |
| 2349 | |
| 2350 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2351 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2352 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2353 | 0 \ |
| 2354 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2355 | -S "received FALLBACK_SCSV" \ |
| 2356 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2357 | -C "is a fatal alert message (msg 86)" |
| 2358 | |
| 2359 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2360 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2361 | "$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] | 2362 | 1 \ |
| 2363 | -c "adding FALLBACK_SCSV" \ |
| 2364 | -s "received FALLBACK_SCSV" \ |
| 2365 | -s "inapropriate fallback" \ |
| 2366 | -c "is a fatal alert message (msg 86)" |
| 2367 | |
| 2368 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2369 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2370 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2371 | 0 \ |
| 2372 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2373 | -s "received FALLBACK_SCSV" \ |
| 2374 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2375 | -C "is a fatal alert message (msg 86)" |
| 2376 | |
| 2377 | requires_openssl_with_fallback_scsv |
| 2378 | run_test "Fallback SCSV: default, openssl server" \ |
| 2379 | "$O_SRV" \ |
| 2380 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2381 | 0 \ |
| 2382 | -C "adding FALLBACK_SCSV" \ |
| 2383 | -C "is a fatal alert message (msg 86)" |
| 2384 | |
| 2385 | requires_openssl_with_fallback_scsv |
| 2386 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2387 | "$O_SRV" \ |
| 2388 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2389 | 1 \ |
| 2390 | -c "adding FALLBACK_SCSV" \ |
| 2391 | -c "is a fatal alert message (msg 86)" |
| 2392 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2393 | requires_openssl_with_fallback_scsv |
| 2394 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2395 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2396 | "$O_CLI -tls1_1" \ |
| 2397 | 0 \ |
| 2398 | -S "received FALLBACK_SCSV" \ |
| 2399 | -S "inapropriate fallback" |
| 2400 | |
| 2401 | requires_openssl_with_fallback_scsv |
| 2402 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2403 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2404 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2405 | 1 \ |
| 2406 | -s "received FALLBACK_SCSV" \ |
| 2407 | -s "inapropriate fallback" |
| 2408 | |
| 2409 | requires_openssl_with_fallback_scsv |
| 2410 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2411 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2412 | "$O_CLI -fallback_scsv" \ |
| 2413 | 0 \ |
| 2414 | -s "received FALLBACK_SCSV" \ |
| 2415 | -S "inapropriate fallback" |
| 2416 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2417 | # Test sending and receiving empty application data records |
| 2418 | |
| 2419 | run_test "Encrypt then MAC: empty application data record" \ |
| 2420 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2421 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2422 | 0 \ |
| 2423 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2424 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2425 | -c "0 bytes written in 1 fragments" |
| 2426 | |
| 2427 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2428 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2429 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2430 | 0 \ |
| 2431 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2432 | -c "0 bytes written in 1 fragments" |
| 2433 | |
| 2434 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2435 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2436 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2437 | 0 \ |
| 2438 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2439 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2440 | -c "0 bytes written in 1 fragments" |
| 2441 | |
| 2442 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2443 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2444 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2445 | 0 \ |
| 2446 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2447 | -c "0 bytes written in 1 fragments" |
| 2448 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2449 | ## ClientHello generated with |
| 2450 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2451 | ## then manually twiddling the ciphersuite list. |
| 2452 | ## The ClientHello content is spelled out below as a hex string as |
| 2453 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2454 | ## The expected response is an inappropriate_fallback alert. |
| 2455 | requires_openssl_with_fallback_scsv |
| 2456 | run_test "Fallback SCSV: beginning of list" \ |
| 2457 | "$P_SRV debug_level=2" \ |
| 2458 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2459 | 0 \ |
| 2460 | -s "received FALLBACK_SCSV" \ |
| 2461 | -s "inapropriate fallback" |
| 2462 | |
| 2463 | requires_openssl_with_fallback_scsv |
| 2464 | run_test "Fallback SCSV: end of list" \ |
| 2465 | "$P_SRV debug_level=2" \ |
| 2466 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2467 | 0 \ |
| 2468 | -s "received FALLBACK_SCSV" \ |
| 2469 | -s "inapropriate fallback" |
| 2470 | |
| 2471 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2472 | requires_openssl_with_fallback_scsv |
| 2473 | run_test "Fallback SCSV: not in list" \ |
| 2474 | "$P_SRV debug_level=2" \ |
| 2475 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2476 | 0 \ |
| 2477 | -S "received FALLBACK_SCSV" \ |
| 2478 | -S "inapropriate fallback" |
| 2479 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2480 | # Tests for CBC 1/n-1 record splitting |
| 2481 | |
| 2482 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2483 | "$P_SRV" \ |
| 2484 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2485 | request_size=123 force_version=tls1_2" \ |
| 2486 | 0 \ |
| 2487 | -s "Read from client: 123 bytes read" \ |
| 2488 | -S "Read from client: 1 bytes read" \ |
| 2489 | -S "122 bytes read" |
| 2490 | |
| 2491 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2492 | "$P_SRV" \ |
| 2493 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2494 | request_size=123 force_version=tls1_1" \ |
| 2495 | 0 \ |
| 2496 | -s "Read from client: 123 bytes read" \ |
| 2497 | -S "Read from client: 1 bytes read" \ |
| 2498 | -S "122 bytes read" |
| 2499 | |
| 2500 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2501 | "$P_SRV" \ |
| 2502 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2503 | request_size=123 force_version=tls1" \ |
| 2504 | 0 \ |
| 2505 | -S "Read from client: 123 bytes read" \ |
| 2506 | -s "Read from client: 1 bytes read" \ |
| 2507 | -s "122 bytes read" |
| 2508 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2510 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2511 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2512 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2513 | request_size=123 force_version=ssl3" \ |
| 2514 | 0 \ |
| 2515 | -S "Read from client: 123 bytes read" \ |
| 2516 | -s "Read from client: 1 bytes read" \ |
| 2517 | -s "122 bytes read" |
| 2518 | |
| 2519 | 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] | 2520 | "$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] | 2521 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2522 | request_size=123 force_version=tls1" \ |
| 2523 | 0 \ |
| 2524 | -s "Read from client: 123 bytes read" \ |
| 2525 | -S "Read from client: 1 bytes read" \ |
| 2526 | -S "122 bytes read" |
| 2527 | |
| 2528 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2529 | "$P_SRV" \ |
| 2530 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2531 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2532 | 0 \ |
| 2533 | -s "Read from client: 123 bytes read" \ |
| 2534 | -S "Read from client: 1 bytes read" \ |
| 2535 | -S "122 bytes read" |
| 2536 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2537 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2538 | "$P_SRV nbio=2" \ |
| 2539 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2540 | request_size=123 force_version=tls1" \ |
| 2541 | 0 \ |
| 2542 | -S "Read from client: 123 bytes read" \ |
| 2543 | -s "Read from client: 1 bytes read" \ |
| 2544 | -s "122 bytes read" |
| 2545 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2546 | # Tests for Session Tickets |
| 2547 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2548 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2549 | "$P_SRV debug_level=3 tickets=1" \ |
| 2550 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2551 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2552 | -c "client hello, adding session ticket extension" \ |
| 2553 | -s "found session ticket extension" \ |
| 2554 | -s "server hello, adding session ticket extension" \ |
| 2555 | -c "found session_ticket extension" \ |
| 2556 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2557 | -S "session successfully restored from cache" \ |
| 2558 | -s "session successfully restored from ticket" \ |
| 2559 | -s "a session has been resumed" \ |
| 2560 | -c "a session has been resumed" |
| 2561 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2562 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2563 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2564 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2565 | 0 \ |
| 2566 | -c "client hello, adding session ticket extension" \ |
| 2567 | -s "found session ticket extension" \ |
| 2568 | -s "server hello, adding session ticket extension" \ |
| 2569 | -c "found session_ticket extension" \ |
| 2570 | -c "parse new session ticket" \ |
| 2571 | -S "session successfully restored from cache" \ |
| 2572 | -s "session successfully restored from ticket" \ |
| 2573 | -s "a session has been resumed" \ |
| 2574 | -c "a session has been resumed" |
| 2575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2576 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2577 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2578 | "$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] | 2579 | 0 \ |
| 2580 | -c "client hello, adding session ticket extension" \ |
| 2581 | -s "found session ticket extension" \ |
| 2582 | -s "server hello, adding session ticket extension" \ |
| 2583 | -c "found session_ticket extension" \ |
| 2584 | -c "parse new session ticket" \ |
| 2585 | -S "session successfully restored from cache" \ |
| 2586 | -S "session successfully restored from ticket" \ |
| 2587 | -S "a session has been resumed" \ |
| 2588 | -C "a session has been resumed" |
| 2589 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2590 | run_test "Session resume using tickets: session copy" \ |
| 2591 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2592 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2593 | 0 \ |
| 2594 | -c "client hello, adding session ticket extension" \ |
| 2595 | -s "found session ticket extension" \ |
| 2596 | -s "server hello, adding session ticket extension" \ |
| 2597 | -c "found session_ticket extension" \ |
| 2598 | -c "parse new session ticket" \ |
| 2599 | -S "session successfully restored from cache" \ |
| 2600 | -s "session successfully restored from ticket" \ |
| 2601 | -s "a session has been resumed" \ |
| 2602 | -c "a session has been resumed" |
| 2603 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2604 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2605 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2606 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2607 | 0 \ |
| 2608 | -c "client hello, adding session ticket extension" \ |
| 2609 | -c "found session_ticket extension" \ |
| 2610 | -c "parse new session ticket" \ |
| 2611 | -c "a session has been resumed" |
| 2612 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2613 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2614 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2615 | "( $O_CLI -sess_out $SESSION; \ |
| 2616 | $O_CLI -sess_in $SESSION; \ |
| 2617 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2618 | 0 \ |
| 2619 | -s "found session ticket extension" \ |
| 2620 | -s "server hello, adding session ticket extension" \ |
| 2621 | -S "session successfully restored from cache" \ |
| 2622 | -s "session successfully restored from ticket" \ |
| 2623 | -s "a session has been resumed" |
| 2624 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2625 | # Tests for Session Tickets with DTLS |
| 2626 | |
| 2627 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2628 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2629 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2630 | 0 \ |
| 2631 | -c "client hello, adding session ticket extension" \ |
| 2632 | -s "found session ticket extension" \ |
| 2633 | -s "server hello, adding session ticket extension" \ |
| 2634 | -c "found session_ticket extension" \ |
| 2635 | -c "parse new session ticket" \ |
| 2636 | -S "session successfully restored from cache" \ |
| 2637 | -s "session successfully restored from ticket" \ |
| 2638 | -s "a session has been resumed" \ |
| 2639 | -c "a session has been resumed" |
| 2640 | |
| 2641 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2642 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2643 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2644 | 0 \ |
| 2645 | -c "client hello, adding session ticket extension" \ |
| 2646 | -s "found session ticket extension" \ |
| 2647 | -s "server hello, adding session ticket extension" \ |
| 2648 | -c "found session_ticket extension" \ |
| 2649 | -c "parse new session ticket" \ |
| 2650 | -S "session successfully restored from cache" \ |
| 2651 | -s "session successfully restored from ticket" \ |
| 2652 | -s "a session has been resumed" \ |
| 2653 | -c "a session has been resumed" |
| 2654 | |
| 2655 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2656 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2657 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2658 | 0 \ |
| 2659 | -c "client hello, adding session ticket extension" \ |
| 2660 | -s "found session ticket extension" \ |
| 2661 | -s "server hello, adding session ticket extension" \ |
| 2662 | -c "found session_ticket extension" \ |
| 2663 | -c "parse new session ticket" \ |
| 2664 | -S "session successfully restored from cache" \ |
| 2665 | -S "session successfully restored from ticket" \ |
| 2666 | -S "a session has been resumed" \ |
| 2667 | -C "a session has been resumed" |
| 2668 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2669 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2670 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2671 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ |
| 2672 | 0 \ |
| 2673 | -c "client hello, adding session ticket extension" \ |
| 2674 | -s "found session ticket extension" \ |
| 2675 | -s "server hello, adding session ticket extension" \ |
| 2676 | -c "found session_ticket extension" \ |
| 2677 | -c "parse new session ticket" \ |
| 2678 | -S "session successfully restored from cache" \ |
| 2679 | -s "session successfully restored from ticket" \ |
| 2680 | -s "a session has been resumed" \ |
| 2681 | -c "a session has been resumed" |
| 2682 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2683 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2684 | "$O_SRV -dtls1" \ |
| 2685 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2686 | 0 \ |
| 2687 | -c "client hello, adding session ticket extension" \ |
| 2688 | -c "found session_ticket extension" \ |
| 2689 | -c "parse new session ticket" \ |
| 2690 | -c "a session has been resumed" |
| 2691 | |
| 2692 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2693 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2694 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2695 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2696 | rm -f $SESSION )" \ |
| 2697 | 0 \ |
| 2698 | -s "found session ticket extension" \ |
| 2699 | -s "server hello, adding session ticket extension" \ |
| 2700 | -S "session successfully restored from cache" \ |
| 2701 | -s "session successfully restored from ticket" \ |
| 2702 | -s "a session has been resumed" |
| 2703 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2704 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2706 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2707 | "$P_SRV debug_level=3 tickets=0" \ |
| 2708 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2709 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2710 | -c "client hello, adding session ticket extension" \ |
| 2711 | -s "found session ticket extension" \ |
| 2712 | -S "server hello, adding session ticket extension" \ |
| 2713 | -C "found session_ticket extension" \ |
| 2714 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2715 | -s "session successfully restored from cache" \ |
| 2716 | -S "session successfully restored from ticket" \ |
| 2717 | -s "a session has been resumed" \ |
| 2718 | -c "a session has been resumed" |
| 2719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2720 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2721 | "$P_SRV debug_level=3 tickets=1" \ |
| 2722 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2723 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2724 | -C "client hello, adding session ticket extension" \ |
| 2725 | -S "found session ticket extension" \ |
| 2726 | -S "server hello, adding session ticket extension" \ |
| 2727 | -C "found session_ticket extension" \ |
| 2728 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2729 | -s "session successfully restored from cache" \ |
| 2730 | -S "session successfully restored from ticket" \ |
| 2731 | -s "a session has been resumed" \ |
| 2732 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2734 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2735 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2736 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2737 | 0 \ |
| 2738 | -S "session successfully restored from cache" \ |
| 2739 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2740 | -S "a session has been resumed" \ |
| 2741 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2743 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2744 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2745 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2746 | 0 \ |
| 2747 | -s "session successfully restored from cache" \ |
| 2748 | -S "session successfully restored from ticket" \ |
| 2749 | -s "a session has been resumed" \ |
| 2750 | -c "a session has been resumed" |
| 2751 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2752 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2753 | "$P_SRV debug_level=3 tickets=0" \ |
| 2754 | "$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] | 2755 | 0 \ |
| 2756 | -s "session successfully restored from cache" \ |
| 2757 | -S "session successfully restored from ticket" \ |
| 2758 | -s "a session has been resumed" \ |
| 2759 | -c "a session has been resumed" |
| 2760 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2761 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2762 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2763 | "$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] | 2764 | 0 \ |
| 2765 | -S "session successfully restored from cache" \ |
| 2766 | -S "session successfully restored from ticket" \ |
| 2767 | -S "a session has been resumed" \ |
| 2768 | -C "a session has been resumed" |
| 2769 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2770 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2771 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2772 | "$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] | 2773 | 0 \ |
| 2774 | -s "session successfully restored from cache" \ |
| 2775 | -S "session successfully restored from ticket" \ |
| 2776 | -s "a session has been resumed" \ |
| 2777 | -c "a session has been resumed" |
| 2778 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2779 | run_test "Session resume using cache: session copy" \ |
| 2780 | "$P_SRV debug_level=3 tickets=0" \ |
| 2781 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2782 | 0 \ |
| 2783 | -s "session successfully restored from cache" \ |
| 2784 | -S "session successfully restored from ticket" \ |
| 2785 | -s "a session has been resumed" \ |
| 2786 | -c "a session has been resumed" |
| 2787 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2788 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2789 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2790 | "( $O_CLI -sess_out $SESSION; \ |
| 2791 | $O_CLI -sess_in $SESSION; \ |
| 2792 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2793 | 0 \ |
| 2794 | -s "found session ticket extension" \ |
| 2795 | -S "server hello, adding session ticket extension" \ |
| 2796 | -s "session successfully restored from cache" \ |
| 2797 | -S "session successfully restored from ticket" \ |
| 2798 | -s "a session has been resumed" |
| 2799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2800 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2801 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2802 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2803 | 0 \ |
| 2804 | -C "found session_ticket extension" \ |
| 2805 | -C "parse new session ticket" \ |
| 2806 | -c "a session has been resumed" |
| 2807 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2808 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2809 | |
| 2810 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2811 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2812 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2813 | 0 \ |
| 2814 | -c "client hello, adding session ticket extension" \ |
| 2815 | -s "found session ticket extension" \ |
| 2816 | -S "server hello, adding session ticket extension" \ |
| 2817 | -C "found session_ticket extension" \ |
| 2818 | -C "parse new session ticket" \ |
| 2819 | -s "session successfully restored from cache" \ |
| 2820 | -S "session successfully restored from ticket" \ |
| 2821 | -s "a session has been resumed" \ |
| 2822 | -c "a session has been resumed" |
| 2823 | |
| 2824 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2825 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2826 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2827 | 0 \ |
| 2828 | -C "client hello, adding session ticket extension" \ |
| 2829 | -S "found session ticket extension" \ |
| 2830 | -S "server hello, adding session ticket extension" \ |
| 2831 | -C "found session_ticket extension" \ |
| 2832 | -C "parse new session ticket" \ |
| 2833 | -s "session successfully restored from cache" \ |
| 2834 | -S "session successfully restored from ticket" \ |
| 2835 | -s "a session has been resumed" \ |
| 2836 | -c "a session has been resumed" |
| 2837 | |
| 2838 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2839 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2840 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2841 | 0 \ |
| 2842 | -S "session successfully restored from cache" \ |
| 2843 | -S "session successfully restored from ticket" \ |
| 2844 | -S "a session has been resumed" \ |
| 2845 | -C "a session has been resumed" |
| 2846 | |
| 2847 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2848 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2849 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2850 | 0 \ |
| 2851 | -s "session successfully restored from cache" \ |
| 2852 | -S "session successfully restored from ticket" \ |
| 2853 | -s "a session has been resumed" \ |
| 2854 | -c "a session has been resumed" |
| 2855 | |
| 2856 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2857 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2858 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2859 | 0 \ |
| 2860 | -s "session successfully restored from cache" \ |
| 2861 | -S "session successfully restored from ticket" \ |
| 2862 | -s "a session has been resumed" \ |
| 2863 | -c "a session has been resumed" |
| 2864 | |
| 2865 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2866 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2867 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2868 | 0 \ |
| 2869 | -S "session successfully restored from cache" \ |
| 2870 | -S "session successfully restored from ticket" \ |
| 2871 | -S "a session has been resumed" \ |
| 2872 | -C "a session has been resumed" |
| 2873 | |
| 2874 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2875 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2876 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2877 | 0 \ |
| 2878 | -s "session successfully restored from cache" \ |
| 2879 | -S "session successfully restored from ticket" \ |
| 2880 | -s "a session has been resumed" \ |
| 2881 | -c "a session has been resumed" |
| 2882 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2883 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2884 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2885 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2886 | 0 \ |
| 2887 | -s "session successfully restored from cache" \ |
| 2888 | -S "session successfully restored from ticket" \ |
| 2889 | -s "a session has been resumed" \ |
| 2890 | -c "a session has been resumed" |
| 2891 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2892 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2893 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2894 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2895 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2896 | rm -f $SESSION )" \ |
| 2897 | 0 \ |
| 2898 | -s "found session ticket extension" \ |
| 2899 | -S "server hello, adding session ticket extension" \ |
| 2900 | -s "session successfully restored from cache" \ |
| 2901 | -S "session successfully restored from ticket" \ |
| 2902 | -s "a session has been resumed" |
| 2903 | |
| 2904 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2905 | "$O_SRV -dtls1" \ |
| 2906 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2907 | 0 \ |
| 2908 | -C "found session_ticket extension" \ |
| 2909 | -C "parse new session ticket" \ |
| 2910 | -c "a session has been resumed" |
| 2911 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2912 | # Tests for Max Fragment Length extension |
| 2913 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2914 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2915 | 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] | 2916 | exit 1 |
| 2917 | fi |
| 2918 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2919 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2920 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2921 | fi |
| 2922 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2923 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2924 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2925 | "$P_SRV debug_level=3" \ |
| 2926 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2927 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2928 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2929 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2930 | -C "client hello, adding max_fragment_length extension" \ |
| 2931 | -S "found max fragment length extension" \ |
| 2932 | -S "server hello, max_fragment_length extension" \ |
| 2933 | -C "found max_fragment_length extension" |
| 2934 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2935 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2936 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2937 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2938 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2939 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2940 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2941 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2942 | -C "client hello, adding max_fragment_length extension" \ |
| 2943 | -S "found max fragment length extension" \ |
| 2944 | -S "server hello, max_fragment_length extension" \ |
| 2945 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2946 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2947 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2948 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2949 | |
| 2950 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2951 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2952 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2953 | "$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] | 2954 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2955 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2956 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2957 | -C "client hello, adding max_fragment_length extension" \ |
| 2958 | -S "found max fragment length extension" \ |
| 2959 | -S "server hello, max_fragment_length extension" \ |
| 2960 | -C "found max_fragment_length extension" \ |
| 2961 | -c "fragment larger than.*maximum " |
| 2962 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2963 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2964 | # (session fragment length will be 16384 regardless of mbedtls |
| 2965 | # content length configuration.) |
| 2966 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2967 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2968 | run_test "Max fragment length: disabled, larger message" \ |
| 2969 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2970 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2971 | 0 \ |
| 2972 | -C "Maximum fragment length is 16384" \ |
| 2973 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2974 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2975 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2976 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2977 | |
| 2978 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2979 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2980 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2981 | "$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] | 2982 | 1 \ |
| 2983 | -C "Maximum fragment length is 16384" \ |
| 2984 | -S "Maximum fragment length is 16384" \ |
| 2985 | -c "fragment larger than.*maximum " |
| 2986 | |
| 2987 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2988 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2989 | "$P_SRV debug_level=3" \ |
| 2990 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2991 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2992 | -c "Maximum fragment length is 4096" \ |
| 2993 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2994 | -c "client hello, adding max_fragment_length extension" \ |
| 2995 | -s "found max fragment length extension" \ |
| 2996 | -s "server hello, max_fragment_length extension" \ |
| 2997 | -c "found max_fragment_length extension" |
| 2998 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2999 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3000 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3001 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3002 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3003 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3004 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3005 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3006 | -C "client hello, adding max_fragment_length extension" \ |
| 3007 | -S "found max fragment length extension" \ |
| 3008 | -S "server hello, max_fragment_length extension" \ |
| 3009 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3010 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3011 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3012 | requires_gnutls |
| 3013 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3014 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3015 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3016 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3017 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3018 | -c "client hello, adding max_fragment_length extension" \ |
| 3019 | -c "found max_fragment_length extension" |
| 3020 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3022 | run_test "Max fragment length: client, message just fits" \ |
| 3023 | "$P_SRV debug_level=3" \ |
| 3024 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3025 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3026 | -c "Maximum fragment length is 2048" \ |
| 3027 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3028 | -c "client hello, adding max_fragment_length extension" \ |
| 3029 | -s "found max fragment length extension" \ |
| 3030 | -s "server hello, max_fragment_length extension" \ |
| 3031 | -c "found max_fragment_length extension" \ |
| 3032 | -c "2048 bytes written in 1 fragments" \ |
| 3033 | -s "2048 bytes read" |
| 3034 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3035 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3036 | run_test "Max fragment length: client, larger message" \ |
| 3037 | "$P_SRV debug_level=3" \ |
| 3038 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3039 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3040 | -c "Maximum fragment length is 2048" \ |
| 3041 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3042 | -c "client hello, adding max_fragment_length extension" \ |
| 3043 | -s "found max fragment length extension" \ |
| 3044 | -s "server hello, max_fragment_length extension" \ |
| 3045 | -c "found max_fragment_length extension" \ |
| 3046 | -c "2345 bytes written in 2 fragments" \ |
| 3047 | -s "2048 bytes read" \ |
| 3048 | -s "297 bytes read" |
| 3049 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3050 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3051 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3052 | "$P_SRV debug_level=3 dtls=1" \ |
| 3053 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3054 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 3055 | -c "Maximum fragment length is 2048" \ |
| 3056 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3057 | -c "client hello, adding max_fragment_length extension" \ |
| 3058 | -s "found max fragment length extension" \ |
| 3059 | -s "server hello, max_fragment_length extension" \ |
| 3060 | -c "found max_fragment_length extension" \ |
| 3061 | -c "fragment larger than.*maximum" |
| 3062 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3063 | # Tests for renegotiation |
| 3064 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3065 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3066 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3067 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3068 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3069 | 0 \ |
| 3070 | -C "client hello, adding renegotiation extension" \ |
| 3071 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3072 | -S "found renegotiation extension" \ |
| 3073 | -s "server hello, secure renegotiation extension" \ |
| 3074 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3075 | -C "=> renegotiate" \ |
| 3076 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3077 | -S "write hello request" |
| 3078 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3079 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3080 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3081 | "$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] | 3082 | "$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] | 3083 | 0 \ |
| 3084 | -c "client hello, adding renegotiation extension" \ |
| 3085 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3086 | -s "found renegotiation extension" \ |
| 3087 | -s "server hello, secure renegotiation extension" \ |
| 3088 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3089 | -c "=> renegotiate" \ |
| 3090 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3091 | -S "write hello request" |
| 3092 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3093 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3094 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3095 | "$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] | 3096 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3097 | 0 \ |
| 3098 | -c "client hello, adding renegotiation extension" \ |
| 3099 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3100 | -s "found renegotiation extension" \ |
| 3101 | -s "server hello, secure renegotiation extension" \ |
| 3102 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3103 | -c "=> renegotiate" \ |
| 3104 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3105 | -s "write hello request" |
| 3106 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3107 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3108 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3109 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3110 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3111 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3112 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3113 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3114 | 0 \ |
| 3115 | -c "client hello, adding renegotiation extension" \ |
| 3116 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3117 | -s "found renegotiation extension" \ |
| 3118 | -s "server hello, secure renegotiation extension" \ |
| 3119 | -c "found renegotiation extension" \ |
| 3120 | -c "=> renegotiate" \ |
| 3121 | -s "=> renegotiate" \ |
| 3122 | -S "write hello request" \ |
| 3123 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3124 | |
| 3125 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3126 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3127 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3128 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3129 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3130 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3131 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3132 | 0 \ |
| 3133 | -c "client hello, adding renegotiation extension" \ |
| 3134 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3135 | -s "found renegotiation extension" \ |
| 3136 | -s "server hello, secure renegotiation extension" \ |
| 3137 | -c "found renegotiation extension" \ |
| 3138 | -c "=> renegotiate" \ |
| 3139 | -s "=> renegotiate" \ |
| 3140 | -s "write hello request" \ |
| 3141 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3142 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3143 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3144 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3145 | "$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] | 3146 | "$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] | 3147 | 0 \ |
| 3148 | -c "client hello, adding renegotiation extension" \ |
| 3149 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3150 | -s "found renegotiation extension" \ |
| 3151 | -s "server hello, secure renegotiation extension" \ |
| 3152 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3153 | -c "=> renegotiate" \ |
| 3154 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3155 | -s "write hello request" |
| 3156 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3157 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3158 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3159 | "$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] | 3160 | "$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] | 3161 | 1 \ |
| 3162 | -c "client hello, adding renegotiation extension" \ |
| 3163 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3164 | -S "found renegotiation extension" \ |
| 3165 | -s "server hello, secure renegotiation extension" \ |
| 3166 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3167 | -c "=> renegotiate" \ |
| 3168 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3169 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3170 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3171 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3172 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3173 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3174 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3175 | "$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] | 3176 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3177 | 0 \ |
| 3178 | -C "client hello, adding renegotiation extension" \ |
| 3179 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3180 | -S "found renegotiation extension" \ |
| 3181 | -s "server hello, secure renegotiation extension" \ |
| 3182 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3183 | -C "=> renegotiate" \ |
| 3184 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3185 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3186 | -S "SSL - An unexpected message was received from our peer" \ |
| 3187 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3188 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3190 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3191 | "$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] | 3192 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3193 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3194 | 0 \ |
| 3195 | -C "client hello, adding renegotiation extension" \ |
| 3196 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3197 | -S "found renegotiation extension" \ |
| 3198 | -s "server hello, secure renegotiation extension" \ |
| 3199 | -c "found renegotiation extension" \ |
| 3200 | -C "=> renegotiate" \ |
| 3201 | -S "=> renegotiate" \ |
| 3202 | -s "write hello request" \ |
| 3203 | -S "SSL - An unexpected message was received from our peer" \ |
| 3204 | -S "failed" |
| 3205 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3206 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3207 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3208 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3209 | "$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] | 3210 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3211 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3212 | 0 \ |
| 3213 | -C "client hello, adding renegotiation extension" \ |
| 3214 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3215 | -S "found renegotiation extension" \ |
| 3216 | -s "server hello, secure renegotiation extension" \ |
| 3217 | -c "found renegotiation extension" \ |
| 3218 | -C "=> renegotiate" \ |
| 3219 | -S "=> renegotiate" \ |
| 3220 | -s "write hello request" \ |
| 3221 | -S "SSL - An unexpected message was received from our peer" \ |
| 3222 | -S "failed" |
| 3223 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3225 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3226 | "$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] | 3227 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3228 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3229 | 0 \ |
| 3230 | -C "client hello, adding renegotiation extension" \ |
| 3231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3232 | -S "found renegotiation extension" \ |
| 3233 | -s "server hello, secure renegotiation extension" \ |
| 3234 | -c "found renegotiation extension" \ |
| 3235 | -C "=> renegotiate" \ |
| 3236 | -S "=> renegotiate" \ |
| 3237 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3238 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3239 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3240 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3241 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3242 | "$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] | 3243 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3244 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3245 | 0 \ |
| 3246 | -c "client hello, adding renegotiation extension" \ |
| 3247 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3248 | -s "found renegotiation extension" \ |
| 3249 | -s "server hello, secure renegotiation extension" \ |
| 3250 | -c "found renegotiation extension" \ |
| 3251 | -c "=> renegotiate" \ |
| 3252 | -s "=> renegotiate" \ |
| 3253 | -s "write hello request" \ |
| 3254 | -S "SSL - An unexpected message was received from our peer" \ |
| 3255 | -S "failed" |
| 3256 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3257 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3258 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3259 | "$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] | 3260 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3261 | 0 \ |
| 3262 | -C "client hello, adding renegotiation extension" \ |
| 3263 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3264 | -S "found renegotiation extension" \ |
| 3265 | -s "server hello, secure renegotiation extension" \ |
| 3266 | -c "found renegotiation extension" \ |
| 3267 | -S "record counter limit reached: renegotiate" \ |
| 3268 | -C "=> renegotiate" \ |
| 3269 | -S "=> renegotiate" \ |
| 3270 | -S "write hello request" \ |
| 3271 | -S "SSL - An unexpected message was received from our peer" \ |
| 3272 | -S "failed" |
| 3273 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3274 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3275 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3276 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3277 | "$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] | 3278 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3279 | 0 \ |
| 3280 | -c "client hello, adding renegotiation extension" \ |
| 3281 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3282 | -s "found renegotiation extension" \ |
| 3283 | -s "server hello, secure renegotiation extension" \ |
| 3284 | -c "found renegotiation extension" \ |
| 3285 | -s "record counter limit reached: renegotiate" \ |
| 3286 | -c "=> renegotiate" \ |
| 3287 | -s "=> renegotiate" \ |
| 3288 | -s "write hello request" \ |
| 3289 | -S "SSL - An unexpected message was received from our peer" \ |
| 3290 | -S "failed" |
| 3291 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3293 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3294 | "$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] | 3295 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3296 | 0 \ |
| 3297 | -c "client hello, adding renegotiation extension" \ |
| 3298 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3299 | -s "found renegotiation extension" \ |
| 3300 | -s "server hello, secure renegotiation extension" \ |
| 3301 | -c "found renegotiation extension" \ |
| 3302 | -s "record counter limit reached: renegotiate" \ |
| 3303 | -c "=> renegotiate" \ |
| 3304 | -s "=> renegotiate" \ |
| 3305 | -s "write hello request" \ |
| 3306 | -S "SSL - An unexpected message was received from our peer" \ |
| 3307 | -S "failed" |
| 3308 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3310 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3311 | "$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] | 3312 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3313 | 0 \ |
| 3314 | -C "client hello, adding renegotiation extension" \ |
| 3315 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3316 | -S "found renegotiation extension" \ |
| 3317 | -s "server hello, secure renegotiation extension" \ |
| 3318 | -c "found renegotiation extension" \ |
| 3319 | -S "record counter limit reached: renegotiate" \ |
| 3320 | -C "=> renegotiate" \ |
| 3321 | -S "=> renegotiate" \ |
| 3322 | -S "write hello request" \ |
| 3323 | -S "SSL - An unexpected message was received from our peer" \ |
| 3324 | -S "failed" |
| 3325 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3326 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3327 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3328 | "$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] | 3329 | "$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] | 3330 | 0 \ |
| 3331 | -c "client hello, adding renegotiation extension" \ |
| 3332 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3333 | -s "found renegotiation extension" \ |
| 3334 | -s "server hello, secure renegotiation extension" \ |
| 3335 | -c "found renegotiation extension" \ |
| 3336 | -c "=> renegotiate" \ |
| 3337 | -s "=> renegotiate" \ |
| 3338 | -S "write hello request" |
| 3339 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3340 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3341 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3342 | "$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] | 3343 | "$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] | 3344 | 0 \ |
| 3345 | -c "client hello, adding renegotiation extension" \ |
| 3346 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3347 | -s "found renegotiation extension" \ |
| 3348 | -s "server hello, secure renegotiation extension" \ |
| 3349 | -c "found renegotiation extension" \ |
| 3350 | -c "=> renegotiate" \ |
| 3351 | -s "=> renegotiate" \ |
| 3352 | -s "write hello request" |
| 3353 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3355 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3356 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3357 | "$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] | 3358 | 0 \ |
| 3359 | -c "client hello, adding renegotiation extension" \ |
| 3360 | -c "found renegotiation extension" \ |
| 3361 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3362 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3363 | -C "error" \ |
| 3364 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3365 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3366 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3368 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3369 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3370 | "$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] | 3371 | 0 \ |
| 3372 | -c "client hello, adding renegotiation extension" \ |
| 3373 | -c "found renegotiation extension" \ |
| 3374 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3375 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3376 | -C "error" \ |
| 3377 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3378 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3379 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3380 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3381 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3382 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3383 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3384 | 1 \ |
| 3385 | -c "client hello, adding renegotiation extension" \ |
| 3386 | -C "found renegotiation extension" \ |
| 3387 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3388 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3389 | -c "error" \ |
| 3390 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3391 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3392 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3393 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3394 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3395 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3396 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3397 | allow_legacy=0" \ |
| 3398 | 1 \ |
| 3399 | -c "client hello, adding renegotiation extension" \ |
| 3400 | -C "found renegotiation extension" \ |
| 3401 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3402 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3403 | -c "error" \ |
| 3404 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3405 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3406 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3408 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3409 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3410 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3411 | allow_legacy=1" \ |
| 3412 | 0 \ |
| 3413 | -c "client hello, adding renegotiation extension" \ |
| 3414 | -C "found renegotiation extension" \ |
| 3415 | -c "=> renegotiate" \ |
| 3416 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3417 | -C "error" \ |
| 3418 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3419 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3421 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3422 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3423 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3424 | 0 \ |
| 3425 | -c "client hello, adding renegotiation extension" \ |
| 3426 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3427 | -s "found renegotiation extension" \ |
| 3428 | -s "server hello, secure renegotiation extension" \ |
| 3429 | -c "found renegotiation extension" \ |
| 3430 | -c "=> renegotiate" \ |
| 3431 | -s "=> renegotiate" \ |
| 3432 | -S "write hello request" |
| 3433 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3435 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3436 | "$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] | 3437 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3438 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3439 | 0 \ |
| 3440 | -c "client hello, adding renegotiation extension" \ |
| 3441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3442 | -s "found renegotiation extension" \ |
| 3443 | -s "server hello, secure renegotiation extension" \ |
| 3444 | -c "found renegotiation extension" \ |
| 3445 | -c "=> renegotiate" \ |
| 3446 | -s "=> renegotiate" \ |
| 3447 | -s "write hello request" |
| 3448 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3450 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3451 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3452 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3453 | 0 \ |
| 3454 | -c "client hello, adding renegotiation extension" \ |
| 3455 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3456 | -s "found renegotiation extension" \ |
| 3457 | -s "server hello, secure renegotiation extension" \ |
| 3458 | -s "record counter limit reached: renegotiate" \ |
| 3459 | -c "=> renegotiate" \ |
| 3460 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3461 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3462 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3463 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3464 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3465 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3466 | "$G_SRV -u --mtu 4096" \ |
| 3467 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3468 | 0 \ |
| 3469 | -c "client hello, adding renegotiation extension" \ |
| 3470 | -c "found renegotiation extension" \ |
| 3471 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3472 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3473 | -C "error" \ |
| 3474 | -s "Extra-header:" |
| 3475 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3476 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3477 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3478 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3479 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3480 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3481 | "$P_CLI debug_level=3" \ |
| 3482 | 0 \ |
| 3483 | -c "found renegotiation extension" \ |
| 3484 | -C "error" \ |
| 3485 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3486 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3487 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3488 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3489 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3490 | "$P_CLI debug_level=3" \ |
| 3491 | 0 \ |
| 3492 | -C "found renegotiation extension" \ |
| 3493 | -C "error" \ |
| 3494 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3495 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3496 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3497 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3498 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3499 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3500 | 1 \ |
| 3501 | -C "found renegotiation extension" \ |
| 3502 | -c "error" \ |
| 3503 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3504 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3505 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3506 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3507 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3508 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3509 | 0 \ |
| 3510 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3511 | -s "server hello, secure renegotiation extension" |
| 3512 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3513 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3514 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3515 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3516 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3517 | 0 \ |
| 3518 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3519 | -S "server hello, secure renegotiation extension" |
| 3520 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3521 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3522 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3523 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3524 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3525 | 1 \ |
| 3526 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3527 | -S "server hello, secure renegotiation extension" |
| 3528 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3529 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3530 | |
| 3531 | requires_gnutls |
| 3532 | run_test "DER format: no trailing bytes" \ |
| 3533 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3534 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3535 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3536 | 0 \ |
| 3537 | -c "Handshake was completed" \ |
| 3538 | |
| 3539 | requires_gnutls |
| 3540 | run_test "DER format: with a trailing zero byte" \ |
| 3541 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3542 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3543 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3544 | 0 \ |
| 3545 | -c "Handshake was completed" \ |
| 3546 | |
| 3547 | requires_gnutls |
| 3548 | run_test "DER format: with a trailing random byte" \ |
| 3549 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3550 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3551 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3552 | 0 \ |
| 3553 | -c "Handshake was completed" \ |
| 3554 | |
| 3555 | requires_gnutls |
| 3556 | run_test "DER format: with 2 trailing random bytes" \ |
| 3557 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3558 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3559 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3560 | 0 \ |
| 3561 | -c "Handshake was completed" \ |
| 3562 | |
| 3563 | requires_gnutls |
| 3564 | run_test "DER format: with 4 trailing random bytes" \ |
| 3565 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3566 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3567 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3568 | 0 \ |
| 3569 | -c "Handshake was completed" \ |
| 3570 | |
| 3571 | requires_gnutls |
| 3572 | run_test "DER format: with 8 trailing random bytes" \ |
| 3573 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3574 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3575 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3576 | 0 \ |
| 3577 | -c "Handshake was completed" \ |
| 3578 | |
| 3579 | requires_gnutls |
| 3580 | run_test "DER format: with 9 trailing random bytes" \ |
| 3581 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3582 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3583 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3584 | 0 \ |
| 3585 | -c "Handshake was completed" \ |
| 3586 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3587 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3588 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3589 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3590 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3591 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3592 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3593 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3594 | 1 \ |
| 3595 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3596 | -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] | 3597 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3598 | -c "X509 - Certificate verification failed" |
| 3599 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3600 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3601 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3602 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3603 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3604 | 0 \ |
| 3605 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3606 | -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] | 3607 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3608 | -C "X509 - Certificate verification failed" |
| 3609 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3610 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3611 | "$P_SRV" \ |
| 3612 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3613 | 0 \ |
| 3614 | -c "x509_verify_cert() returned" \ |
| 3615 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3616 | -c "! Certificate verification flags"\ |
| 3617 | -C "! mbedtls_ssl_handshake returned" \ |
| 3618 | -C "X509 - Certificate verification failed" \ |
| 3619 | -C "SSL - No CA Chain is set, but required to operate" |
| 3620 | |
| 3621 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3622 | "$P_SRV" \ |
| 3623 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3624 | 1 \ |
| 3625 | -c "x509_verify_cert() returned" \ |
| 3626 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3627 | -c "! Certificate verification flags"\ |
| 3628 | -c "! mbedtls_ssl_handshake returned" \ |
| 3629 | -c "SSL - No CA Chain is set, but required to operate" |
| 3630 | |
| 3631 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3632 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3633 | # the client informs the server about the supported curves - it does, though, in the |
| 3634 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3635 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3636 | # different means to have the server ignoring the client's supported curve list. |
| 3637 | |
| 3638 | requires_config_enabled MBEDTLS_ECP_C |
| 3639 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3640 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3641 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3642 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3643 | 1 \ |
| 3644 | -c "bad certificate (EC key curve)"\ |
| 3645 | -c "! Certificate verification flags"\ |
| 3646 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3647 | |
| 3648 | requires_config_enabled MBEDTLS_ECP_C |
| 3649 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3650 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3651 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3652 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3653 | 1 \ |
| 3654 | -c "bad certificate (EC key curve)"\ |
| 3655 | -c "! Certificate verification flags"\ |
| 3656 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3657 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3658 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3659 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3660 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3661 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3662 | 0 \ |
| 3663 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3664 | -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] | 3665 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3666 | -C "X509 - Certificate verification failed" |
| 3667 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3668 | run_test "Authentication: client SHA256, server required" \ |
| 3669 | "$P_SRV auth_mode=required" \ |
| 3670 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3671 | key_file=data_files/server6.key \ |
| 3672 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3673 | 0 \ |
| 3674 | -c "Supported Signature Algorithm found: 4," \ |
| 3675 | -c "Supported Signature Algorithm found: 5," |
| 3676 | |
| 3677 | run_test "Authentication: client SHA384, server required" \ |
| 3678 | "$P_SRV auth_mode=required" \ |
| 3679 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3680 | key_file=data_files/server6.key \ |
| 3681 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3682 | 0 \ |
| 3683 | -c "Supported Signature Algorithm found: 4," \ |
| 3684 | -c "Supported Signature Algorithm found: 5," |
| 3685 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3686 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3687 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3688 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3689 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3690 | key_file=data_files/server5.key" \ |
| 3691 | 1 \ |
| 3692 | -S "skip write certificate request" \ |
| 3693 | -C "skip parse certificate request" \ |
| 3694 | -c "got a certificate request" \ |
| 3695 | -c "got no certificate to send" \ |
| 3696 | -S "x509_verify_cert() returned" \ |
| 3697 | -s "client has no certificate" \ |
| 3698 | -s "! mbedtls_ssl_handshake returned" \ |
| 3699 | -c "! mbedtls_ssl_handshake returned" \ |
| 3700 | -s "No client certification received from the client, but required by the authentication mode" |
| 3701 | |
| 3702 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3703 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3704 | "$P_CLI debug_level=3 crt_file=none \ |
| 3705 | key_file=data_files/server5.key" \ |
| 3706 | 1 \ |
| 3707 | -S "skip write certificate request" \ |
| 3708 | -C "skip parse certificate request" \ |
| 3709 | -c "got a certificate request" \ |
| 3710 | -c "= write certificate$" \ |
| 3711 | -C "skip write certificate$" \ |
| 3712 | -S "x509_verify_cert() returned" \ |
| 3713 | -s "client has no certificate" \ |
| 3714 | -s "! mbedtls_ssl_handshake returned" \ |
| 3715 | -c "! mbedtls_ssl_handshake returned" \ |
| 3716 | -s "No client certification received from the client, but required by the authentication mode" |
| 3717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3718 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3719 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3720 | "$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] | 3721 | key_file=data_files/server5.key" \ |
| 3722 | 1 \ |
| 3723 | -S "skip write certificate request" \ |
| 3724 | -C "skip parse certificate request" \ |
| 3725 | -c "got a certificate request" \ |
| 3726 | -C "skip write certificate" \ |
| 3727 | -C "skip write certificate verify" \ |
| 3728 | -S "skip parse certificate verify" \ |
| 3729 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3730 | -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] | 3731 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3732 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3733 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3734 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3735 | # We don't check that the client receives the alert because it might |
| 3736 | # detect that its write end of the connection is closed and abort |
| 3737 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3738 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3739 | run_test "Authentication: client cert not trusted, server required" \ |
| 3740 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3741 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3742 | key_file=data_files/server5.key" \ |
| 3743 | 1 \ |
| 3744 | -S "skip write certificate request" \ |
| 3745 | -C "skip parse certificate request" \ |
| 3746 | -c "got a certificate request" \ |
| 3747 | -C "skip write certificate" \ |
| 3748 | -C "skip write certificate verify" \ |
| 3749 | -S "skip parse certificate verify" \ |
| 3750 | -s "x509_verify_cert() returned" \ |
| 3751 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3752 | -s "! mbedtls_ssl_handshake returned" \ |
| 3753 | -c "! mbedtls_ssl_handshake returned" \ |
| 3754 | -s "X509 - Certificate verification failed" |
| 3755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3756 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3757 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3758 | "$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] | 3759 | key_file=data_files/server5.key" \ |
| 3760 | 0 \ |
| 3761 | -S "skip write certificate request" \ |
| 3762 | -C "skip parse certificate request" \ |
| 3763 | -c "got a certificate request" \ |
| 3764 | -C "skip write certificate" \ |
| 3765 | -C "skip write certificate verify" \ |
| 3766 | -S "skip parse certificate verify" \ |
| 3767 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3768 | -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] | 3769 | -S "! mbedtls_ssl_handshake returned" \ |
| 3770 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3771 | -S "X509 - Certificate verification failed" |
| 3772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3773 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3774 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3775 | "$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] | 3776 | key_file=data_files/server5.key" \ |
| 3777 | 0 \ |
| 3778 | -s "skip write certificate request" \ |
| 3779 | -C "skip parse certificate request" \ |
| 3780 | -c "got no certificate request" \ |
| 3781 | -c "skip write certificate" \ |
| 3782 | -c "skip write certificate verify" \ |
| 3783 | -s "skip parse certificate verify" \ |
| 3784 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3785 | -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] | 3786 | -S "! mbedtls_ssl_handshake returned" \ |
| 3787 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3788 | -S "X509 - Certificate verification failed" |
| 3789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3790 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3791 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3792 | "$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] | 3793 | 0 \ |
| 3794 | -S "skip write certificate request" \ |
| 3795 | -C "skip parse certificate request" \ |
| 3796 | -c "got a certificate request" \ |
| 3797 | -C "skip write certificate$" \ |
| 3798 | -C "got no certificate to send" \ |
| 3799 | -S "SSLv3 client has no certificate" \ |
| 3800 | -c "skip write certificate verify" \ |
| 3801 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3802 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3803 | -S "! mbedtls_ssl_handshake returned" \ |
| 3804 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3805 | -S "X509 - Certificate verification failed" |
| 3806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3807 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3808 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3809 | "$O_CLI" \ |
| 3810 | 0 \ |
| 3811 | -S "skip write certificate request" \ |
| 3812 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3813 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3814 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3815 | -S "X509 - Certificate verification failed" |
| 3816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3817 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3818 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3819 | "$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] | 3820 | 0 \ |
| 3821 | -C "skip parse certificate request" \ |
| 3822 | -c "got a certificate request" \ |
| 3823 | -C "skip write certificate$" \ |
| 3824 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3825 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3826 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3827 | run_test "Authentication: client no cert, openssl server required" \ |
| 3828 | "$O_SRV -Verify 10" \ |
| 3829 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3830 | 1 \ |
| 3831 | -C "skip parse certificate request" \ |
| 3832 | -c "got a certificate request" \ |
| 3833 | -C "skip write certificate$" \ |
| 3834 | -c "skip write certificate verify" \ |
| 3835 | -c "! mbedtls_ssl_handshake returned" |
| 3836 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3837 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3838 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3839 | "$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] | 3840 | "$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] | 3841 | 0 \ |
| 3842 | -S "skip write certificate request" \ |
| 3843 | -C "skip parse certificate request" \ |
| 3844 | -c "got a certificate request" \ |
| 3845 | -C "skip write certificate$" \ |
| 3846 | -c "skip write certificate verify" \ |
| 3847 | -c "got no certificate to send" \ |
| 3848 | -s "SSLv3 client has no certificate" \ |
| 3849 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3850 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3851 | -S "! mbedtls_ssl_handshake returned" \ |
| 3852 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3853 | -S "X509 - Certificate verification failed" |
| 3854 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3855 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3856 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3857 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3858 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 3859 | 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] | 3860 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3861 | 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] | 3862 | 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] | 3863 | 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] | 3864 | printf "test value of ${MAX_IM_CA}. \n" |
| 3865 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3866 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3867 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3868 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3869 | |
| 3870 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3871 | fi |
| 3872 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3873 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3874 | run_test "Authentication: server max_int chain, client default" \ |
| 3875 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3876 | key_file=data_files/dir-maxpath/09.key" \ |
| 3877 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3878 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3879 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3880 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3881 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3882 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3883 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3884 | key_file=data_files/dir-maxpath/10.key" \ |
| 3885 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3886 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3887 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3888 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3889 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3890 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3891 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3892 | key_file=data_files/dir-maxpath/10.key" \ |
| 3893 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3894 | auth_mode=optional" \ |
| 3895 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3896 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3897 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3898 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3899 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3900 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3901 | key_file=data_files/dir-maxpath/10.key" \ |
| 3902 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3903 | auth_mode=none" \ |
| 3904 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3905 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3906 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3907 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3908 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3909 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3910 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3911 | key_file=data_files/dir-maxpath/10.key" \ |
| 3912 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3913 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3914 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3915 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3916 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3917 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3918 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3919 | key_file=data_files/dir-maxpath/10.key" \ |
| 3920 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3921 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3922 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3923 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3924 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3925 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3926 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3927 | key_file=data_files/dir-maxpath/10.key" \ |
| 3928 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3929 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3930 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3931 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3932 | run_test "Authentication: client max_int chain, server required" \ |
| 3933 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3934 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3935 | key_file=data_files/dir-maxpath/09.key" \ |
| 3936 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3937 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3938 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3939 | # Tests for CA list in CertificateRequest messages |
| 3940 | |
| 3941 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3942 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3943 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3944 | key_file=data_files/server6.key" \ |
| 3945 | 0 \ |
| 3946 | -s "requested DN" |
| 3947 | |
| 3948 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3949 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3950 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3951 | key_file=data_files/server6.key" \ |
| 3952 | 0 \ |
| 3953 | -S "requested DN" |
| 3954 | |
| 3955 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3956 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3957 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3958 | key_file=data_files/server5.key" \ |
| 3959 | 1 \ |
| 3960 | -S "requested DN" \ |
| 3961 | -s "x509_verify_cert() returned" \ |
| 3962 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3963 | -s "! mbedtls_ssl_handshake returned" \ |
| 3964 | -c "! mbedtls_ssl_handshake returned" \ |
| 3965 | -s "X509 - Certificate verification failed" |
| 3966 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3967 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3968 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3969 | |
| 3970 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3971 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3972 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3973 | key_file=data_files/server5.key" \ |
| 3974 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3975 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3976 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3977 | -c "x509_verify_cert() returned" \ |
| 3978 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3979 | -c "! mbedtls_ssl_handshake returned" \ |
| 3980 | -c "X509 - Certificate verification failed" |
| 3981 | |
| 3982 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3983 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3984 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3985 | key_file=data_files/server5.key" \ |
| 3986 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3987 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3988 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3989 | -c "x509_verify_cert() returned" \ |
| 3990 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3991 | -C "! mbedtls_ssl_handshake returned" \ |
| 3992 | -C "X509 - Certificate verification failed" |
| 3993 | |
| 3994 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3995 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3996 | # the client informs the server about the supported curves - it does, though, in the |
| 3997 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3998 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3999 | # different means to have the server ignoring the client's supported curve list. |
| 4000 | |
| 4001 | requires_config_enabled MBEDTLS_ECP_C |
| 4002 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4003 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4004 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4005 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4006 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4007 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4008 | -c "use CA callback for X.509 CRT verification" \ |
| 4009 | -c "bad certificate (EC key curve)" \ |
| 4010 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4011 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4012 | |
| 4013 | requires_config_enabled MBEDTLS_ECP_C |
| 4014 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4015 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4016 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4017 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4018 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4019 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4020 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4021 | -c "bad certificate (EC key curve)"\ |
| 4022 | -c "! Certificate verification flags"\ |
| 4023 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4024 | |
| 4025 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4026 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4027 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4028 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4029 | key_file=data_files/server6.key \ |
| 4030 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4031 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4032 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4033 | -c "Supported Signature Algorithm found: 4," \ |
| 4034 | -c "Supported Signature Algorithm found: 5," |
| 4035 | |
| 4036 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4037 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4038 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4039 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4040 | key_file=data_files/server6.key \ |
| 4041 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4042 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4043 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4044 | -c "Supported Signature Algorithm found: 4," \ |
| 4045 | -c "Supported Signature Algorithm found: 5," |
| 4046 | |
| 4047 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4048 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4049 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4050 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4051 | key_file=data_files/server5.key" \ |
| 4052 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4053 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4054 | -S "skip write certificate request" \ |
| 4055 | -C "skip parse certificate request" \ |
| 4056 | -c "got a certificate request" \ |
| 4057 | -C "skip write certificate" \ |
| 4058 | -C "skip write certificate verify" \ |
| 4059 | -S "skip parse certificate verify" \ |
| 4060 | -s "x509_verify_cert() returned" \ |
| 4061 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4062 | -s "! mbedtls_ssl_handshake returned" \ |
| 4063 | -s "send alert level=2 message=48" \ |
| 4064 | -c "! mbedtls_ssl_handshake returned" \ |
| 4065 | -s "X509 - Certificate verification failed" |
| 4066 | # We don't check that the client receives the alert because it might |
| 4067 | # detect that its write end of the connection is closed and abort |
| 4068 | # before reading the alert message. |
| 4069 | |
| 4070 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4071 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4072 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4073 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4074 | key_file=data_files/server5.key" \ |
| 4075 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4076 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4077 | -S "skip write certificate request" \ |
| 4078 | -C "skip parse certificate request" \ |
| 4079 | -c "got a certificate request" \ |
| 4080 | -C "skip write certificate" \ |
| 4081 | -C "skip write certificate verify" \ |
| 4082 | -S "skip parse certificate verify" \ |
| 4083 | -s "x509_verify_cert() returned" \ |
| 4084 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4085 | -s "! mbedtls_ssl_handshake returned" \ |
| 4086 | -c "! mbedtls_ssl_handshake returned" \ |
| 4087 | -s "X509 - Certificate verification failed" |
| 4088 | |
| 4089 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4090 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4091 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4092 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4093 | key_file=data_files/server5.key" \ |
| 4094 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4095 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4096 | -S "skip write certificate request" \ |
| 4097 | -C "skip parse certificate request" \ |
| 4098 | -c "got a certificate request" \ |
| 4099 | -C "skip write certificate" \ |
| 4100 | -C "skip write certificate verify" \ |
| 4101 | -S "skip parse certificate verify" \ |
| 4102 | -s "x509_verify_cert() returned" \ |
| 4103 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4104 | -S "! mbedtls_ssl_handshake returned" \ |
| 4105 | -C "! mbedtls_ssl_handshake returned" \ |
| 4106 | -S "X509 - Certificate verification failed" |
| 4107 | |
| 4108 | requires_full_size_output_buffer |
| 4109 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4110 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4111 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4112 | key_file=data_files/dir-maxpath/09.key" \ |
| 4113 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4114 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4115 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4116 | -C "X509 - A fatal error occurred" |
| 4117 | |
| 4118 | requires_full_size_output_buffer |
| 4119 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4120 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4121 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4122 | key_file=data_files/dir-maxpath/10.key" \ |
| 4123 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4124 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4125 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4126 | -c "X509 - A fatal error occurred" |
| 4127 | |
| 4128 | requires_full_size_output_buffer |
| 4129 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4130 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4131 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4132 | key_file=data_files/dir-maxpath/10.key" \ |
| 4133 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4134 | debug_level=3 auth_mode=optional" \ |
| 4135 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4136 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4137 | -c "X509 - A fatal error occurred" |
| 4138 | |
| 4139 | requires_full_size_output_buffer |
| 4140 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4141 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4142 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4143 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4144 | key_file=data_files/dir-maxpath/10.key" \ |
| 4145 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4146 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4147 | -s "X509 - A fatal error occurred" |
| 4148 | |
| 4149 | requires_full_size_output_buffer |
| 4150 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4151 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4152 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4153 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4154 | key_file=data_files/dir-maxpath/10.key" \ |
| 4155 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4156 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4157 | -s "X509 - A fatal error occurred" |
| 4158 | |
| 4159 | requires_full_size_output_buffer |
| 4160 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4161 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4162 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4163 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4164 | key_file=data_files/dir-maxpath/09.key" \ |
| 4165 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4166 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4167 | -S "X509 - A fatal error occurred" |
| 4168 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4169 | # Tests for certificate selection based on SHA verson |
| 4170 | |
| 4171 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4172 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4173 | key_file=data_files/server5.key \ |
| 4174 | crt_file2=data_files/server5-sha1.crt \ |
| 4175 | key_file2=data_files/server5.key" \ |
| 4176 | "$P_CLI force_version=tls1_2" \ |
| 4177 | 0 \ |
| 4178 | -c "signed using.*ECDSA with SHA256" \ |
| 4179 | -C "signed using.*ECDSA with SHA1" |
| 4180 | |
| 4181 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4182 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4183 | key_file=data_files/server5.key \ |
| 4184 | crt_file2=data_files/server5-sha1.crt \ |
| 4185 | key_file2=data_files/server5.key" \ |
| 4186 | "$P_CLI force_version=tls1_1" \ |
| 4187 | 0 \ |
| 4188 | -C "signed using.*ECDSA with SHA256" \ |
| 4189 | -c "signed using.*ECDSA with SHA1" |
| 4190 | |
| 4191 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4192 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4193 | key_file=data_files/server5.key \ |
| 4194 | crt_file2=data_files/server5-sha1.crt \ |
| 4195 | key_file2=data_files/server5.key" \ |
| 4196 | "$P_CLI force_version=tls1" \ |
| 4197 | 0 \ |
| 4198 | -C "signed using.*ECDSA with SHA256" \ |
| 4199 | -c "signed using.*ECDSA with SHA1" |
| 4200 | |
| 4201 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4202 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4203 | key_file=data_files/server5.key \ |
| 4204 | crt_file2=data_files/server6.crt \ |
| 4205 | key_file2=data_files/server6.key" \ |
| 4206 | "$P_CLI force_version=tls1_1" \ |
| 4207 | 0 \ |
| 4208 | -c "serial number.*09" \ |
| 4209 | -c "signed using.*ECDSA with SHA256" \ |
| 4210 | -C "signed using.*ECDSA with SHA1" |
| 4211 | |
| 4212 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4213 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4214 | key_file=data_files/server6.key \ |
| 4215 | crt_file2=data_files/server5.crt \ |
| 4216 | key_file2=data_files/server5.key" \ |
| 4217 | "$P_CLI force_version=tls1_1" \ |
| 4218 | 0 \ |
| 4219 | -c "serial number.*0A" \ |
| 4220 | -c "signed using.*ECDSA with SHA256" \ |
| 4221 | -C "signed using.*ECDSA with SHA1" |
| 4222 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4223 | # tests for SNI |
| 4224 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4225 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4226 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4227 | 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] | 4228 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4229 | 0 \ |
| 4230 | -S "parse ServerName extension" \ |
| 4231 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4232 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4234 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4235 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4236 | 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] | 4237 | 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] | 4238 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4239 | 0 \ |
| 4240 | -s "parse ServerName extension" \ |
| 4241 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4242 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4243 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4244 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4245 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4246 | 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] | 4247 | 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] | 4248 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4249 | 0 \ |
| 4250 | -s "parse ServerName extension" \ |
| 4251 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4252 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4254 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4255 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4256 | 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] | 4257 | 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] | 4258 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4259 | 1 \ |
| 4260 | -s "parse ServerName extension" \ |
| 4261 | -s "ssl_sni_wrapper() returned" \ |
| 4262 | -s "mbedtls_ssl_handshake returned" \ |
| 4263 | -c "mbedtls_ssl_handshake returned" \ |
| 4264 | -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] | 4265 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4266 | run_test "SNI: client auth no override: optional" \ |
| 4267 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4268 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4269 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4270 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4271 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4272 | -S "skip write certificate request" \ |
| 4273 | -C "skip parse certificate request" \ |
| 4274 | -c "got a certificate request" \ |
| 4275 | -C "skip write certificate" \ |
| 4276 | -C "skip write certificate verify" \ |
| 4277 | -S "skip parse certificate verify" |
| 4278 | |
| 4279 | run_test "SNI: client auth override: none -> optional" \ |
| 4280 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4281 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4282 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4283 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4284 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4285 | -S "skip write certificate request" \ |
| 4286 | -C "skip parse certificate request" \ |
| 4287 | -c "got a certificate request" \ |
| 4288 | -C "skip write certificate" \ |
| 4289 | -C "skip write certificate verify" \ |
| 4290 | -S "skip parse certificate verify" |
| 4291 | |
| 4292 | run_test "SNI: client auth override: optional -> none" \ |
| 4293 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4294 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4295 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4296 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4297 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4298 | -s "skip write certificate request" \ |
| 4299 | -C "skip parse certificate request" \ |
| 4300 | -c "got no certificate request" \ |
| 4301 | -c "skip write certificate" \ |
| 4302 | -c "skip write certificate verify" \ |
| 4303 | -s "skip parse certificate verify" |
| 4304 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4305 | run_test "SNI: CA no override" \ |
| 4306 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4307 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4308 | ca_file=data_files/test-ca.crt \ |
| 4309 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4310 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4311 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4312 | 1 \ |
| 4313 | -S "skip write certificate request" \ |
| 4314 | -C "skip parse certificate request" \ |
| 4315 | -c "got a certificate request" \ |
| 4316 | -C "skip write certificate" \ |
| 4317 | -C "skip write certificate verify" \ |
| 4318 | -S "skip parse certificate verify" \ |
| 4319 | -s "x509_verify_cert() returned" \ |
| 4320 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4321 | -S "The certificate has been revoked (is on a CRL)" |
| 4322 | |
| 4323 | run_test "SNI: CA override" \ |
| 4324 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4325 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4326 | ca_file=data_files/test-ca.crt \ |
| 4327 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4328 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4329 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4330 | 0 \ |
| 4331 | -S "skip write certificate request" \ |
| 4332 | -C "skip parse certificate request" \ |
| 4333 | -c "got a certificate request" \ |
| 4334 | -C "skip write certificate" \ |
| 4335 | -C "skip write certificate verify" \ |
| 4336 | -S "skip parse certificate verify" \ |
| 4337 | -S "x509_verify_cert() returned" \ |
| 4338 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4339 | -S "The certificate has been revoked (is on a CRL)" |
| 4340 | |
| 4341 | run_test "SNI: CA override with CRL" \ |
| 4342 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4343 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4344 | ca_file=data_files/test-ca.crt \ |
| 4345 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4346 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4347 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4348 | 1 \ |
| 4349 | -S "skip write certificate request" \ |
| 4350 | -C "skip parse certificate request" \ |
| 4351 | -c "got a certificate request" \ |
| 4352 | -C "skip write certificate" \ |
| 4353 | -C "skip write certificate verify" \ |
| 4354 | -S "skip parse certificate verify" \ |
| 4355 | -s "x509_verify_cert() returned" \ |
| 4356 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4357 | -s "The certificate has been revoked (is on a CRL)" |
| 4358 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4359 | # Tests for SNI and DTLS |
| 4360 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4361 | run_test "SNI: DTLS, no SNI callback" \ |
| 4362 | "$P_SRV debug_level=3 dtls=1 \ |
| 4363 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4364 | "$P_CLI server_name=localhost dtls=1" \ |
| 4365 | 0 \ |
| 4366 | -S "parse ServerName extension" \ |
| 4367 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4368 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4369 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4370 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4371 | "$P_SRV debug_level=3 dtls=1 \ |
| 4372 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4373 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4374 | "$P_CLI server_name=localhost dtls=1" \ |
| 4375 | 0 \ |
| 4376 | -s "parse ServerName extension" \ |
| 4377 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4378 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4379 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4380 | run_test "SNI: DTLS, matching cert 2" \ |
| 4381 | "$P_SRV debug_level=3 dtls=1 \ |
| 4382 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4383 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4384 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4385 | 0 \ |
| 4386 | -s "parse ServerName extension" \ |
| 4387 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4388 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4389 | |
| 4390 | run_test "SNI: DTLS, no matching cert" \ |
| 4391 | "$P_SRV debug_level=3 dtls=1 \ |
| 4392 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4393 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4394 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4395 | 1 \ |
| 4396 | -s "parse ServerName extension" \ |
| 4397 | -s "ssl_sni_wrapper() returned" \ |
| 4398 | -s "mbedtls_ssl_handshake returned" \ |
| 4399 | -c "mbedtls_ssl_handshake returned" \ |
| 4400 | -c "SSL - A fatal alert message was received from our peer" |
| 4401 | |
| 4402 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4403 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4404 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4405 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4406 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4407 | 0 \ |
| 4408 | -S "skip write certificate request" \ |
| 4409 | -C "skip parse certificate request" \ |
| 4410 | -c "got a certificate request" \ |
| 4411 | -C "skip write certificate" \ |
| 4412 | -C "skip write certificate verify" \ |
| 4413 | -S "skip parse certificate verify" |
| 4414 | |
| 4415 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4416 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4417 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4418 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4419 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4420 | 0 \ |
| 4421 | -S "skip write certificate request" \ |
| 4422 | -C "skip parse certificate request" \ |
| 4423 | -c "got a certificate request" \ |
| 4424 | -C "skip write certificate" \ |
| 4425 | -C "skip write certificate verify" \ |
| 4426 | -S "skip parse certificate verify" |
| 4427 | |
| 4428 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4429 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4430 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4431 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4432 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4433 | 0 \ |
| 4434 | -s "skip write certificate request" \ |
| 4435 | -C "skip parse certificate request" \ |
| 4436 | -c "got no certificate request" \ |
| 4437 | -c "skip write certificate" \ |
| 4438 | -c "skip write certificate verify" \ |
| 4439 | -s "skip parse certificate verify" |
| 4440 | |
| 4441 | run_test "SNI: DTLS, CA no override" \ |
| 4442 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4443 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4444 | ca_file=data_files/test-ca.crt \ |
| 4445 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4446 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4447 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4448 | 1 \ |
| 4449 | -S "skip write certificate request" \ |
| 4450 | -C "skip parse certificate request" \ |
| 4451 | -c "got a certificate request" \ |
| 4452 | -C "skip write certificate" \ |
| 4453 | -C "skip write certificate verify" \ |
| 4454 | -S "skip parse certificate verify" \ |
| 4455 | -s "x509_verify_cert() returned" \ |
| 4456 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4457 | -S "The certificate has been revoked (is on a CRL)" |
| 4458 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4459 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4460 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4461 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4462 | ca_file=data_files/test-ca.crt \ |
| 4463 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4464 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4465 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4466 | 0 \ |
| 4467 | -S "skip write certificate request" \ |
| 4468 | -C "skip parse certificate request" \ |
| 4469 | -c "got a certificate request" \ |
| 4470 | -C "skip write certificate" \ |
| 4471 | -C "skip write certificate verify" \ |
| 4472 | -S "skip parse certificate verify" \ |
| 4473 | -S "x509_verify_cert() returned" \ |
| 4474 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4475 | -S "The certificate has been revoked (is on a CRL)" |
| 4476 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4477 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4478 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4479 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4480 | ca_file=data_files/test-ca.crt \ |
| 4481 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4482 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4483 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4484 | 1 \ |
| 4485 | -S "skip write certificate request" \ |
| 4486 | -C "skip parse certificate request" \ |
| 4487 | -c "got a certificate request" \ |
| 4488 | -C "skip write certificate" \ |
| 4489 | -C "skip write certificate verify" \ |
| 4490 | -S "skip parse certificate verify" \ |
| 4491 | -s "x509_verify_cert() returned" \ |
| 4492 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4493 | -s "The certificate has been revoked (is on a CRL)" |
| 4494 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4495 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4496 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4497 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4498 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4499 | "$P_CLI nbio=2 tickets=0" \ |
| 4500 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4501 | -S "mbedtls_ssl_handshake returned" \ |
| 4502 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4503 | -c "Read from server: .* bytes read" |
| 4504 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4505 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4506 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4507 | "$P_CLI nbio=2 tickets=0" \ |
| 4508 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4509 | -S "mbedtls_ssl_handshake returned" \ |
| 4510 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4511 | -c "Read from server: .* bytes read" |
| 4512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4513 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4514 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4515 | "$P_CLI nbio=2 tickets=1" \ |
| 4516 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4517 | -S "mbedtls_ssl_handshake returned" \ |
| 4518 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4519 | -c "Read from server: .* bytes read" |
| 4520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4521 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4522 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4523 | "$P_CLI nbio=2 tickets=1" \ |
| 4524 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4525 | -S "mbedtls_ssl_handshake returned" \ |
| 4526 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4527 | -c "Read from server: .* bytes read" |
| 4528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4529 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4530 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4531 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4532 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4533 | -S "mbedtls_ssl_handshake returned" \ |
| 4534 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4535 | -c "Read from server: .* bytes read" |
| 4536 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4537 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4538 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4539 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4540 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4541 | -S "mbedtls_ssl_handshake returned" \ |
| 4542 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4543 | -c "Read from server: .* bytes read" |
| 4544 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4545 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4546 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4547 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4548 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4549 | -S "mbedtls_ssl_handshake returned" \ |
| 4550 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4551 | -c "Read from server: .* bytes read" |
| 4552 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4553 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4554 | |
| 4555 | run_test "Event-driven I/O: basic handshake" \ |
| 4556 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4557 | "$P_CLI event=1 tickets=0" \ |
| 4558 | 0 \ |
| 4559 | -S "mbedtls_ssl_handshake returned" \ |
| 4560 | -C "mbedtls_ssl_handshake returned" \ |
| 4561 | -c "Read from server: .* bytes read" |
| 4562 | |
| 4563 | run_test "Event-driven I/O: client auth" \ |
| 4564 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4565 | "$P_CLI event=1 tickets=0" \ |
| 4566 | 0 \ |
| 4567 | -S "mbedtls_ssl_handshake returned" \ |
| 4568 | -C "mbedtls_ssl_handshake returned" \ |
| 4569 | -c "Read from server: .* bytes read" |
| 4570 | |
| 4571 | run_test "Event-driven I/O: ticket" \ |
| 4572 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4573 | "$P_CLI event=1 tickets=1" \ |
| 4574 | 0 \ |
| 4575 | -S "mbedtls_ssl_handshake returned" \ |
| 4576 | -C "mbedtls_ssl_handshake returned" \ |
| 4577 | -c "Read from server: .* bytes read" |
| 4578 | |
| 4579 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4580 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4581 | "$P_CLI event=1 tickets=1" \ |
| 4582 | 0 \ |
| 4583 | -S "mbedtls_ssl_handshake returned" \ |
| 4584 | -C "mbedtls_ssl_handshake returned" \ |
| 4585 | -c "Read from server: .* bytes read" |
| 4586 | |
| 4587 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4588 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4589 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4590 | 0 \ |
| 4591 | -S "mbedtls_ssl_handshake returned" \ |
| 4592 | -C "mbedtls_ssl_handshake returned" \ |
| 4593 | -c "Read from server: .* bytes read" |
| 4594 | |
| 4595 | run_test "Event-driven I/O: ticket + resume" \ |
| 4596 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4597 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4598 | 0 \ |
| 4599 | -S "mbedtls_ssl_handshake returned" \ |
| 4600 | -C "mbedtls_ssl_handshake returned" \ |
| 4601 | -c "Read from server: .* bytes read" |
| 4602 | |
| 4603 | run_test "Event-driven I/O: session-id resume" \ |
| 4604 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4605 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4606 | 0 \ |
| 4607 | -S "mbedtls_ssl_handshake returned" \ |
| 4608 | -C "mbedtls_ssl_handshake returned" \ |
| 4609 | -c "Read from server: .* bytes read" |
| 4610 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4611 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4612 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4613 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4614 | 0 \ |
| 4615 | -c "Read from server: .* bytes read" |
| 4616 | |
| 4617 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4618 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4619 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4620 | 0 \ |
| 4621 | -c "Read from server: .* bytes read" |
| 4622 | |
| 4623 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4624 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4625 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4626 | 0 \ |
| 4627 | -c "Read from server: .* bytes read" |
| 4628 | |
| 4629 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4630 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4631 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4632 | 0 \ |
| 4633 | -c "Read from server: .* bytes read" |
| 4634 | |
| 4635 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4636 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4637 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4638 | 0 \ |
| 4639 | -c "Read from server: .* bytes read" |
| 4640 | |
| 4641 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4642 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4643 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4644 | 0 \ |
| 4645 | -c "Read from server: .* bytes read" |
| 4646 | |
| 4647 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4648 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4649 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4650 | 0 \ |
| 4651 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4652 | |
| 4653 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4654 | # During session resumption, the client will send its ApplicationData record |
| 4655 | # within the same datagram as the Finished messages. In this situation, the |
| 4656 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4657 | # because the ApplicationData request has already been queued internally. |
| 4658 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4659 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4660 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4661 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4662 | 0 \ |
| 4663 | -c "Read from server: .* bytes read" |
| 4664 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4665 | # Tests for version negotiation |
| 4666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4667 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4668 | "$P_SRV" \ |
| 4669 | "$P_CLI" \ |
| 4670 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4671 | -S "mbedtls_ssl_handshake returned" \ |
| 4672 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4673 | -s "Protocol is TLSv1.2" \ |
| 4674 | -c "Protocol is TLSv1.2" |
| 4675 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4676 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4677 | "$P_SRV" \ |
| 4678 | "$P_CLI max_version=tls1_1" \ |
| 4679 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4680 | -S "mbedtls_ssl_handshake returned" \ |
| 4681 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4682 | -s "Protocol is TLSv1.1" \ |
| 4683 | -c "Protocol is TLSv1.1" |
| 4684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4685 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4686 | "$P_SRV max_version=tls1_1" \ |
| 4687 | "$P_CLI" \ |
| 4688 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4689 | -S "mbedtls_ssl_handshake returned" \ |
| 4690 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4691 | -s "Protocol is TLSv1.1" \ |
| 4692 | -c "Protocol is TLSv1.1" |
| 4693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4694 | 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] | 4695 | "$P_SRV max_version=tls1_1" \ |
| 4696 | "$P_CLI max_version=tls1_1" \ |
| 4697 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4698 | -S "mbedtls_ssl_handshake returned" \ |
| 4699 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4700 | -s "Protocol is TLSv1.1" \ |
| 4701 | -c "Protocol is TLSv1.1" |
| 4702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4703 | 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] | 4704 | "$P_SRV min_version=tls1_1" \ |
| 4705 | "$P_CLI max_version=tls1_1" \ |
| 4706 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4707 | -S "mbedtls_ssl_handshake returned" \ |
| 4708 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4709 | -s "Protocol is TLSv1.1" \ |
| 4710 | -c "Protocol is TLSv1.1" |
| 4711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4712 | 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] | 4713 | "$P_SRV max_version=tls1_1" \ |
| 4714 | "$P_CLI min_version=tls1_1" \ |
| 4715 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4716 | -S "mbedtls_ssl_handshake returned" \ |
| 4717 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4718 | -s "Protocol is TLSv1.1" \ |
| 4719 | -c "Protocol is TLSv1.1" |
| 4720 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4721 | 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] | 4722 | "$P_SRV max_version=tls1_1" \ |
| 4723 | "$P_CLI min_version=tls1_2" \ |
| 4724 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4725 | -s "mbedtls_ssl_handshake returned" \ |
| 4726 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4727 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4729 | 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] | 4730 | "$P_SRV min_version=tls1_2" \ |
| 4731 | "$P_CLI max_version=tls1_1" \ |
| 4732 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4733 | -s "mbedtls_ssl_handshake returned" \ |
| 4734 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4735 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4736 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4737 | # Tests for ALPN extension |
| 4738 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4739 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4740 | "$P_SRV debug_level=3" \ |
| 4741 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4742 | 0 \ |
| 4743 | -C "client hello, adding alpn extension" \ |
| 4744 | -S "found alpn extension" \ |
| 4745 | -C "got an alert message, type: \\[2:120]" \ |
| 4746 | -S "server hello, adding alpn extension" \ |
| 4747 | -C "found alpn extension " \ |
| 4748 | -C "Application Layer Protocol is" \ |
| 4749 | -S "Application Layer Protocol is" |
| 4750 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4751 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4752 | "$P_SRV debug_level=3" \ |
| 4753 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4754 | 0 \ |
| 4755 | -c "client hello, adding alpn extension" \ |
| 4756 | -s "found alpn extension" \ |
| 4757 | -C "got an alert message, type: \\[2:120]" \ |
| 4758 | -S "server hello, adding alpn extension" \ |
| 4759 | -C "found alpn extension " \ |
| 4760 | -c "Application Layer Protocol is (none)" \ |
| 4761 | -S "Application Layer Protocol is" |
| 4762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4763 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4764 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4765 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4766 | 0 \ |
| 4767 | -C "client hello, adding alpn extension" \ |
| 4768 | -S "found alpn extension" \ |
| 4769 | -C "got an alert message, type: \\[2:120]" \ |
| 4770 | -S "server hello, adding alpn extension" \ |
| 4771 | -C "found alpn extension " \ |
| 4772 | -C "Application Layer Protocol is" \ |
| 4773 | -s "Application Layer Protocol is (none)" |
| 4774 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4775 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4776 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4777 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4778 | 0 \ |
| 4779 | -c "client hello, adding alpn extension" \ |
| 4780 | -s "found alpn extension" \ |
| 4781 | -C "got an alert message, type: \\[2:120]" \ |
| 4782 | -s "server hello, adding alpn extension" \ |
| 4783 | -c "found alpn extension" \ |
| 4784 | -c "Application Layer Protocol is abc" \ |
| 4785 | -s "Application Layer Protocol is abc" |
| 4786 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4787 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4788 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4789 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4790 | 0 \ |
| 4791 | -c "client hello, adding alpn extension" \ |
| 4792 | -s "found alpn extension" \ |
| 4793 | -C "got an alert message, type: \\[2:120]" \ |
| 4794 | -s "server hello, adding alpn extension" \ |
| 4795 | -c "found alpn extension" \ |
| 4796 | -c "Application Layer Protocol is abc" \ |
| 4797 | -s "Application Layer Protocol is abc" |
| 4798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4799 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4800 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4801 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4802 | 0 \ |
| 4803 | -c "client hello, adding alpn extension" \ |
| 4804 | -s "found alpn extension" \ |
| 4805 | -C "got an alert message, type: \\[2:120]" \ |
| 4806 | -s "server hello, adding alpn extension" \ |
| 4807 | -c "found alpn extension" \ |
| 4808 | -c "Application Layer Protocol is 1234" \ |
| 4809 | -s "Application Layer Protocol is 1234" |
| 4810 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4811 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4812 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4813 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4814 | 1 \ |
| 4815 | -c "client hello, adding alpn extension" \ |
| 4816 | -s "found alpn extension" \ |
| 4817 | -c "got an alert message, type: \\[2:120]" \ |
| 4818 | -S "server hello, adding alpn extension" \ |
| 4819 | -C "found alpn extension" \ |
| 4820 | -C "Application Layer Protocol is 1234" \ |
| 4821 | -S "Application Layer Protocol is 1234" |
| 4822 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4823 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4824 | # Tests for keyUsage in leaf certificates, part 1: |
| 4825 | # server-side certificate/suite selection |
| 4826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4827 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4828 | "$P_SRV key_file=data_files/server2.key \ |
| 4829 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4830 | "$P_CLI" \ |
| 4831 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4832 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4833 | |
| 4834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4835 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4836 | "$P_SRV key_file=data_files/server2.key \ |
| 4837 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4838 | "$P_CLI" \ |
| 4839 | 0 \ |
| 4840 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4842 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4843 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4844 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4845 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4846 | 1 \ |
| 4847 | -C "Ciphersuite is " |
| 4848 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4849 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4850 | "$P_SRV key_file=data_files/server5.key \ |
| 4851 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4852 | "$P_CLI" \ |
| 4853 | 0 \ |
| 4854 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4855 | |
| 4856 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4857 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4858 | "$P_SRV key_file=data_files/server5.key \ |
| 4859 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4860 | "$P_CLI" \ |
| 4861 | 0 \ |
| 4862 | -c "Ciphersuite is TLS-ECDH-" |
| 4863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4864 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4865 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4866 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4867 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4868 | 1 \ |
| 4869 | -C "Ciphersuite is " |
| 4870 | |
| 4871 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4872 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4873 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4874 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4875 | "$O_SRV -key data_files/server2.key \ |
| 4876 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4877 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4878 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4879 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4880 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4881 | -C "Processing of the Certificate handshake message failed" \ |
| 4882 | -c "Ciphersuite is TLS-" |
| 4883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4884 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4885 | "$O_SRV -key data_files/server2.key \ |
| 4886 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4887 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4888 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4889 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4890 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4891 | -C "Processing of the Certificate handshake message failed" \ |
| 4892 | -c "Ciphersuite is TLS-" |
| 4893 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4894 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4895 | "$O_SRV -key data_files/server2.key \ |
| 4896 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4897 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4898 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4899 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4900 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4901 | -C "Processing of the Certificate handshake message failed" \ |
| 4902 | -c "Ciphersuite is TLS-" |
| 4903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4904 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4905 | "$O_SRV -key data_files/server2.key \ |
| 4906 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4907 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4908 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4909 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4910 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4911 | -c "Processing of the Certificate handshake message failed" \ |
| 4912 | -C "Ciphersuite is TLS-" |
| 4913 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4914 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4915 | "$O_SRV -key data_files/server2.key \ |
| 4916 | -cert data_files/server2.ku-ke.crt" \ |
| 4917 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4918 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4919 | 0 \ |
| 4920 | -c "bad certificate (usage extensions)" \ |
| 4921 | -C "Processing of the Certificate handshake message failed" \ |
| 4922 | -c "Ciphersuite is TLS-" \ |
| 4923 | -c "! Usage does not match the keyUsage extension" |
| 4924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4925 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4926 | "$O_SRV -key data_files/server2.key \ |
| 4927 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4928 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4929 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4930 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4931 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4932 | -C "Processing of the Certificate handshake message failed" \ |
| 4933 | -c "Ciphersuite is TLS-" |
| 4934 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4935 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4936 | "$O_SRV -key data_files/server2.key \ |
| 4937 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4938 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4939 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4940 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4941 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4942 | -c "Processing of the Certificate handshake message failed" \ |
| 4943 | -C "Ciphersuite is TLS-" |
| 4944 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4945 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4946 | "$O_SRV -key data_files/server2.key \ |
| 4947 | -cert data_files/server2.ku-ds.crt" \ |
| 4948 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4949 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4950 | 0 \ |
| 4951 | -c "bad certificate (usage extensions)" \ |
| 4952 | -C "Processing of the Certificate handshake message failed" \ |
| 4953 | -c "Ciphersuite is TLS-" \ |
| 4954 | -c "! Usage does not match the keyUsage extension" |
| 4955 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4956 | # Tests for keyUsage in leaf certificates, part 3: |
| 4957 | # server-side checking of client cert |
| 4958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4959 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4960 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4961 | "$O_CLI -key data_files/server2.key \ |
| 4962 | -cert data_files/server2.ku-ds.crt" \ |
| 4963 | 0 \ |
| 4964 | -S "bad certificate (usage extensions)" \ |
| 4965 | -S "Processing of the Certificate handshake message failed" |
| 4966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4967 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4968 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4969 | "$O_CLI -key data_files/server2.key \ |
| 4970 | -cert data_files/server2.ku-ke.crt" \ |
| 4971 | 0 \ |
| 4972 | -s "bad certificate (usage extensions)" \ |
| 4973 | -S "Processing of the Certificate handshake message failed" |
| 4974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4975 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4976 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4977 | "$O_CLI -key data_files/server2.key \ |
| 4978 | -cert data_files/server2.ku-ke.crt" \ |
| 4979 | 1 \ |
| 4980 | -s "bad certificate (usage extensions)" \ |
| 4981 | -s "Processing of the Certificate handshake message failed" |
| 4982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4983 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4984 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4985 | "$O_CLI -key data_files/server5.key \ |
| 4986 | -cert data_files/server5.ku-ds.crt" \ |
| 4987 | 0 \ |
| 4988 | -S "bad certificate (usage extensions)" \ |
| 4989 | -S "Processing of the Certificate handshake message failed" |
| 4990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4992 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4993 | "$O_CLI -key data_files/server5.key \ |
| 4994 | -cert data_files/server5.ku-ka.crt" \ |
| 4995 | 0 \ |
| 4996 | -s "bad certificate (usage extensions)" \ |
| 4997 | -S "Processing of the Certificate handshake message failed" |
| 4998 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4999 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5001 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5002 | "$P_SRV key_file=data_files/server5.key \ |
| 5003 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5004 | "$P_CLI" \ |
| 5005 | 0 |
| 5006 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5007 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5008 | "$P_SRV key_file=data_files/server5.key \ |
| 5009 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5010 | "$P_CLI" \ |
| 5011 | 0 |
| 5012 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5013 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5014 | "$P_SRV key_file=data_files/server5.key \ |
| 5015 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5016 | "$P_CLI" \ |
| 5017 | 0 |
| 5018 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5019 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5020 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5021 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5022 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5023 | 1 |
| 5024 | |
| 5025 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5027 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5028 | "$O_SRV -key data_files/server5.key \ |
| 5029 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5030 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5031 | 0 \ |
| 5032 | -C "bad certificate (usage extensions)" \ |
| 5033 | -C "Processing of the Certificate handshake message failed" \ |
| 5034 | -c "Ciphersuite is TLS-" |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5037 | "$O_SRV -key data_files/server5.key \ |
| 5038 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5039 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5040 | 0 \ |
| 5041 | -C "bad certificate (usage extensions)" \ |
| 5042 | -C "Processing of the Certificate handshake message failed" \ |
| 5043 | -c "Ciphersuite is TLS-" |
| 5044 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5045 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5046 | "$O_SRV -key data_files/server5.key \ |
| 5047 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5048 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5049 | 0 \ |
| 5050 | -C "bad certificate (usage extensions)" \ |
| 5051 | -C "Processing of the Certificate handshake message failed" \ |
| 5052 | -c "Ciphersuite is TLS-" |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5055 | "$O_SRV -key data_files/server5.key \ |
| 5056 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5057 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5058 | 1 \ |
| 5059 | -c "bad certificate (usage extensions)" \ |
| 5060 | -c "Processing of the Certificate handshake message failed" \ |
| 5061 | -C "Ciphersuite is TLS-" |
| 5062 | |
| 5063 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5065 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5066 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5067 | "$O_CLI -key data_files/server5.key \ |
| 5068 | -cert data_files/server5.eku-cli.crt" \ |
| 5069 | 0 \ |
| 5070 | -S "bad certificate (usage extensions)" \ |
| 5071 | -S "Processing of the Certificate handshake message failed" |
| 5072 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5073 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5074 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5075 | "$O_CLI -key data_files/server5.key \ |
| 5076 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5077 | 0 \ |
| 5078 | -S "bad certificate (usage extensions)" \ |
| 5079 | -S "Processing of the Certificate handshake message failed" |
| 5080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5081 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5082 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5083 | "$O_CLI -key data_files/server5.key \ |
| 5084 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5085 | 0 \ |
| 5086 | -S "bad certificate (usage extensions)" \ |
| 5087 | -S "Processing of the Certificate handshake message failed" |
| 5088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5089 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5090 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5091 | "$O_CLI -key data_files/server5.key \ |
| 5092 | -cert data_files/server5.eku-cs.crt" \ |
| 5093 | 0 \ |
| 5094 | -s "bad certificate (usage extensions)" \ |
| 5095 | -S "Processing of the Certificate handshake message failed" |
| 5096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5097 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5098 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5099 | "$O_CLI -key data_files/server5.key \ |
| 5100 | -cert data_files/server5.eku-cs.crt" \ |
| 5101 | 1 \ |
| 5102 | -s "bad certificate (usage extensions)" \ |
| 5103 | -s "Processing of the Certificate handshake message failed" |
| 5104 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5105 | # Tests for DHM parameters loading |
| 5106 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5107 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5108 | "$P_SRV" \ |
| 5109 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5110 | debug_level=3" \ |
| 5111 | 0 \ |
| 5112 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5113 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5115 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5116 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5117 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5118 | debug_level=3" \ |
| 5119 | 0 \ |
| 5120 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5121 | -c "value of 'DHM: G ' (2 bits)" |
| 5122 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5123 | # Tests for DHM client-side size checking |
| 5124 | |
| 5125 | run_test "DHM size: server default, client default, OK" \ |
| 5126 | "$P_SRV" \ |
| 5127 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5128 | debug_level=1" \ |
| 5129 | 0 \ |
| 5130 | -C "DHM prime too short:" |
| 5131 | |
| 5132 | run_test "DHM size: server default, client 2048, OK" \ |
| 5133 | "$P_SRV" \ |
| 5134 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5135 | debug_level=1 dhmlen=2048" \ |
| 5136 | 0 \ |
| 5137 | -C "DHM prime too short:" |
| 5138 | |
| 5139 | run_test "DHM size: server 1024, client default, OK" \ |
| 5140 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5141 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5142 | debug_level=1" \ |
| 5143 | 0 \ |
| 5144 | -C "DHM prime too short:" |
| 5145 | |
| 5146 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5147 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5148 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5149 | debug_level=1" \ |
| 5150 | 1 \ |
| 5151 | -c "DHM prime too short:" |
| 5152 | |
| 5153 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5154 | "$P_SRV" \ |
| 5155 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5156 | debug_level=1 dhmlen=2049" \ |
| 5157 | 1 \ |
| 5158 | -c "DHM prime too short:" |
| 5159 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5160 | # Tests for PSK callback |
| 5161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5162 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5163 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5164 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5165 | psk_identity=foo psk=abc123" \ |
| 5166 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5167 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5168 | -S "SSL - Unknown identity received" \ |
| 5169 | -S "SSL - Verification of the message MAC failed" |
| 5170 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5171 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5172 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5173 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5174 | "$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] | 5175 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5176 | 0 \ |
| 5177 | -c "skip PMS generation for opaque PSK"\ |
| 5178 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5179 | -C "session hash for extended master secret"\ |
| 5180 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5181 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5182 | -S "SSL - Unknown identity received" \ |
| 5183 | -S "SSL - Verification of the message MAC failed" |
| 5184 | |
| 5185 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5186 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5187 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5188 | "$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] | 5189 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5190 | 0 \ |
| 5191 | -c "skip PMS generation for opaque PSK"\ |
| 5192 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5193 | -C "session hash for extended master secret"\ |
| 5194 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5195 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5196 | -S "SSL - Unknown identity received" \ |
| 5197 | -S "SSL - Verification of the message MAC failed" |
| 5198 | |
| 5199 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5200 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5201 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5202 | "$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] | 5203 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5204 | 0 \ |
| 5205 | -c "skip PMS generation for opaque PSK"\ |
| 5206 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5207 | -c "session hash for extended master secret"\ |
| 5208 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5209 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5210 | -S "SSL - Unknown identity received" \ |
| 5211 | -S "SSL - Verification of the message MAC failed" |
| 5212 | |
| 5213 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5214 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5215 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5216 | "$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] | 5217 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5218 | 0 \ |
| 5219 | -c "skip PMS generation for opaque PSK"\ |
| 5220 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5221 | -c "session hash for extended master secret"\ |
| 5222 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5223 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5224 | -S "SSL - Unknown identity received" \ |
| 5225 | -S "SSL - Verification of the message MAC failed" |
| 5226 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5227 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5228 | 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] | 5229 | "$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] | 5230 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5231 | psk_identity=foo psk=abc123" \ |
| 5232 | 0 \ |
| 5233 | -C "skip PMS generation for opaque PSK"\ |
| 5234 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5235 | -C "session hash for extended master secret"\ |
| 5236 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5237 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5238 | -S "SSL - Unknown identity received" \ |
| 5239 | -S "SSL - Verification of the message MAC failed" |
| 5240 | |
| 5241 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5242 | 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] | 5243 | "$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] | 5244 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5245 | psk_identity=foo psk=abc123" \ |
| 5246 | 0 \ |
| 5247 | -C "skip PMS generation for opaque PSK"\ |
| 5248 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5249 | -C "session hash for extended master secret"\ |
| 5250 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5251 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5252 | -S "SSL - Unknown identity received" \ |
| 5253 | -S "SSL - Verification of the message MAC failed" |
| 5254 | |
| 5255 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5256 | 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] | 5257 | "$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] | 5258 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5259 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5260 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5261 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5262 | -c "session hash for extended master secret"\ |
| 5263 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5264 | -C "skip PMS generation for opaque PSK"\ |
| 5265 | -s "skip PMS generation for opaque PSK"\ |
| 5266 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5267 | -S "SSL - Unknown identity received" \ |
| 5268 | -S "SSL - Verification of the message MAC failed" |
| 5269 | |
| 5270 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5271 | 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] | 5272 | "$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] | 5273 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5274 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5275 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5276 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5277 | -c "session hash for extended master secret"\ |
| 5278 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5279 | -C "skip PMS generation for opaque PSK"\ |
| 5280 | -s "skip PMS generation for opaque PSK"\ |
| 5281 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5282 | -S "SSL - Unknown identity received" \ |
| 5283 | -S "SSL - Verification of the message MAC failed" |
| 5284 | |
| 5285 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5286 | 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] | 5287 | "$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] | 5288 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5289 | psk_identity=def psk=beef" \ |
| 5290 | 0 \ |
| 5291 | -C "skip PMS generation for opaque PSK"\ |
| 5292 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5293 | -C "session hash for extended master secret"\ |
| 5294 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5295 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5296 | -S "SSL - Unknown identity received" \ |
| 5297 | -S "SSL - Verification of the message MAC failed" |
| 5298 | |
| 5299 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5300 | 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] | 5301 | "$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] | 5302 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5303 | psk_identity=def psk=beef" \ |
| 5304 | 0 \ |
| 5305 | -C "skip PMS generation for opaque PSK"\ |
| 5306 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5307 | -C "session hash for extended master secret"\ |
| 5308 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5309 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5310 | -S "SSL - Unknown identity received" \ |
| 5311 | -S "SSL - Verification of the message MAC failed" |
| 5312 | |
| 5313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5314 | 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] | 5315 | "$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] | 5316 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5317 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5318 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5319 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5320 | -c "session hash for extended master secret"\ |
| 5321 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5322 | -C "skip PMS generation for opaque PSK"\ |
| 5323 | -s "skip PMS generation for opaque PSK"\ |
| 5324 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5325 | -S "SSL - Unknown identity received" \ |
| 5326 | -S "SSL - Verification of the message MAC failed" |
| 5327 | |
| 5328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5329 | 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] | 5330 | "$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] | 5331 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5332 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5333 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5334 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5335 | -c "session hash for extended master secret"\ |
| 5336 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5337 | -C "skip PMS generation for opaque PSK"\ |
| 5338 | -s "skip PMS generation for opaque PSK"\ |
| 5339 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5340 | -S "SSL - Unknown identity received" \ |
| 5341 | -S "SSL - Verification of the message MAC failed" |
| 5342 | |
| 5343 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5344 | 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] | 5345 | "$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] | 5346 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5347 | psk_identity=def psk=beef" \ |
| 5348 | 0 \ |
| 5349 | -C "skip PMS generation for opaque PSK"\ |
| 5350 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5351 | -C "session hash for extended master secret"\ |
| 5352 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5353 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5354 | -S "SSL - Unknown identity received" \ |
| 5355 | -S "SSL - Verification of the message MAC failed" |
| 5356 | |
| 5357 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5358 | 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] | 5359 | "$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] | 5360 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5361 | psk_identity=def psk=beef" \ |
| 5362 | 0 \ |
| 5363 | -C "skip PMS generation for opaque PSK"\ |
| 5364 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5365 | -C "session hash for extended master secret"\ |
| 5366 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5367 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5368 | -S "SSL - Unknown identity received" \ |
| 5369 | -S "SSL - Verification of the message MAC failed" |
| 5370 | |
| 5371 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5372 | 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] | 5373 | "$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] | 5374 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5375 | psk_identity=def psk=beef" \ |
| 5376 | 0 \ |
| 5377 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5378 | -C "session hash for extended master secret"\ |
| 5379 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5380 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5381 | -S "SSL - Unknown identity received" \ |
| 5382 | -S "SSL - Verification of the message MAC failed" |
| 5383 | |
| 5384 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5385 | 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] | 5386 | "$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] | 5387 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5388 | psk_identity=def psk=beef" \ |
| 5389 | 0 \ |
| 5390 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5391 | -C "session hash for extended master secret"\ |
| 5392 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5393 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5394 | -S "SSL - Unknown identity received" \ |
| 5395 | -S "SSL - Verification of the message MAC failed" |
| 5396 | |
| 5397 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5398 | 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] | 5399 | "$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] | 5400 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5401 | psk_identity=def psk=beef" \ |
| 5402 | 1 \ |
| 5403 | -s "SSL - Verification of the message MAC failed" |
| 5404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5405 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5406 | "$P_SRV" \ |
| 5407 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5408 | psk_identity=foo psk=abc123" \ |
| 5409 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5410 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5411 | -S "SSL - Unknown identity received" \ |
| 5412 | -S "SSL - Verification of the message MAC failed" |
| 5413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5414 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5415 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5416 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5417 | psk_identity=foo psk=abc123" \ |
| 5418 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5419 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5420 | -s "SSL - Unknown identity received" \ |
| 5421 | -S "SSL - Verification of the message MAC failed" |
| 5422 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5423 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5424 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5425 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5426 | psk_identity=abc psk=dead" \ |
| 5427 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5428 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5429 | -S "SSL - Unknown identity received" \ |
| 5430 | -S "SSL - Verification of the message MAC failed" |
| 5431 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5432 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5433 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5434 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5435 | psk_identity=def psk=beef" \ |
| 5436 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5437 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5438 | -S "SSL - Unknown identity received" \ |
| 5439 | -S "SSL - Verification of the message MAC failed" |
| 5440 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5441 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5442 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5443 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5444 | psk_identity=ghi psk=beef" \ |
| 5445 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5446 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5447 | -s "SSL - Unknown identity received" \ |
| 5448 | -S "SSL - Verification of the message MAC failed" |
| 5449 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5450 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5451 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5452 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5453 | psk_identity=abc psk=beef" \ |
| 5454 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5455 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5456 | -S "SSL - Unknown identity received" \ |
| 5457 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5458 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5459 | # Tests for EC J-PAKE |
| 5460 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5462 | run_test "ECJPAKE: client not configured" \ |
| 5463 | "$P_SRV debug_level=3" \ |
| 5464 | "$P_CLI debug_level=3" \ |
| 5465 | 0 \ |
| 5466 | -C "add ciphersuite: c0ff" \ |
| 5467 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5468 | -S "found ecjpake kkpp extension" \ |
| 5469 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5470 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5471 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5472 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5473 | -S "None of the common ciphersuites is usable" |
| 5474 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5475 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5476 | run_test "ECJPAKE: server not configured" \ |
| 5477 | "$P_SRV debug_level=3" \ |
| 5478 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5479 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5480 | 1 \ |
| 5481 | -c "add ciphersuite: c0ff" \ |
| 5482 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5483 | -s "found ecjpake kkpp extension" \ |
| 5484 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5485 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5486 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5487 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5488 | -s "None of the common ciphersuites is usable" |
| 5489 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5490 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5491 | run_test "ECJPAKE: working, TLS" \ |
| 5492 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5493 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5494 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5495 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5496 | -c "add ciphersuite: c0ff" \ |
| 5497 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5498 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5499 | -s "found ecjpake kkpp extension" \ |
| 5500 | -S "skip ecjpake kkpp extension" \ |
| 5501 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5502 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5503 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5504 | -S "None of the common ciphersuites is usable" \ |
| 5505 | -S "SSL - Verification of the message MAC failed" |
| 5506 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5507 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5508 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5509 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5510 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5511 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5512 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5513 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5514 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5515 | -s "SSL - Verification of the message MAC failed" |
| 5516 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5517 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5518 | run_test "ECJPAKE: working, DTLS" \ |
| 5519 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5520 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5521 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5522 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5523 | -c "re-using cached ecjpake parameters" \ |
| 5524 | -S "SSL - Verification of the message MAC failed" |
| 5525 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5526 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5527 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5528 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5529 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5530 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5531 | 0 \ |
| 5532 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5533 | -S "SSL - Verification of the message MAC failed" |
| 5534 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5535 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5536 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5537 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5538 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5539 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5540 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5541 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5542 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5543 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5544 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5545 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5547 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5548 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5549 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5550 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5551 | 0 |
| 5552 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5553 | # Tests for ciphersuites per version |
| 5554 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5555 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5556 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5557 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5558 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5559 | "$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] | 5560 | "$P_CLI force_version=ssl3" \ |
| 5561 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5562 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5563 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5565 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5566 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5567 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5568 | "$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] | 5569 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5570 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5571 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5572 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5574 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5575 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5576 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5577 | "$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] | 5578 | "$P_CLI force_version=tls1_1" \ |
| 5579 | 0 \ |
| 5580 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5581 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5582 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5583 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5584 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5585 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5586 | "$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] | 5587 | "$P_CLI force_version=tls1_2" \ |
| 5588 | 0 \ |
| 5589 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5590 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5591 | # Test for ClientHello without extensions |
| 5592 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5593 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5594 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5595 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5596 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5597 | 0 \ |
| 5598 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5599 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5600 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5601 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5602 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5603 | "$P_SRV" \ |
| 5604 | "$P_CLI request_size=100" \ |
| 5605 | 0 \ |
| 5606 | -s "Read from client: 100 bytes read$" |
| 5607 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5608 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5609 | "$P_SRV" \ |
| 5610 | "$P_CLI request_size=500" \ |
| 5611 | 0 \ |
| 5612 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5613 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5614 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5615 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5617 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5618 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5619 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5620 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5621 | 0 \ |
| 5622 | -s "Read from client: 1 bytes read" |
| 5623 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5624 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5625 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5626 | "$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] | 5627 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5628 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5629 | 0 \ |
| 5630 | -s "Read from client: 1 bytes read" |
| 5631 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5632 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5633 | "$P_SRV" \ |
| 5634 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5635 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5636 | 0 \ |
| 5637 | -s "Read from client: 1 bytes read" |
| 5638 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5639 | 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] | 5640 | "$P_SRV" \ |
| 5641 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5642 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5643 | 0 \ |
| 5644 | -s "Read from client: 1 bytes read" |
| 5645 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5646 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5647 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5648 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5649 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5650 | 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] | 5651 | 0 \ |
| 5652 | -s "Read from client: 1 bytes read" |
| 5653 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5654 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5655 | 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] | 5656 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5657 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5658 | 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] | 5659 | 0 \ |
| 5660 | -s "Read from client: 1 bytes read" |
| 5661 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5662 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5663 | "$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] | 5664 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5665 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5666 | 0 \ |
| 5667 | -s "Read from client: 1 bytes read" |
| 5668 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5669 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5670 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5671 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5672 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5673 | 0 \ |
| 5674 | -s "Read from client: 1 bytes read" |
| 5675 | |
| 5676 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5677 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5678 | "$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] | 5679 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5680 | 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] | 5681 | 0 \ |
| 5682 | -s "Read from client: 1 bytes read" |
| 5683 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5684 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5685 | 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] | 5686 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5687 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5688 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5689 | 0 \ |
| 5690 | -s "Read from client: 1 bytes read" |
| 5691 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5692 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5693 | "$P_SRV" \ |
| 5694 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5695 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5696 | 0 \ |
| 5697 | -s "Read from client: 1 bytes read" |
| 5698 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5699 | 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] | 5700 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5701 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5702 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5703 | 0 \ |
| 5704 | -s "Read from client: 1 bytes read" |
| 5705 | |
| 5706 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5707 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5708 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5709 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5710 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5711 | 0 \ |
| 5712 | -s "Read from client: 1 bytes read" |
| 5713 | |
| 5714 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5715 | 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] | 5716 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5717 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5718 | 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] | 5719 | 0 \ |
| 5720 | -s "Read from client: 1 bytes read" |
| 5721 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5722 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5723 | "$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] | 5724 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5725 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5726 | 0 \ |
| 5727 | -s "Read from client: 1 bytes read" |
| 5728 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5729 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5730 | "$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] | 5731 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5732 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5733 | 0 \ |
| 5734 | -s "Read from client: 1 bytes read" |
| 5735 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5736 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5737 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5738 | "$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] | 5739 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5740 | 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] | 5741 | 0 \ |
| 5742 | -s "Read from client: 1 bytes read" |
| 5743 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5744 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5745 | 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] | 5746 | "$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] | 5747 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5748 | 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] | 5749 | 0 \ |
| 5750 | -s "Read from client: 1 bytes read" |
| 5751 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5752 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5753 | "$P_SRV" \ |
| 5754 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5756 | 0 \ |
| 5757 | -s "Read from client: 1 bytes read" |
| 5758 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5759 | 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] | 5760 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5761 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5762 | 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] | 5763 | 0 \ |
| 5764 | -s "Read from client: 1 bytes read" |
| 5765 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5766 | 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] | 5767 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5768 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5769 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5770 | 0 \ |
| 5771 | -s "Read from client: 1 bytes read" |
| 5772 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5773 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5774 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5775 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5776 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5777 | 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] | 5778 | 0 \ |
| 5779 | -s "Read from client: 1 bytes read" |
| 5780 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5781 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5782 | 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] | 5783 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5784 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5785 | 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] | 5786 | 0 \ |
| 5787 | -s "Read from client: 1 bytes read" |
| 5788 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5789 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5790 | "$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] | 5791 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5792 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5793 | 0 \ |
| 5794 | -s "Read from client: 1 bytes read" |
| 5795 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5796 | 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] | 5797 | "$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] | 5798 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5799 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5800 | 0 \ |
| 5801 | -s "Read from client: 1 bytes read" |
| 5802 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5803 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5804 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5805 | "$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] | 5806 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5807 | 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] | 5808 | 0 \ |
| 5809 | -s "Read from client: 1 bytes read" |
| 5810 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5811 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5812 | 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] | 5813 | "$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] | 5814 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5815 | 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] | 5816 | 0 \ |
| 5817 | -s "Read from client: 1 bytes read" |
| 5818 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5819 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5820 | "$P_SRV" \ |
| 5821 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5822 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5823 | 0 \ |
| 5824 | -s "Read from client: 1 bytes read" |
| 5825 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5826 | 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] | 5827 | "$P_SRV" \ |
| 5828 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5829 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5830 | 0 \ |
| 5831 | -s "Read from client: 1 bytes read" |
| 5832 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5833 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5834 | |
| 5835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5836 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5837 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5838 | "$P_CLI dtls=1 request_size=1 \ |
| 5839 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5840 | 0 \ |
| 5841 | -s "Read from client: 1 bytes read" |
| 5842 | |
| 5843 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5844 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5845 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5846 | "$P_CLI dtls=1 request_size=1 \ |
| 5847 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5848 | 0 \ |
| 5849 | -s "Read from client: 1 bytes read" |
| 5850 | |
| 5851 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5852 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5853 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5854 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5855 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5857 | 0 \ |
| 5858 | -s "Read from client: 1 bytes read" |
| 5859 | |
| 5860 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5861 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5862 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5863 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5864 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5865 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5866 | 0 \ |
| 5867 | -s "Read from client: 1 bytes read" |
| 5868 | |
| 5869 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5870 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5871 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5872 | "$P_CLI dtls=1 request_size=1 \ |
| 5873 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5874 | 0 \ |
| 5875 | -s "Read from client: 1 bytes read" |
| 5876 | |
| 5877 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5878 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5879 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5880 | "$P_CLI dtls=1 request_size=1 \ |
| 5881 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5882 | 0 \ |
| 5883 | -s "Read from client: 1 bytes read" |
| 5884 | |
| 5885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5886 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5887 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5888 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5889 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5890 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5891 | 0 \ |
| 5892 | -s "Read from client: 1 bytes read" |
| 5893 | |
| 5894 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5895 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5896 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5897 | "$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] | 5898 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5899 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5900 | 0 \ |
| 5901 | -s "Read from client: 1 bytes read" |
| 5902 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5903 | # Tests for small server packets |
| 5904 | |
| 5905 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5906 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5907 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5908 | "$P_CLI force_version=ssl3 \ |
| 5909 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5910 | 0 \ |
| 5911 | -c "Read from server: 1 bytes read" |
| 5912 | |
| 5913 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5914 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5915 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5916 | "$P_CLI force_version=ssl3 \ |
| 5917 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5918 | 0 \ |
| 5919 | -c "Read from server: 1 bytes read" |
| 5920 | |
| 5921 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5922 | "$P_SRV response_size=1" \ |
| 5923 | "$P_CLI force_version=tls1 \ |
| 5924 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5925 | 0 \ |
| 5926 | -c "Read from server: 1 bytes read" |
| 5927 | |
| 5928 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5929 | "$P_SRV response_size=1" \ |
| 5930 | "$P_CLI force_version=tls1 etm=0 \ |
| 5931 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5932 | 0 \ |
| 5933 | -c "Read from server: 1 bytes read" |
| 5934 | |
| 5935 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5936 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5937 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5938 | "$P_CLI force_version=tls1 \ |
| 5939 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5940 | 0 \ |
| 5941 | -c "Read from server: 1 bytes read" |
| 5942 | |
| 5943 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5944 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5945 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5946 | "$P_CLI force_version=tls1 \ |
| 5947 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5948 | 0 \ |
| 5949 | -c "Read from server: 1 bytes read" |
| 5950 | |
| 5951 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5952 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5953 | "$P_CLI force_version=tls1 \ |
| 5954 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5955 | 0 \ |
| 5956 | -c "Read from server: 1 bytes read" |
| 5957 | |
| 5958 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5959 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5960 | "$P_CLI force_version=tls1 \ |
| 5961 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5962 | 0 \ |
| 5963 | -c "Read from server: 1 bytes read" |
| 5964 | |
| 5965 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5966 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5967 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5968 | "$P_CLI force_version=tls1 \ |
| 5969 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5970 | 0 \ |
| 5971 | -c "Read from server: 1 bytes read" |
| 5972 | |
| 5973 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5974 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5975 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5976 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5977 | trunc_hmac=1 etm=0" \ |
| 5978 | 0 \ |
| 5979 | -c "Read from server: 1 bytes read" |
| 5980 | |
| 5981 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5982 | "$P_SRV response_size=1" \ |
| 5983 | "$P_CLI force_version=tls1_1 \ |
| 5984 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5985 | 0 \ |
| 5986 | -c "Read from server: 1 bytes read" |
| 5987 | |
| 5988 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5989 | "$P_SRV response_size=1" \ |
| 5990 | "$P_CLI force_version=tls1_1 \ |
| 5991 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5992 | 0 \ |
| 5993 | -c "Read from server: 1 bytes read" |
| 5994 | |
| 5995 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5996 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5997 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5998 | "$P_CLI force_version=tls1_1 \ |
| 5999 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6000 | 0 \ |
| 6001 | -c "Read from server: 1 bytes read" |
| 6002 | |
| 6003 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6004 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6005 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6006 | "$P_CLI force_version=tls1_1 \ |
| 6007 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6008 | 0 \ |
| 6009 | -c "Read from server: 1 bytes read" |
| 6010 | |
| 6011 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6012 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6013 | "$P_CLI force_version=tls1_1 \ |
| 6014 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6015 | 0 \ |
| 6016 | -c "Read from server: 1 bytes read" |
| 6017 | |
| 6018 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6019 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6020 | "$P_CLI force_version=tls1_1 \ |
| 6021 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6022 | 0 \ |
| 6023 | -c "Read from server: 1 bytes read" |
| 6024 | |
| 6025 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6026 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6027 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6028 | "$P_CLI force_version=tls1_1 \ |
| 6029 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6030 | 0 \ |
| 6031 | -c "Read from server: 1 bytes read" |
| 6032 | |
| 6033 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6034 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6035 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6036 | "$P_CLI force_version=tls1_1 \ |
| 6037 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6038 | 0 \ |
| 6039 | -c "Read from server: 1 bytes read" |
| 6040 | |
| 6041 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6042 | "$P_SRV response_size=1" \ |
| 6043 | "$P_CLI force_version=tls1_2 \ |
| 6044 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6045 | 0 \ |
| 6046 | -c "Read from server: 1 bytes read" |
| 6047 | |
| 6048 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6049 | "$P_SRV response_size=1" \ |
| 6050 | "$P_CLI force_version=tls1_2 \ |
| 6051 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6052 | 0 \ |
| 6053 | -c "Read from server: 1 bytes read" |
| 6054 | |
| 6055 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6056 | "$P_SRV response_size=1" \ |
| 6057 | "$P_CLI force_version=tls1_2 \ |
| 6058 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6059 | 0 \ |
| 6060 | -c "Read from server: 1 bytes read" |
| 6061 | |
| 6062 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6063 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6064 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6065 | "$P_CLI force_version=tls1_2 \ |
| 6066 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6067 | 0 \ |
| 6068 | -c "Read from server: 1 bytes read" |
| 6069 | |
| 6070 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6071 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6072 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6073 | "$P_CLI force_version=tls1_2 \ |
| 6074 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6075 | 0 \ |
| 6076 | -c "Read from server: 1 bytes read" |
| 6077 | |
| 6078 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6079 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6080 | "$P_CLI force_version=tls1_2 \ |
| 6081 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6082 | 0 \ |
| 6083 | -c "Read from server: 1 bytes read" |
| 6084 | |
| 6085 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6086 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6087 | "$P_CLI force_version=tls1_2 \ |
| 6088 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6089 | 0 \ |
| 6090 | -c "Read from server: 1 bytes read" |
| 6091 | |
| 6092 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6093 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6094 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6095 | "$P_CLI force_version=tls1_2 \ |
| 6096 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6097 | 0 \ |
| 6098 | -c "Read from server: 1 bytes read" |
| 6099 | |
| 6100 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6101 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6102 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6103 | "$P_CLI force_version=tls1_2 \ |
| 6104 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6105 | 0 \ |
| 6106 | -c "Read from server: 1 bytes read" |
| 6107 | |
| 6108 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6109 | "$P_SRV response_size=1" \ |
| 6110 | "$P_CLI force_version=tls1_2 \ |
| 6111 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6112 | 0 \ |
| 6113 | -c "Read from server: 1 bytes read" |
| 6114 | |
| 6115 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6116 | "$P_SRV response_size=1" \ |
| 6117 | "$P_CLI force_version=tls1_2 \ |
| 6118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6119 | 0 \ |
| 6120 | -c "Read from server: 1 bytes read" |
| 6121 | |
| 6122 | # Tests for small server packets in DTLS |
| 6123 | |
| 6124 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6125 | run_test "Small server packet DTLS 1.0" \ |
| 6126 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6127 | "$P_CLI dtls=1 \ |
| 6128 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6129 | 0 \ |
| 6130 | -c "Read from server: 1 bytes read" |
| 6131 | |
| 6132 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6133 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6134 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6135 | "$P_CLI dtls=1 \ |
| 6136 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6137 | 0 \ |
| 6138 | -c "Read from server: 1 bytes read" |
| 6139 | |
| 6140 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6141 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6142 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6143 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6144 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6145 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6146 | 0 \ |
| 6147 | -c "Read from server: 1 bytes read" |
| 6148 | |
| 6149 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6151 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6152 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6153 | "$P_CLI dtls=1 \ |
| 6154 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6155 | 0 \ |
| 6156 | -c "Read from server: 1 bytes read" |
| 6157 | |
| 6158 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6159 | run_test "Small server packet DTLS 1.2" \ |
| 6160 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6161 | "$P_CLI dtls=1 \ |
| 6162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6163 | 0 \ |
| 6164 | -c "Read from server: 1 bytes read" |
| 6165 | |
| 6166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6167 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6168 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6169 | "$P_CLI dtls=1 \ |
| 6170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6171 | 0 \ |
| 6172 | -c "Read from server: 1 bytes read" |
| 6173 | |
| 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6175 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6176 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6177 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6178 | "$P_CLI dtls=1 \ |
| 6179 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6180 | 0 \ |
| 6181 | -c "Read from server: 1 bytes read" |
| 6182 | |
| 6183 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6184 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6185 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6186 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6187 | "$P_CLI dtls=1 \ |
| 6188 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6189 | 0 \ |
| 6190 | -c "Read from server: 1 bytes read" |
| 6191 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6192 | # A test for extensions in SSLv3 |
| 6193 | |
| 6194 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6195 | run_test "SSLv3 with extensions, server side" \ |
| 6196 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6197 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6198 | 0 \ |
| 6199 | -S "dumping 'client hello extensions'" \ |
| 6200 | -S "server hello, total extension length:" |
| 6201 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6202 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6203 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6204 | # How many fragments do we expect to write $1 bytes? |
| 6205 | fragments_for_write() { |
| 6206 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6207 | } |
| 6208 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6210 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6211 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6212 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6213 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6214 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6215 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6216 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6217 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6218 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6219 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6220 | "$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] | 6221 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6222 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6223 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6224 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6225 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6226 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6227 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6228 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6229 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6230 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6231 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6232 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6233 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6234 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6235 | 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] | 6236 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6237 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6238 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6239 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6240 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6241 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6242 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6243 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6244 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6245 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6246 | 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] | 6247 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6248 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6249 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6250 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6251 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6252 | 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] | 6253 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6254 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6255 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6256 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6257 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6258 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6259 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6260 | "$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] | 6261 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6262 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6263 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6264 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6265 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6266 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6267 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6268 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6269 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6270 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6272 | |
| 6273 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6274 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6275 | "$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] | 6276 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6277 | 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] | 6278 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6280 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6281 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6282 | 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] | 6283 | "$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] | 6284 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6285 | 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] | 6286 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6287 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6288 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6289 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6290 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6291 | "$P_SRV" \ |
| 6292 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6293 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6294 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6295 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6296 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6297 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6298 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6299 | "$P_SRV" \ |
| 6300 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6302 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6303 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6304 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6305 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6306 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6307 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6308 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6309 | 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] | 6310 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6312 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6313 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6314 | 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] | 6315 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6316 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6317 | 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] | 6318 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6319 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6320 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6321 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6322 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6323 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6324 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6325 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6326 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6327 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6328 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6329 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6330 | "$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] | 6331 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6332 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6333 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6334 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6335 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6336 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6338 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6339 | "$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] | 6340 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6341 | 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] | 6342 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6343 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6344 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6345 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6346 | 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] | 6347 | "$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] | 6348 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6349 | 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] | 6350 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6351 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6352 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6353 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6354 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6355 | "$P_SRV" \ |
| 6356 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6357 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6358 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6359 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6360 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6361 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6362 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6363 | "$P_SRV" \ |
| 6364 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6365 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6366 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6367 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6368 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6369 | 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] | 6370 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6371 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6372 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6373 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6374 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6375 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6376 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6378 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6379 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6380 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6381 | 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] | 6382 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6383 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6384 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6385 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6386 | 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] | 6387 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6388 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6389 | 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] | 6390 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6391 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6392 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6393 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6394 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6395 | "$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] | 6396 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6397 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6398 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6399 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6400 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6401 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6402 | 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] | 6403 | "$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] | 6404 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6405 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6406 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6407 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6408 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6410 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6411 | "$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] | 6412 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6413 | 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] | 6414 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6415 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6416 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6417 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6418 | 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] | 6419 | "$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] | 6420 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6421 | 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] | 6422 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6423 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6424 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6425 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6426 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6427 | "$P_SRV" \ |
| 6428 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6429 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6430 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6431 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6432 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6433 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6434 | 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] | 6435 | "$P_SRV" \ |
| 6436 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6437 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6438 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6439 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6440 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6441 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6442 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6444 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6445 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6446 | "$P_CLI force_version=ssl3 \ |
| 6447 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6448 | 0 \ |
| 6449 | -c "Read from server: 16384 bytes read" |
| 6450 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6451 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6452 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6453 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6454 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6455 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6456 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6457 | 0 \ |
| 6458 | -c "Read from server: 1 bytes read"\ |
| 6459 | -c "16383 bytes read"\ |
| 6460 | -C "Read from server: 16384 bytes read" |
| 6461 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6462 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6463 | "$P_SRV response_size=16384" \ |
| 6464 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6465 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6466 | 0 \ |
| 6467 | -c "Read from server: 1 bytes read"\ |
| 6468 | -c "16383 bytes read"\ |
| 6469 | -C "Read from server: 16384 bytes read" |
| 6470 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6471 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6472 | "$P_SRV response_size=16384" \ |
| 6473 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6474 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6475 | 0 \ |
| 6476 | -c "Read from server: 1 bytes read"\ |
| 6477 | -c "16383 bytes read"\ |
| 6478 | -C "Read from server: 16384 bytes read" |
| 6479 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6480 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6481 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6482 | "$P_SRV response_size=16384" \ |
| 6483 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6484 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6485 | trunc_hmac=1" \ |
| 6486 | 0 \ |
| 6487 | -c "Read from server: 1 bytes read"\ |
| 6488 | -c "16383 bytes read"\ |
| 6489 | -C "Read from server: 16384 bytes read" |
| 6490 | |
| 6491 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6492 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6493 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6494 | "$P_CLI force_version=tls1 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6496 | trunc_hmac=1" \ |
| 6497 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6498 | -s "16384 bytes written in 1 fragments" \ |
| 6499 | -c "Read from server: 16384 bytes read" |
| 6500 | |
| 6501 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6502 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6503 | "$P_CLI force_version=tls1 \ |
| 6504 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6505 | 0 \ |
| 6506 | -s "16384 bytes written in 1 fragments" \ |
| 6507 | -c "Read from server: 16384 bytes read" |
| 6508 | |
| 6509 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6510 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6511 | "$P_CLI force_version=tls1 \ |
| 6512 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6513 | 0 \ |
| 6514 | -s "16384 bytes written in 1 fragments" \ |
| 6515 | -c "Read from server: 16384 bytes read" |
| 6516 | |
| 6517 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6518 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6519 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6520 | "$P_CLI force_version=tls1 \ |
| 6521 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6522 | 0 \ |
| 6523 | -s "16384 bytes written in 1 fragments" \ |
| 6524 | -c "Read from server: 16384 bytes read" |
| 6525 | |
| 6526 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6527 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6528 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6529 | "$P_CLI force_version=tls1 \ |
| 6530 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6531 | 0 \ |
| 6532 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6533 | -c "Read from server: 16384 bytes read" |
| 6534 | |
| 6535 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6536 | "$P_SRV response_size=16384" \ |
| 6537 | "$P_CLI force_version=tls1_1 \ |
| 6538 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6539 | 0 \ |
| 6540 | -c "Read from server: 16384 bytes read" |
| 6541 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6542 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6543 | "$P_SRV response_size=16384" \ |
| 6544 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6545 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6546 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6547 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6548 | -c "Read from server: 16384 bytes read" |
| 6549 | |
| 6550 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6551 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6552 | "$P_SRV response_size=16384" \ |
| 6553 | "$P_CLI force_version=tls1_1 \ |
| 6554 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6555 | trunc_hmac=1" \ |
| 6556 | 0 \ |
| 6557 | -c "Read from server: 16384 bytes read" |
| 6558 | |
| 6559 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6560 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6561 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6562 | "$P_CLI force_version=tls1_1 \ |
| 6563 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6564 | 0 \ |
| 6565 | -s "16384 bytes written in 1 fragments" \ |
| 6566 | -c "Read from server: 16384 bytes read" |
| 6567 | |
| 6568 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6569 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6570 | "$P_CLI force_version=tls1_1 \ |
| 6571 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6572 | 0 \ |
| 6573 | -c "Read from server: 16384 bytes read" |
| 6574 | |
| 6575 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6576 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6577 | "$P_CLI force_version=tls1_1 \ |
| 6578 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6579 | 0 \ |
| 6580 | -s "16384 bytes written in 1 fragments" \ |
| 6581 | -c "Read from server: 16384 bytes read" |
| 6582 | |
| 6583 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6584 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6585 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6586 | "$P_CLI force_version=tls1_1 \ |
| 6587 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6588 | trunc_hmac=1" \ |
| 6589 | 0 \ |
| 6590 | -c "Read from server: 16384 bytes read" |
| 6591 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6592 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6593 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6594 | "$P_CLI force_version=tls1_1 \ |
| 6595 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6596 | 0 \ |
| 6597 | -s "16384 bytes written in 1 fragments" \ |
| 6598 | -c "Read from server: 16384 bytes read" |
| 6599 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6600 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6601 | "$P_SRV response_size=16384" \ |
| 6602 | "$P_CLI force_version=tls1_2 \ |
| 6603 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6604 | 0 \ |
| 6605 | -c "Read from server: 16384 bytes read" |
| 6606 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6607 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6608 | "$P_SRV response_size=16384" \ |
| 6609 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6610 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6611 | 0 \ |
| 6612 | -s "16384 bytes written in 1 fragments" \ |
| 6613 | -c "Read from server: 16384 bytes read" |
| 6614 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6615 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6616 | "$P_SRV response_size=16384" \ |
| 6617 | "$P_CLI force_version=tls1_2 \ |
| 6618 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6619 | 0 \ |
| 6620 | -c "Read from server: 16384 bytes read" |
| 6621 | |
| 6622 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6623 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6624 | "$P_SRV response_size=16384" \ |
| 6625 | "$P_CLI force_version=tls1_2 \ |
| 6626 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6627 | trunc_hmac=1" \ |
| 6628 | 0 \ |
| 6629 | -c "Read from server: 16384 bytes read" |
| 6630 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6631 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6632 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6633 | "$P_CLI force_version=tls1_2 \ |
| 6634 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6635 | 0 \ |
| 6636 | -s "16384 bytes written in 1 fragments" \ |
| 6637 | -c "Read from server: 16384 bytes read" |
| 6638 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6639 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6640 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6641 | "$P_CLI force_version=tls1_2 \ |
| 6642 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6643 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6644 | -s "16384 bytes written in 1 fragments" \ |
| 6645 | -c "Read from server: 16384 bytes read" |
| 6646 | |
| 6647 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6648 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6649 | "$P_CLI force_version=tls1_2 \ |
| 6650 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6651 | 0 \ |
| 6652 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6653 | -c "Read from server: 16384 bytes read" |
| 6654 | |
| 6655 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6656 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6657 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6658 | "$P_CLI force_version=tls1_2 \ |
| 6659 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6660 | trunc_hmac=1" \ |
| 6661 | 0 \ |
| 6662 | -c "Read from server: 16384 bytes read" |
| 6663 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6664 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6665 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6666 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6667 | "$P_CLI force_version=tls1_2 \ |
| 6668 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6669 | 0 \ |
| 6670 | -s "16384 bytes written in 1 fragments" \ |
| 6671 | -c "Read from server: 16384 bytes read" |
| 6672 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6673 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6674 | "$P_SRV response_size=16384" \ |
| 6675 | "$P_CLI force_version=tls1_2 \ |
| 6676 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6677 | 0 \ |
| 6678 | -c "Read from server: 16384 bytes read" |
| 6679 | |
| 6680 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6681 | "$P_SRV response_size=16384" \ |
| 6682 | "$P_CLI force_version=tls1_2 \ |
| 6683 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6684 | 0 \ |
| 6685 | -c "Read from server: 16384 bytes read" |
| 6686 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6687 | # Tests for restartable ECC |
| 6688 | |
| 6689 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6690 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6691 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6692 | "$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] | 6693 | 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] | 6694 | debug_level=1" \ |
| 6695 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6696 | -C "x509_verify_cert.*4b00" \ |
| 6697 | -C "mbedtls_pk_verify.*4b00" \ |
| 6698 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6699 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6700 | |
| 6701 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6702 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6703 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6704 | "$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] | 6705 | 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] | 6706 | debug_level=1 ec_max_ops=0" \ |
| 6707 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6708 | -C "x509_verify_cert.*4b00" \ |
| 6709 | -C "mbedtls_pk_verify.*4b00" \ |
| 6710 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6711 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6712 | |
| 6713 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6714 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6715 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6716 | "$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] | 6717 | 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] | 6718 | debug_level=1 ec_max_ops=65535" \ |
| 6719 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6720 | -C "x509_verify_cert.*4b00" \ |
| 6721 | -C "mbedtls_pk_verify.*4b00" \ |
| 6722 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6723 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6724 | |
| 6725 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6726 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6727 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6728 | "$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] | 6729 | 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] | 6730 | debug_level=1 ec_max_ops=1000" \ |
| 6731 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6732 | -c "x509_verify_cert.*4b00" \ |
| 6733 | -c "mbedtls_pk_verify.*4b00" \ |
| 6734 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6735 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6736 | |
| 6737 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6738 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6739 | "$P_SRV auth_mode=required \ |
| 6740 | crt_file=data_files/server5-badsign.crt \ |
| 6741 | key_file=data_files/server5.key" \ |
| 6742 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6743 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6744 | debug_level=1 ec_max_ops=1000" \ |
| 6745 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6746 | -c "x509_verify_cert.*4b00" \ |
| 6747 | -C "mbedtls_pk_verify.*4b00" \ |
| 6748 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6749 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6750 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6751 | -c "! mbedtls_ssl_handshake returned" \ |
| 6752 | -c "X509 - Certificate verification failed" |
| 6753 | |
| 6754 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6755 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6756 | "$P_SRV auth_mode=required \ |
| 6757 | crt_file=data_files/server5-badsign.crt \ |
| 6758 | key_file=data_files/server5.key" \ |
| 6759 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6760 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6761 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6762 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6763 | -c "x509_verify_cert.*4b00" \ |
| 6764 | -c "mbedtls_pk_verify.*4b00" \ |
| 6765 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6766 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6767 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6768 | -C "! mbedtls_ssl_handshake returned" \ |
| 6769 | -C "X509 - Certificate verification failed" |
| 6770 | |
| 6771 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6772 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6773 | "$P_SRV auth_mode=required \ |
| 6774 | crt_file=data_files/server5-badsign.crt \ |
| 6775 | key_file=data_files/server5.key" \ |
| 6776 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6777 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6778 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6779 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6780 | -C "x509_verify_cert.*4b00" \ |
| 6781 | -c "mbedtls_pk_verify.*4b00" \ |
| 6782 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6783 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6784 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6785 | -C "! mbedtls_ssl_handshake returned" \ |
| 6786 | -C "X509 - Certificate verification failed" |
| 6787 | |
| 6788 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6789 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6790 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6791 | "$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] | 6792 | 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] | 6793 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6794 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6795 | -c "x509_verify_cert.*4b00" \ |
| 6796 | -c "mbedtls_pk_verify.*4b00" \ |
| 6797 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6798 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6799 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6800 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6801 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6802 | "$P_SRV" \ |
| 6803 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6804 | debug_level=1 ec_max_ops=1000" \ |
| 6805 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6806 | -c "x509_verify_cert.*4b00" \ |
| 6807 | -c "mbedtls_pk_verify.*4b00" \ |
| 6808 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6809 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6810 | |
| 6811 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6812 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6813 | "$P_SRV psk=abc123" \ |
| 6814 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6815 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6816 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6817 | -C "x509_verify_cert.*4b00" \ |
| 6818 | -C "mbedtls_pk_verify.*4b00" \ |
| 6819 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6820 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6821 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6822 | # Tests of asynchronous private key support in SSL |
| 6823 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6824 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6825 | run_test "SSL async private: sign, delay=0" \ |
| 6826 | "$P_SRV \ |
| 6827 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6828 | "$P_CLI" \ |
| 6829 | 0 \ |
| 6830 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6831 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6832 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6833 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6834 | run_test "SSL async private: sign, delay=1" \ |
| 6835 | "$P_SRV \ |
| 6836 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6837 | "$P_CLI" \ |
| 6838 | 0 \ |
| 6839 | -s "Async sign callback: using key slot " \ |
| 6840 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6841 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6842 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6843 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6844 | run_test "SSL async private: sign, delay=2" \ |
| 6845 | "$P_SRV \ |
| 6846 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6847 | "$P_CLI" \ |
| 6848 | 0 \ |
| 6849 | -s "Async sign callback: using key slot " \ |
| 6850 | -U "Async sign callback: using key slot " \ |
| 6851 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6852 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6853 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6854 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6855 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6856 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6857 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6858 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6859 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6860 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6861 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6862 | "$P_CLI force_version=tls1_1" \ |
| 6863 | 0 \ |
| 6864 | -s "Async sign callback: using key slot " \ |
| 6865 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6866 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6868 | run_test "SSL async private: sign, SNI" \ |
| 6869 | "$P_SRV debug_level=3 \ |
| 6870 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6871 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6872 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6873 | "$P_CLI server_name=polarssl.example" \ |
| 6874 | 0 \ |
| 6875 | -s "Async sign callback: using key slot " \ |
| 6876 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6877 | -s "parse ServerName extension" \ |
| 6878 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6879 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6880 | |
| 6881 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6882 | run_test "SSL async private: decrypt, delay=0" \ |
| 6883 | "$P_SRV \ |
| 6884 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6885 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6886 | 0 \ |
| 6887 | -s "Async decrypt callback: using key slot " \ |
| 6888 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6889 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6890 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6891 | run_test "SSL async private: decrypt, delay=1" \ |
| 6892 | "$P_SRV \ |
| 6893 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6894 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6895 | 0 \ |
| 6896 | -s "Async decrypt callback: using key slot " \ |
| 6897 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6898 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6899 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6900 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6901 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6902 | "$P_SRV psk=abc123 \ |
| 6903 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6904 | "$P_CLI psk=abc123 \ |
| 6905 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6906 | 0 \ |
| 6907 | -s "Async decrypt callback: using key slot " \ |
| 6908 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6909 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6911 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6912 | "$P_SRV psk=abc123 \ |
| 6913 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6914 | "$P_CLI psk=abc123 \ |
| 6915 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6916 | 0 \ |
| 6917 | -s "Async decrypt callback: using key slot " \ |
| 6918 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6919 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6920 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6921 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6922 | run_test "SSL async private: sign callback not present" \ |
| 6923 | "$P_SRV \ |
| 6924 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6925 | "$P_CLI; [ \$? -eq 1 ] && |
| 6926 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6927 | 0 \ |
| 6928 | -S "Async sign callback" \ |
| 6929 | -s "! mbedtls_ssl_handshake returned" \ |
| 6930 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6931 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6932 | -s "Successful connection" |
| 6933 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6934 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6935 | run_test "SSL async private: decrypt callback not present" \ |
| 6936 | "$P_SRV debug_level=1 \ |
| 6937 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6938 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6939 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6940 | 0 \ |
| 6941 | -S "Async decrypt callback" \ |
| 6942 | -s "! mbedtls_ssl_handshake returned" \ |
| 6943 | -s "got no RSA private key" \ |
| 6944 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6945 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6946 | |
| 6947 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6949 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6950 | "$P_SRV \ |
| 6951 | async_operations=s async_private_delay1=1 \ |
| 6952 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6953 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6954 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6955 | 0 \ |
| 6956 | -s "Async sign callback: using key slot 0," \ |
| 6957 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6958 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6959 | |
| 6960 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6961 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6962 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6963 | "$P_SRV \ |
| 6964 | async_operations=s async_private_delay2=1 \ |
| 6965 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6966 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6967 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6968 | 0 \ |
| 6969 | -s "Async sign callback: using key slot 0," \ |
| 6970 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6971 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6972 | |
| 6973 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6975 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6976 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6977 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6978 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6979 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6980 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6981 | 0 \ |
| 6982 | -s "Async sign callback: using key slot 1," \ |
| 6983 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6984 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6985 | |
| 6986 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6988 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6989 | "$P_SRV \ |
| 6990 | async_operations=s async_private_delay1=1 \ |
| 6991 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6992 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6993 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6994 | 0 \ |
| 6995 | -s "Async sign callback: no key matches this certificate." |
| 6996 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6997 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6998 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6999 | "$P_SRV \ |
| 7000 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7001 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7002 | "$P_CLI" \ |
| 7003 | 1 \ |
| 7004 | -s "Async sign callback: injected error" \ |
| 7005 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7006 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7007 | -s "! mbedtls_ssl_handshake returned" |
| 7008 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7009 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7010 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7011 | "$P_SRV \ |
| 7012 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7013 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7014 | "$P_CLI" \ |
| 7015 | 1 \ |
| 7016 | -s "Async sign callback: using key slot " \ |
| 7017 | -S "Async resume" \ |
| 7018 | -s "Async cancel" |
| 7019 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7020 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7021 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7022 | "$P_SRV \ |
| 7023 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7024 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7025 | "$P_CLI" \ |
| 7026 | 1 \ |
| 7027 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7028 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7029 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7030 | -s "! mbedtls_ssl_handshake returned" |
| 7031 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7032 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7033 | run_test "SSL async private: decrypt, error in start" \ |
| 7034 | "$P_SRV \ |
| 7035 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7036 | async_private_error=1" \ |
| 7037 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7038 | 1 \ |
| 7039 | -s "Async decrypt callback: injected error" \ |
| 7040 | -S "Async resume" \ |
| 7041 | -S "Async cancel" \ |
| 7042 | -s "! mbedtls_ssl_handshake returned" |
| 7043 | |
| 7044 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7045 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7046 | "$P_SRV \ |
| 7047 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7048 | async_private_error=2" \ |
| 7049 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7050 | 1 \ |
| 7051 | -s "Async decrypt callback: using key slot " \ |
| 7052 | -S "Async resume" \ |
| 7053 | -s "Async cancel" |
| 7054 | |
| 7055 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7056 | run_test "SSL async private: decrypt, error in resume" \ |
| 7057 | "$P_SRV \ |
| 7058 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7059 | async_private_error=3" \ |
| 7060 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7061 | 1 \ |
| 7062 | -s "Async decrypt callback: using key slot " \ |
| 7063 | -s "Async resume callback: decrypt done but injected error" \ |
| 7064 | -S "Async cancel" \ |
| 7065 | -s "! mbedtls_ssl_handshake returned" |
| 7066 | |
| 7067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7068 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7069 | "$P_SRV \ |
| 7070 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7071 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7072 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7073 | 0 \ |
| 7074 | -s "Async cancel" \ |
| 7075 | -s "! mbedtls_ssl_handshake returned" \ |
| 7076 | -s "Async resume" \ |
| 7077 | -s "Successful connection" |
| 7078 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7079 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7080 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7081 | "$P_SRV \ |
| 7082 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7083 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7084 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7085 | 0 \ |
| 7086 | -s "! mbedtls_ssl_handshake returned" \ |
| 7087 | -s "Async resume" \ |
| 7088 | -s "Successful connection" |
| 7089 | |
| 7090 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7091 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7092 | 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] | 7093 | "$P_SRV \ |
| 7094 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7095 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7096 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7097 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7098 | [ \$? -eq 1 ] && |
| 7099 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7100 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7101 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7102 | -S "Async resume" \ |
| 7103 | -s "Async cancel" \ |
| 7104 | -s "! mbedtls_ssl_handshake returned" \ |
| 7105 | -s "Async sign callback: no key matches this certificate." \ |
| 7106 | -s "Successful connection" |
| 7107 | |
| 7108 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7110 | 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] | 7111 | "$P_SRV \ |
| 7112 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7113 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7114 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7115 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7116 | [ \$? -eq 1 ] && |
| 7117 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7118 | 0 \ |
| 7119 | -s "Async resume" \ |
| 7120 | -s "! mbedtls_ssl_handshake returned" \ |
| 7121 | -s "Async sign callback: no key matches this certificate." \ |
| 7122 | -s "Successful connection" |
| 7123 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7124 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7125 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7126 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7127 | "$P_SRV \ |
| 7128 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7129 | exchanges=2 renegotiation=1" \ |
| 7130 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7131 | 0 \ |
| 7132 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7133 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7134 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7135 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7137 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7138 | "$P_SRV \ |
| 7139 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7140 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7141 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7142 | 0 \ |
| 7143 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7144 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7145 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7146 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7147 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7148 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7149 | "$P_SRV \ |
| 7150 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7151 | exchanges=2 renegotiation=1" \ |
| 7152 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7153 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7154 | 0 \ |
| 7155 | -s "Async decrypt callback: using key slot " \ |
| 7156 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7157 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7159 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7160 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7161 | "$P_SRV \ |
| 7162 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7163 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7164 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7165 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7166 | 0 \ |
| 7167 | -s "Async decrypt callback: using key slot " \ |
| 7168 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7169 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7170 | # Tests for ECC extensions (rfc 4492) |
| 7171 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7172 | requires_config_enabled MBEDTLS_AES_C |
| 7173 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7174 | requires_config_enabled MBEDTLS_SHA256_C |
| 7175 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7176 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7177 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7178 | "$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] | 7179 | 0 \ |
| 7180 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7181 | -C "client hello, adding supported_point_formats extension" \ |
| 7182 | -S "found supported elliptic curves extension" \ |
| 7183 | -S "found supported point formats extension" |
| 7184 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_AES_C |
| 7186 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7187 | requires_config_enabled MBEDTLS_SHA256_C |
| 7188 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7189 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7190 | "$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] | 7191 | "$P_CLI debug_level=3" \ |
| 7192 | 0 \ |
| 7193 | -C "found supported_point_formats extension" \ |
| 7194 | -S "server hello, supported_point_formats extension" |
| 7195 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7196 | requires_config_enabled MBEDTLS_AES_C |
| 7197 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7198 | requires_config_enabled MBEDTLS_SHA256_C |
| 7199 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7200 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7201 | "$P_SRV debug_level=3" \ |
| 7202 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7203 | 0 \ |
| 7204 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7205 | -c "client hello, adding supported_point_formats extension" \ |
| 7206 | -s "found supported elliptic curves extension" \ |
| 7207 | -s "found supported point formats extension" |
| 7208 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7209 | requires_config_enabled MBEDTLS_AES_C |
| 7210 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7211 | requires_config_enabled MBEDTLS_SHA256_C |
| 7212 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7213 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7214 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7215 | "$P_CLI debug_level=3" \ |
| 7216 | 0 \ |
| 7217 | -c "found supported_point_formats extension" \ |
| 7218 | -s "server hello, supported_point_formats extension" |
| 7219 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7220 | # Tests for DTLS HelloVerifyRequest |
| 7221 | |
| 7222 | run_test "DTLS cookie: enabled" \ |
| 7223 | "$P_SRV dtls=1 debug_level=2" \ |
| 7224 | "$P_CLI dtls=1 debug_level=2" \ |
| 7225 | 0 \ |
| 7226 | -s "cookie verification failed" \ |
| 7227 | -s "cookie verification passed" \ |
| 7228 | -S "cookie verification skipped" \ |
| 7229 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7230 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7231 | -S "SSL - The requested feature is not available" |
| 7232 | |
| 7233 | run_test "DTLS cookie: disabled" \ |
| 7234 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7235 | "$P_CLI dtls=1 debug_level=2" \ |
| 7236 | 0 \ |
| 7237 | -S "cookie verification failed" \ |
| 7238 | -S "cookie verification passed" \ |
| 7239 | -s "cookie verification skipped" \ |
| 7240 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7241 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7242 | -S "SSL - The requested feature is not available" |
| 7243 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7244 | run_test "DTLS cookie: default (failing)" \ |
| 7245 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7246 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7247 | 1 \ |
| 7248 | -s "cookie verification failed" \ |
| 7249 | -S "cookie verification passed" \ |
| 7250 | -S "cookie verification skipped" \ |
| 7251 | -C "received hello verify request" \ |
| 7252 | -S "hello verification requested" \ |
| 7253 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7254 | |
| 7255 | requires_ipv6 |
| 7256 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7257 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7258 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7259 | 0 \ |
| 7260 | -s "cookie verification failed" \ |
| 7261 | -s "cookie verification passed" \ |
| 7262 | -S "cookie verification skipped" \ |
| 7263 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7264 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7265 | -S "SSL - The requested feature is not available" |
| 7266 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7267 | run_test "DTLS cookie: enabled, nbio" \ |
| 7268 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7269 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7270 | 0 \ |
| 7271 | -s "cookie verification failed" \ |
| 7272 | -s "cookie verification passed" \ |
| 7273 | -S "cookie verification skipped" \ |
| 7274 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7275 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7276 | -S "SSL - The requested feature is not available" |
| 7277 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7278 | # Tests for client reconnecting from the same port with DTLS |
| 7279 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7280 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7281 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7282 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7283 | "$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] | 7284 | 0 \ |
| 7285 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7286 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7287 | -S "Client initiated reconnection from same port" |
| 7288 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7289 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7290 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7291 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7292 | "$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] | 7293 | 0 \ |
| 7294 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7295 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7296 | -s "Client initiated reconnection from same port" |
| 7297 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7298 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7299 | 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] | 7300 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7301 | "$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] | 7302 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7303 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7304 | -s "Client initiated reconnection from same port" |
| 7305 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7306 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7307 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7308 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7309 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7310 | 0 \ |
| 7311 | -S "The operation timed out" \ |
| 7312 | -s "Client initiated reconnection from same port" |
| 7313 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7314 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7315 | "$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] | 7316 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7317 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7318 | -s "The operation timed out" \ |
| 7319 | -S "Client initiated reconnection from same port" |
| 7320 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7321 | # Tests for various cases of client authentication with DTLS |
| 7322 | # (focused on handshake flows and message parsing) |
| 7323 | |
| 7324 | run_test "DTLS client auth: required" \ |
| 7325 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7326 | "$P_CLI dtls=1" \ |
| 7327 | 0 \ |
| 7328 | -s "Verifying peer X.509 certificate... ok" |
| 7329 | |
| 7330 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7331 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7332 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7333 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7334 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7335 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7336 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7337 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7338 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7339 | 0 \ |
| 7340 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7341 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7342 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7343 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7344 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7345 | "$P_CLI dtls=1 psk=abc124" \ |
| 7346 | 1 \ |
| 7347 | -s "SSL - Verification of the message MAC failed" \ |
| 7348 | -c "SSL - A fatal alert message was received from our peer" |
| 7349 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7350 | # Tests for receiving fragmented handshake messages with DTLS |
| 7351 | |
| 7352 | requires_gnutls |
| 7353 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7354 | "$G_SRV -u --mtu 2048 -a" \ |
| 7355 | "$P_CLI dtls=1 debug_level=2" \ |
| 7356 | 0 \ |
| 7357 | -C "found fragmented DTLS handshake message" \ |
| 7358 | -C "error" |
| 7359 | |
| 7360 | requires_gnutls |
| 7361 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7362 | "$G_SRV -u --mtu 512" \ |
| 7363 | "$P_CLI dtls=1 debug_level=2" \ |
| 7364 | 0 \ |
| 7365 | -c "found fragmented DTLS handshake message" \ |
| 7366 | -C "error" |
| 7367 | |
| 7368 | requires_gnutls |
| 7369 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7370 | "$G_SRV -u --mtu 128" \ |
| 7371 | "$P_CLI dtls=1 debug_level=2" \ |
| 7372 | 0 \ |
| 7373 | -c "found fragmented DTLS handshake message" \ |
| 7374 | -C "error" |
| 7375 | |
| 7376 | requires_gnutls |
| 7377 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7378 | "$G_SRV -u --mtu 128" \ |
| 7379 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7380 | 0 \ |
| 7381 | -c "found fragmented DTLS handshake message" \ |
| 7382 | -C "error" |
| 7383 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7384 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7386 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7387 | "$G_SRV -u --mtu 256" \ |
| 7388 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7389 | 0 \ |
| 7390 | -c "found fragmented DTLS handshake message" \ |
| 7391 | -c "client hello, adding renegotiation extension" \ |
| 7392 | -c "found renegotiation extension" \ |
| 7393 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7394 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7395 | -C "error" \ |
| 7396 | -s "Extra-header:" |
| 7397 | |
| 7398 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7399 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7400 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7401 | "$G_SRV -u --mtu 256" \ |
| 7402 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7403 | 0 \ |
| 7404 | -c "found fragmented DTLS handshake message" \ |
| 7405 | -c "client hello, adding renegotiation extension" \ |
| 7406 | -c "found renegotiation extension" \ |
| 7407 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7408 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7409 | -C "error" \ |
| 7410 | -s "Extra-header:" |
| 7411 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7412 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7413 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7414 | "$P_CLI dtls=1 debug_level=2" \ |
| 7415 | 0 \ |
| 7416 | -C "found fragmented DTLS handshake message" \ |
| 7417 | -C "error" |
| 7418 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7419 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7420 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7421 | "$P_CLI dtls=1 debug_level=2" \ |
| 7422 | 0 \ |
| 7423 | -c "found fragmented DTLS handshake message" \ |
| 7424 | -C "error" |
| 7425 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7426 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7427 | "$O_SRV -dtls1 -mtu 256" \ |
| 7428 | "$P_CLI dtls=1 debug_level=2" \ |
| 7429 | 0 \ |
| 7430 | -c "found fragmented DTLS handshake message" \ |
| 7431 | -C "error" |
| 7432 | |
| 7433 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7434 | "$O_SRV -dtls1 -mtu 256" \ |
| 7435 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7436 | 0 \ |
| 7437 | -c "found fragmented DTLS handshake message" \ |
| 7438 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7439 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7440 | # Tests for sending fragmented handshake messages with DTLS |
| 7441 | # |
| 7442 | # Use client auth when we need the client to send large messages, |
| 7443 | # and use large cert chains on both sides too (the long chains we have all use |
| 7444 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7445 | # Sizes reached (UDP payload): |
| 7446 | # - 2037B for server certificate |
| 7447 | # - 1542B for client certificate |
| 7448 | # - 1013B for newsessionticket |
| 7449 | # - all others below 512B |
| 7450 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7451 | |
| 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: none (for reference)" \ |
| 7457 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7458 | crt_file=data_files/server7_int-ca.crt \ |
| 7459 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7460 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7461 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7462 | "$P_CLI dtls=1 debug_level=2 \ |
| 7463 | crt_file=data_files/server8_int-ca2.crt \ |
| 7464 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7465 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7466 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7467 | 0 \ |
| 7468 | -S "found fragmented DTLS handshake message" \ |
| 7469 | -C "found fragmented DTLS handshake message" \ |
| 7470 | -C "error" |
| 7471 | |
| 7472 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7473 | requires_config_enabled MBEDTLS_RSA_C |
| 7474 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7475 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7476 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7477 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7478 | crt_file=data_files/server7_int-ca.crt \ |
| 7479 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7480 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7481 | max_frag_len=1024" \ |
| 7482 | "$P_CLI dtls=1 debug_level=2 \ |
| 7483 | crt_file=data_files/server8_int-ca2.crt \ |
| 7484 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7485 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7486 | max_frag_len=2048" \ |
| 7487 | 0 \ |
| 7488 | -S "found fragmented DTLS handshake message" \ |
| 7489 | -c "found fragmented DTLS handshake message" \ |
| 7490 | -C "error" |
| 7491 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7492 | # With the MFL extension, the server has no way of forcing |
| 7493 | # the client to not exceed a certain MTU; hence, the following |
| 7494 | # test can't be replicated with an MTU proxy such as the one |
| 7495 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7497 | requires_config_enabled MBEDTLS_RSA_C |
| 7498 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7499 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7500 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7501 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7502 | crt_file=data_files/server7_int-ca.crt \ |
| 7503 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7504 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7505 | max_frag_len=512" \ |
| 7506 | "$P_CLI dtls=1 debug_level=2 \ |
| 7507 | crt_file=data_files/server8_int-ca2.crt \ |
| 7508 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7509 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7510 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7511 | 0 \ |
| 7512 | -S "found fragmented DTLS handshake message" \ |
| 7513 | -c "found fragmented DTLS handshake message" \ |
| 7514 | -C "error" |
| 7515 | |
| 7516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7517 | requires_config_enabled MBEDTLS_RSA_C |
| 7518 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7519 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7520 | 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] | 7521 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7522 | crt_file=data_files/server7_int-ca.crt \ |
| 7523 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7524 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7525 | max_frag_len=2048" \ |
| 7526 | "$P_CLI dtls=1 debug_level=2 \ |
| 7527 | crt_file=data_files/server8_int-ca2.crt \ |
| 7528 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7529 | hs_timeout=2500-60000 \ |
| 7530 | max_frag_len=1024" \ |
| 7531 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7532 | -S "found fragmented DTLS handshake message" \ |
| 7533 | -c "found fragmented DTLS handshake message" \ |
| 7534 | -C "error" |
| 7535 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7536 | # While not required by the standard defining the MFL extension |
| 7537 | # (according to which it only applies to records, not to datagrams), |
| 7538 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7539 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7540 | # to the peer. |
| 7541 | # The next test checks that no datagrams significantly larger than the |
| 7542 | # negotiated MFL are sent. |
| 7543 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7544 | requires_config_enabled MBEDTLS_RSA_C |
| 7545 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7546 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7547 | 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] | 7548 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7549 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7550 | crt_file=data_files/server7_int-ca.crt \ |
| 7551 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7552 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7553 | max_frag_len=2048" \ |
| 7554 | "$P_CLI dtls=1 debug_level=2 \ |
| 7555 | crt_file=data_files/server8_int-ca2.crt \ |
| 7556 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7557 | hs_timeout=2500-60000 \ |
| 7558 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7559 | 0 \ |
| 7560 | -S "found fragmented DTLS handshake message" \ |
| 7561 | -c "found fragmented DTLS handshake message" \ |
| 7562 | -C "error" |
| 7563 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7565 | requires_config_enabled MBEDTLS_RSA_C |
| 7566 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7567 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7568 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7569 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7570 | crt_file=data_files/server7_int-ca.crt \ |
| 7571 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7572 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7573 | max_frag_len=2048" \ |
| 7574 | "$P_CLI dtls=1 debug_level=2 \ |
| 7575 | crt_file=data_files/server8_int-ca2.crt \ |
| 7576 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7577 | hs_timeout=2500-60000 \ |
| 7578 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7579 | 0 \ |
| 7580 | -s "found fragmented DTLS handshake message" \ |
| 7581 | -c "found fragmented DTLS handshake message" \ |
| 7582 | -C "error" |
| 7583 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7584 | # While not required by the standard defining the MFL extension |
| 7585 | # (according to which it only applies to records, not to datagrams), |
| 7586 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7587 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7588 | # to the peer. |
| 7589 | # The next test checks that no datagrams significantly larger than the |
| 7590 | # negotiated MFL are sent. |
| 7591 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7592 | requires_config_enabled MBEDTLS_RSA_C |
| 7593 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7594 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7595 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7596 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7597 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7598 | crt_file=data_files/server7_int-ca.crt \ |
| 7599 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7600 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7601 | max_frag_len=2048" \ |
| 7602 | "$P_CLI dtls=1 debug_level=2 \ |
| 7603 | crt_file=data_files/server8_int-ca2.crt \ |
| 7604 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7605 | hs_timeout=2500-60000 \ |
| 7606 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7607 | 0 \ |
| 7608 | -s "found fragmented DTLS handshake message" \ |
| 7609 | -c "found fragmented DTLS handshake message" \ |
| 7610 | -C "error" |
| 7611 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7612 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7613 | requires_config_enabled MBEDTLS_RSA_C |
| 7614 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7615 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7616 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7617 | crt_file=data_files/server7_int-ca.crt \ |
| 7618 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7619 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7620 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7621 | "$P_CLI dtls=1 debug_level=2 \ |
| 7622 | crt_file=data_files/server8_int-ca2.crt \ |
| 7623 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7624 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7625 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7626 | 0 \ |
| 7627 | -S "found fragmented DTLS handshake message" \ |
| 7628 | -C "found fragmented DTLS handshake message" \ |
| 7629 | -C "error" |
| 7630 | |
| 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7632 | requires_config_enabled MBEDTLS_RSA_C |
| 7633 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7634 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7635 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7636 | crt_file=data_files/server7_int-ca.crt \ |
| 7637 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7638 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7639 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7640 | "$P_CLI dtls=1 debug_level=2 \ |
| 7641 | crt_file=data_files/server8_int-ca2.crt \ |
| 7642 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7643 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7644 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7645 | 0 \ |
| 7646 | -s "found fragmented DTLS handshake message" \ |
| 7647 | -C "found fragmented DTLS handshake message" \ |
| 7648 | -C "error" |
| 7649 | |
| 7650 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7651 | requires_config_enabled MBEDTLS_RSA_C |
| 7652 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7653 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7654 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7655 | crt_file=data_files/server7_int-ca.crt \ |
| 7656 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7657 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7658 | mtu=512" \ |
| 7659 | "$P_CLI dtls=1 debug_level=2 \ |
| 7660 | crt_file=data_files/server8_int-ca2.crt \ |
| 7661 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7662 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7663 | mtu=2048" \ |
| 7664 | 0 \ |
| 7665 | -S "found fragmented DTLS handshake message" \ |
| 7666 | -c "found fragmented DTLS handshake message" \ |
| 7667 | -C "error" |
| 7668 | |
| 7669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7670 | requires_config_enabled MBEDTLS_RSA_C |
| 7671 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7672 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7673 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7674 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7675 | crt_file=data_files/server7_int-ca.crt \ |
| 7676 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7677 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7678 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7679 | "$P_CLI dtls=1 debug_level=2 \ |
| 7680 | crt_file=data_files/server8_int-ca2.crt \ |
| 7681 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7682 | hs_timeout=2500-60000 \ |
| 7683 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7684 | 0 \ |
| 7685 | -s "found fragmented DTLS handshake message" \ |
| 7686 | -c "found fragmented DTLS handshake message" \ |
| 7687 | -C "error" |
| 7688 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7689 | # 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] | 7690 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7691 | requires_config_enabled MBEDTLS_RSA_C |
| 7692 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7693 | requires_config_enabled MBEDTLS_SHA256_C |
| 7694 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7695 | requires_config_enabled MBEDTLS_AES_C |
| 7696 | requires_config_enabled MBEDTLS_GCM_C |
| 7697 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7698 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7699 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7700 | crt_file=data_files/server7_int-ca.crt \ |
| 7701 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7702 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7703 | mtu=512" \ |
| 7704 | "$P_CLI dtls=1 debug_level=2 \ |
| 7705 | crt_file=data_files/server8_int-ca2.crt \ |
| 7706 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7707 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7708 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7709 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7710 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7711 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7712 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7713 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7714 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7715 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7716 | # 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] | 7717 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7718 | # retransmissions, but in some cases (like both the server and client using |
| 7719 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7720 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7721 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7722 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7723 | requires_config_enabled MBEDTLS_RSA_C |
| 7724 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7725 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7726 | requires_config_enabled MBEDTLS_AES_C |
| 7727 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7728 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7729 | -p "$P_PXY mtu=508" \ |
| 7730 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7731 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7732 | key_file=data_files/server7.key \ |
| 7733 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7734 | "$P_CLI dtls=1 debug_level=2 \ |
| 7735 | crt_file=data_files/server8_int-ca2.crt \ |
| 7736 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7737 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7738 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7739 | 0 \ |
| 7740 | -s "found fragmented DTLS handshake message" \ |
| 7741 | -c "found fragmented DTLS handshake message" \ |
| 7742 | -C "error" |
| 7743 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7744 | # 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] | 7745 | only_with_valgrind |
| 7746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7747 | requires_config_enabled MBEDTLS_RSA_C |
| 7748 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7749 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7750 | requires_config_enabled MBEDTLS_AES_C |
| 7751 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7752 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7753 | -p "$P_PXY mtu=508" \ |
| 7754 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7755 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7756 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7757 | hs_timeout=250-10000" \ |
| 7758 | "$P_CLI dtls=1 debug_level=2 \ |
| 7759 | crt_file=data_files/server8_int-ca2.crt \ |
| 7760 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7761 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7762 | hs_timeout=250-10000" \ |
| 7763 | 0 \ |
| 7764 | -s "found fragmented DTLS handshake message" \ |
| 7765 | -c "found fragmented DTLS handshake message" \ |
| 7766 | -C "error" |
| 7767 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7768 | # 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] | 7769 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7770 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7771 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7773 | requires_config_enabled MBEDTLS_RSA_C |
| 7774 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7775 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7776 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7777 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7778 | crt_file=data_files/server7_int-ca.crt \ |
| 7779 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7780 | hs_timeout=10000-60000 \ |
| 7781 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7782 | "$P_CLI dtls=1 debug_level=2 \ |
| 7783 | crt_file=data_files/server8_int-ca2.crt \ |
| 7784 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7785 | hs_timeout=10000-60000 \ |
| 7786 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7787 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7788 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7789 | -s "found fragmented DTLS handshake message" \ |
| 7790 | -c "found fragmented DTLS handshake message" \ |
| 7791 | -C "error" |
| 7792 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7793 | # 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] | 7794 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7795 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7796 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7797 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7798 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7799 | requires_config_enabled MBEDTLS_RSA_C |
| 7800 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7801 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7802 | requires_config_enabled MBEDTLS_AES_C |
| 7803 | requires_config_enabled MBEDTLS_GCM_C |
| 7804 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7805 | -p "$P_PXY mtu=512" \ |
| 7806 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7807 | crt_file=data_files/server7_int-ca.crt \ |
| 7808 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7809 | hs_timeout=10000-60000 \ |
| 7810 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7811 | "$P_CLI dtls=1 debug_level=2 \ |
| 7812 | crt_file=data_files/server8_int-ca2.crt \ |
| 7813 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7814 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7815 | hs_timeout=10000-60000 \ |
| 7816 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7817 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7818 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7819 | -s "found fragmented DTLS handshake message" \ |
| 7820 | -c "found fragmented DTLS handshake message" \ |
| 7821 | -C "error" |
| 7822 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7823 | not_with_valgrind # spurious autoreduction due to timeout |
| 7824 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7825 | requires_config_enabled MBEDTLS_RSA_C |
| 7826 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7827 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7828 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7832 | hs_timeout=10000-60000 \ |
| 7833 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7834 | "$P_CLI dtls=1 debug_level=2 \ |
| 7835 | crt_file=data_files/server8_int-ca2.crt \ |
| 7836 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7837 | hs_timeout=10000-60000 \ |
| 7838 | mtu=1024 nbio=2" \ |
| 7839 | 0 \ |
| 7840 | -S "autoreduction" \ |
| 7841 | -s "found fragmented DTLS handshake message" \ |
| 7842 | -c "found fragmented DTLS handshake message" \ |
| 7843 | -C "error" |
| 7844 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7845 | # 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] | 7846 | not_with_valgrind # spurious autoreduction due to timeout |
| 7847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7848 | requires_config_enabled MBEDTLS_RSA_C |
| 7849 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7851 | requires_config_enabled MBEDTLS_AES_C |
| 7852 | requires_config_enabled MBEDTLS_GCM_C |
| 7853 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7854 | -p "$P_PXY mtu=512" \ |
| 7855 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7856 | crt_file=data_files/server7_int-ca.crt \ |
| 7857 | key_file=data_files/server7.key \ |
| 7858 | hs_timeout=10000-60000 \ |
| 7859 | mtu=512 nbio=2" \ |
| 7860 | "$P_CLI dtls=1 debug_level=2 \ |
| 7861 | crt_file=data_files/server8_int-ca2.crt \ |
| 7862 | key_file=data_files/server8.key \ |
| 7863 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7864 | hs_timeout=10000-60000 \ |
| 7865 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7866 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7867 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7868 | -s "found fragmented DTLS handshake message" \ |
| 7869 | -c "found fragmented DTLS handshake message" \ |
| 7870 | -C "error" |
| 7871 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7872 | # 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] | 7873 | # This ensures things still work after session_reset(). |
| 7874 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7875 | # Since we don't support reading fragmented ClientHello yet, |
| 7876 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7877 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7878 | # An autoreduction on the client-side might happen if the server is |
| 7879 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7880 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7881 | # resumed listening, which would result in a spurious autoreduction. |
| 7882 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +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 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7886 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7887 | requires_config_enabled MBEDTLS_AES_C |
| 7888 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7889 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7890 | -p "$P_PXY mtu=1450" \ |
| 7891 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7892 | crt_file=data_files/server7_int-ca.crt \ |
| 7893 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7894 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7895 | mtu=1450" \ |
| 7896 | "$P_CLI dtls=1 debug_level=2 \ |
| 7897 | crt_file=data_files/server8_int-ca2.crt \ |
| 7898 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7899 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7900 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7901 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7902 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7903 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7904 | -s "found fragmented DTLS handshake message" \ |
| 7905 | -c "found fragmented DTLS handshake message" \ |
| 7906 | -C "error" |
| 7907 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7908 | # An autoreduction on the client-side might happen if the server is |
| 7909 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7910 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7911 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7912 | requires_config_enabled MBEDTLS_RSA_C |
| 7913 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7914 | requires_config_enabled MBEDTLS_SHA256_C |
| 7915 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7916 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7917 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7918 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7919 | -p "$P_PXY mtu=512" \ |
| 7920 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7921 | crt_file=data_files/server7_int-ca.crt \ |
| 7922 | key_file=data_files/server7.key \ |
| 7923 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7924 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7925 | mtu=512" \ |
| 7926 | "$P_CLI dtls=1 debug_level=2 \ |
| 7927 | crt_file=data_files/server8_int-ca2.crt \ |
| 7928 | key_file=data_files/server8.key \ |
| 7929 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7930 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7931 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7932 | mtu=512" \ |
| 7933 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7934 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7935 | -s "found fragmented DTLS handshake message" \ |
| 7936 | -c "found fragmented DTLS handshake message" \ |
| 7937 | -C "error" |
| 7938 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7939 | # An autoreduction on the client-side might happen if the server is |
| 7940 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7941 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7942 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7943 | requires_config_enabled MBEDTLS_RSA_C |
| 7944 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7945 | requires_config_enabled MBEDTLS_SHA256_C |
| 7946 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7947 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7948 | requires_config_enabled MBEDTLS_AES_C |
| 7949 | requires_config_enabled MBEDTLS_GCM_C |
| 7950 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7951 | -p "$P_PXY mtu=512" \ |
| 7952 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7953 | crt_file=data_files/server7_int-ca.crt \ |
| 7954 | key_file=data_files/server7.key \ |
| 7955 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7956 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7957 | mtu=512" \ |
| 7958 | "$P_CLI dtls=1 debug_level=2 \ |
| 7959 | crt_file=data_files/server8_int-ca2.crt \ |
| 7960 | key_file=data_files/server8.key \ |
| 7961 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7962 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7963 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7964 | mtu=512" \ |
| 7965 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7966 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7967 | -s "found fragmented DTLS handshake message" \ |
| 7968 | -c "found fragmented DTLS handshake message" \ |
| 7969 | -C "error" |
| 7970 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7971 | # An autoreduction on the client-side might happen if the server is |
| 7972 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7973 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7974 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7975 | requires_config_enabled MBEDTLS_RSA_C |
| 7976 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7977 | requires_config_enabled MBEDTLS_SHA256_C |
| 7978 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7979 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7980 | requires_config_enabled MBEDTLS_AES_C |
| 7981 | requires_config_enabled MBEDTLS_CCM_C |
| 7982 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7983 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7984 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7985 | crt_file=data_files/server7_int-ca.crt \ |
| 7986 | key_file=data_files/server7.key \ |
| 7987 | exchanges=2 renegotiation=1 \ |
| 7988 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7989 | hs_timeout=10000-60000 \ |
| 7990 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7991 | "$P_CLI dtls=1 debug_level=2 \ |
| 7992 | crt_file=data_files/server8_int-ca2.crt \ |
| 7993 | key_file=data_files/server8.key \ |
| 7994 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7995 | hs_timeout=10000-60000 \ |
| 7996 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7997 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7998 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7999 | -s "found fragmented DTLS handshake message" \ |
| 8000 | -c "found fragmented DTLS handshake message" \ |
| 8001 | -C "error" |
| 8002 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8003 | # An autoreduction on the client-side might happen if the server is |
| 8004 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8005 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8006 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8007 | requires_config_enabled MBEDTLS_RSA_C |
| 8008 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8009 | requires_config_enabled MBEDTLS_SHA256_C |
| 8010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8011 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8012 | requires_config_enabled MBEDTLS_AES_C |
| 8013 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8014 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8015 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8016 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8017 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8018 | crt_file=data_files/server7_int-ca.crt \ |
| 8019 | key_file=data_files/server7.key \ |
| 8020 | exchanges=2 renegotiation=1 \ |
| 8021 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8022 | hs_timeout=10000-60000 \ |
| 8023 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8024 | "$P_CLI dtls=1 debug_level=2 \ |
| 8025 | crt_file=data_files/server8_int-ca2.crt \ |
| 8026 | key_file=data_files/server8.key \ |
| 8027 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8028 | hs_timeout=10000-60000 \ |
| 8029 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8030 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8031 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8032 | -s "found fragmented DTLS handshake message" \ |
| 8033 | -c "found fragmented DTLS handshake message" \ |
| 8034 | -C "error" |
| 8035 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8036 | # An autoreduction on the client-side might happen if the server is |
| 8037 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8038 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8039 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8040 | requires_config_enabled MBEDTLS_RSA_C |
| 8041 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8042 | requires_config_enabled MBEDTLS_SHA256_C |
| 8043 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8045 | requires_config_enabled MBEDTLS_AES_C |
| 8046 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8047 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8048 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8049 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8050 | crt_file=data_files/server7_int-ca.crt \ |
| 8051 | key_file=data_files/server7.key \ |
| 8052 | exchanges=2 renegotiation=1 \ |
| 8053 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8054 | hs_timeout=10000-60000 \ |
| 8055 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8056 | "$P_CLI dtls=1 debug_level=2 \ |
| 8057 | crt_file=data_files/server8_int-ca2.crt \ |
| 8058 | key_file=data_files/server8.key \ |
| 8059 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8060 | hs_timeout=10000-60000 \ |
| 8061 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8062 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8063 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8064 | -s "found fragmented DTLS handshake message" \ |
| 8065 | -c "found fragmented DTLS handshake message" \ |
| 8066 | -C "error" |
| 8067 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8068 | # 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] | 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8070 | requires_config_enabled MBEDTLS_RSA_C |
| 8071 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8073 | requires_config_enabled MBEDTLS_AES_C |
| 8074 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8075 | client_needs_more_time 2 |
| 8076 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8077 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8078 | "$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] | 8079 | crt_file=data_files/server7_int-ca.crt \ |
| 8080 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8081 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8082 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8083 | crt_file=data_files/server8_int-ca2.crt \ |
| 8084 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8085 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8086 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8087 | 0 \ |
| 8088 | -s "found fragmented DTLS handshake message" \ |
| 8089 | -c "found fragmented DTLS handshake message" \ |
| 8090 | -C "error" |
| 8091 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8092 | # 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] | 8093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8094 | requires_config_enabled MBEDTLS_RSA_C |
| 8095 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8096 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8097 | requires_config_enabled MBEDTLS_AES_C |
| 8098 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8099 | client_needs_more_time 2 |
| 8100 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8101 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8102 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8103 | crt_file=data_files/server7_int-ca.crt \ |
| 8104 | key_file=data_files/server7.key \ |
| 8105 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8106 | "$P_CLI dtls=1 debug_level=2 \ |
| 8107 | crt_file=data_files/server8_int-ca2.crt \ |
| 8108 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8109 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8110 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8111 | 0 \ |
| 8112 | -s "found fragmented DTLS handshake message" \ |
| 8113 | -c "found fragmented DTLS handshake message" \ |
| 8114 | -C "error" |
| 8115 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8116 | # interop tests for DTLS fragmentating with reliable connection |
| 8117 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8118 | # here and below we just want to test that the we fragment in a way that |
| 8119 | # pleases other implementations, so we don't need the peer to fragment |
| 8120 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8121 | requires_config_enabled MBEDTLS_RSA_C |
| 8122 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8124 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8125 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8126 | "$G_SRV -u" \ |
| 8127 | "$P_CLI dtls=1 debug_level=2 \ |
| 8128 | crt_file=data_files/server8_int-ca2.crt \ |
| 8129 | key_file=data_files/server8.key \ |
| 8130 | mtu=512 force_version=dtls1_2" \ |
| 8131 | 0 \ |
| 8132 | -c "fragmenting handshake message" \ |
| 8133 | -C "error" |
| 8134 | |
| 8135 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8136 | requires_config_enabled MBEDTLS_RSA_C |
| 8137 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8138 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8139 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8140 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8141 | "$G_SRV -u" \ |
| 8142 | "$P_CLI dtls=1 debug_level=2 \ |
| 8143 | crt_file=data_files/server8_int-ca2.crt \ |
| 8144 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8145 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8146 | 0 \ |
| 8147 | -c "fragmenting handshake message" \ |
| 8148 | -C "error" |
| 8149 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8150 | # We use --insecure for the GnuTLS client because it expects |
| 8151 | # the hostname / IP it connects to to be the name used in the |
| 8152 | # certificate obtained from the server. Here, however, it |
| 8153 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8154 | # as the server name in the certificate. This will make the |
| 8155 | # certifiate validation fail, but passing --insecure makes |
| 8156 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8157 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8158 | requires_config_enabled MBEDTLS_RSA_C |
| 8159 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8160 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8161 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8162 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8163 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8164 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8165 | crt_file=data_files/server7_int-ca.crt \ |
| 8166 | key_file=data_files/server7.key \ |
| 8167 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8168 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8169 | 0 \ |
| 8170 | -s "fragmenting handshake message" |
| 8171 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8172 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 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 | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8177 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8178 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8179 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8180 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8181 | crt_file=data_files/server7_int-ca.crt \ |
| 8182 | key_file=data_files/server7.key \ |
| 8183 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8184 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8185 | 0 \ |
| 8186 | -s "fragmenting handshake message" |
| 8187 | |
| 8188 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8189 | requires_config_enabled MBEDTLS_RSA_C |
| 8190 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8191 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8192 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8193 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8194 | "$P_CLI dtls=1 debug_level=2 \ |
| 8195 | crt_file=data_files/server8_int-ca2.crt \ |
| 8196 | key_file=data_files/server8.key \ |
| 8197 | mtu=512 force_version=dtls1_2" \ |
| 8198 | 0 \ |
| 8199 | -c "fragmenting handshake message" \ |
| 8200 | -C "error" |
| 8201 | |
| 8202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8203 | requires_config_enabled MBEDTLS_RSA_C |
| 8204 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8205 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8206 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8207 | "$O_SRV -dtls1 -verify 10" \ |
| 8208 | "$P_CLI dtls=1 debug_level=2 \ |
| 8209 | crt_file=data_files/server8_int-ca2.crt \ |
| 8210 | key_file=data_files/server8.key \ |
| 8211 | mtu=512 force_version=dtls1" \ |
| 8212 | 0 \ |
| 8213 | -c "fragmenting handshake message" \ |
| 8214 | -C "error" |
| 8215 | |
| 8216 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8217 | requires_config_enabled MBEDTLS_RSA_C |
| 8218 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8219 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8220 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8221 | "$P_SRV dtls=1 debug_level=2 \ |
| 8222 | crt_file=data_files/server7_int-ca.crt \ |
| 8223 | key_file=data_files/server7.key \ |
| 8224 | mtu=512 force_version=dtls1_2" \ |
| 8225 | "$O_CLI -dtls1_2" \ |
| 8226 | 0 \ |
| 8227 | -s "fragmenting handshake message" |
| 8228 | |
| 8229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8230 | requires_config_enabled MBEDTLS_RSA_C |
| 8231 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8233 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8234 | "$P_SRV dtls=1 debug_level=2 \ |
| 8235 | crt_file=data_files/server7_int-ca.crt \ |
| 8236 | key_file=data_files/server7.key \ |
| 8237 | mtu=512 force_version=dtls1" \ |
| 8238 | "$O_CLI -dtls1" \ |
| 8239 | 0 \ |
| 8240 | -s "fragmenting handshake message" |
| 8241 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8242 | # interop tests for DTLS fragmentating with unreliable connection |
| 8243 | # |
| 8244 | # again we just want to test that the we fragment in a way that |
| 8245 | # pleases other implementations, so we don't need the peer to fragment |
| 8246 | requires_gnutls_next |
| 8247 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8248 | requires_config_enabled MBEDTLS_RSA_C |
| 8249 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8250 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8251 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8252 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8253 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8254 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8255 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8256 | crt_file=data_files/server8_int-ca2.crt \ |
| 8257 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8258 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8259 | 0 \ |
| 8260 | -c "fragmenting handshake message" \ |
| 8261 | -C "error" |
| 8262 | |
| 8263 | requires_gnutls_next |
| 8264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8265 | requires_config_enabled MBEDTLS_RSA_C |
| 8266 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8268 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8269 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8270 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8271 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8272 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8273 | crt_file=data_files/server8_int-ca2.crt \ |
| 8274 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8275 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8276 | 0 \ |
| 8277 | -c "fragmenting handshake message" \ |
| 8278 | -C "error" |
| 8279 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8280 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8281 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8282 | requires_config_enabled MBEDTLS_RSA_C |
| 8283 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8285 | client_needs_more_time 4 |
| 8286 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8287 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8288 | "$P_SRV dtls=1 debug_level=2 \ |
| 8289 | crt_file=data_files/server7_int-ca.crt \ |
| 8290 | key_file=data_files/server7.key \ |
| 8291 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8292 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8293 | 0 \ |
| 8294 | -s "fragmenting handshake message" |
| 8295 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8296 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8297 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8298 | requires_config_enabled MBEDTLS_RSA_C |
| 8299 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8301 | client_needs_more_time 4 |
| 8302 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8303 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8304 | "$P_SRV dtls=1 debug_level=2 \ |
| 8305 | crt_file=data_files/server7_int-ca.crt \ |
| 8306 | key_file=data_files/server7.key \ |
| 8307 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8308 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8309 | 0 \ |
| 8310 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8311 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8312 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8313 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8314 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8315 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8316 | ## (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] | 8317 | skip_next_test |
| 8318 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8319 | requires_config_enabled MBEDTLS_RSA_C |
| 8320 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8321 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8322 | client_needs_more_time 4 |
| 8323 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8324 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8325 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8326 | "$P_CLI dtls=1 debug_level=2 \ |
| 8327 | crt_file=data_files/server8_int-ca2.crt \ |
| 8328 | key_file=data_files/server8.key \ |
| 8329 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8330 | 0 \ |
| 8331 | -c "fragmenting handshake message" \ |
| 8332 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8333 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8334 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8335 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8336 | requires_config_enabled MBEDTLS_RSA_C |
| 8337 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8338 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8339 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8340 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8341 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8342 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8343 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8344 | crt_file=data_files/server8_int-ca2.crt \ |
| 8345 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8346 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8347 | 0 \ |
| 8348 | -c "fragmenting handshake message" \ |
| 8349 | -C "error" |
| 8350 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8351 | skip_next_test |
| 8352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8353 | requires_config_enabled MBEDTLS_RSA_C |
| 8354 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8356 | client_needs_more_time 4 |
| 8357 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8358 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8359 | "$P_SRV dtls=1 debug_level=2 \ |
| 8360 | crt_file=data_files/server7_int-ca.crt \ |
| 8361 | key_file=data_files/server7.key \ |
| 8362 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8363 | "$O_CLI -dtls1_2" \ |
| 8364 | 0 \ |
| 8365 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8366 | |
| 8367 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8368 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8369 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8370 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8371 | requires_config_enabled MBEDTLS_RSA_C |
| 8372 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8373 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8374 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8375 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8376 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8377 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8378 | crt_file=data_files/server7_int-ca.crt \ |
| 8379 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8380 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8381 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8382 | 0 \ |
| 8383 | -s "fragmenting handshake message" |
| 8384 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8385 | # Tests for specific things with "unreliable" UDP connection |
| 8386 | |
| 8387 | not_with_valgrind # spurious resend due to timeout |
| 8388 | run_test "DTLS proxy: reference" \ |
| 8389 | -p "$P_PXY" \ |
| 8390 | "$P_SRV dtls=1 debug_level=2" \ |
| 8391 | "$P_CLI dtls=1 debug_level=2" \ |
| 8392 | 0 \ |
| 8393 | -C "replayed record" \ |
| 8394 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8395 | -C "Buffer record from epoch" \ |
| 8396 | -S "Buffer record from epoch" \ |
| 8397 | -C "ssl_buffer_message" \ |
| 8398 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8399 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8400 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8401 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8402 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8403 | -c "HTTP/1.0 200 OK" |
| 8404 | |
| 8405 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8406 | run_test "DTLS proxy: duplicate every packet" \ |
| 8407 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8408 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8409 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8410 | 0 \ |
| 8411 | -c "replayed record" \ |
| 8412 | -s "replayed record" \ |
| 8413 | -c "record from another epoch" \ |
| 8414 | -s "record from another epoch" \ |
| 8415 | -S "resend" \ |
| 8416 | -s "Extra-header:" \ |
| 8417 | -c "HTTP/1.0 200 OK" |
| 8418 | |
| 8419 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8420 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8421 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8422 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8423 | 0 \ |
| 8424 | -c "replayed record" \ |
| 8425 | -S "replayed record" \ |
| 8426 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8427 | -s "record from another epoch" \ |
| 8428 | -c "resend" \ |
| 8429 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8430 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8431 | -c "HTTP/1.0 200 OK" |
| 8432 | |
| 8433 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8434 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8435 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8436 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8437 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8438 | -c "next record in same datagram" \ |
| 8439 | -s "next record in same datagram" |
| 8440 | |
| 8441 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8442 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8443 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8444 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8445 | 0 \ |
| 8446 | -c "next record in same datagram" \ |
| 8447 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8448 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8449 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8450 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8451 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8452 | "$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] | 8453 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8454 | -c "discarding invalid record (mac)" \ |
| 8455 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8456 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8457 | -c "HTTP/1.0 200 OK" \ |
| 8458 | -S "too many records with bad MAC" \ |
| 8459 | -S "Verification of the message MAC failed" |
| 8460 | |
| 8461 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8462 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8463 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8464 | "$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] | 8465 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8466 | -C "discarding invalid record (mac)" \ |
| 8467 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8468 | -S "Extra-header:" \ |
| 8469 | -C "HTTP/1.0 200 OK" \ |
| 8470 | -s "too many records with bad MAC" \ |
| 8471 | -s "Verification of the message MAC failed" |
| 8472 | |
| 8473 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8474 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8475 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8476 | "$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] | 8477 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8478 | -c "discarding invalid record (mac)" \ |
| 8479 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8480 | -s "Extra-header:" \ |
| 8481 | -c "HTTP/1.0 200 OK" \ |
| 8482 | -S "too many records with bad MAC" \ |
| 8483 | -S "Verification of the message MAC failed" |
| 8484 | |
| 8485 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8486 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8487 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8488 | "$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] | 8489 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8490 | -c "discarding invalid record (mac)" \ |
| 8491 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8492 | -s "Extra-header:" \ |
| 8493 | -c "HTTP/1.0 200 OK" \ |
| 8494 | -s "too many records with bad MAC" \ |
| 8495 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8496 | |
| 8497 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8498 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8499 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8500 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8501 | 0 \ |
| 8502 | -c "record from another epoch" \ |
| 8503 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8504 | -s "Extra-header:" \ |
| 8505 | -c "HTTP/1.0 200 OK" |
| 8506 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8507 | # Tests for reordering support with DTLS |
| 8508 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8509 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8510 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8511 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8512 | hs_timeout=2500-60000" \ |
| 8513 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8514 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8515 | 0 \ |
| 8516 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8517 | -c "Next handshake message has been buffered - load"\ |
| 8518 | -S "Buffering HS message" \ |
| 8519 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8520 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8521 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8522 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8523 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8524 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8525 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8526 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8527 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8528 | hs_timeout=2500-60000" \ |
| 8529 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8530 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8531 | 0 \ |
| 8532 | -c "Buffering HS message" \ |
| 8533 | -c "found fragmented DTLS handshake message"\ |
| 8534 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8535 | -c "Next handshake message has been buffered - load"\ |
| 8536 | -S "Buffering HS message" \ |
| 8537 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8538 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8539 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8540 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8541 | -S "Remember CCS message" |
| 8542 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8543 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8544 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8545 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8546 | # while keeping the ServerKeyExchange. |
| 8547 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8548 | 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] | 8549 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8550 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8551 | hs_timeout=2500-60000" \ |
| 8552 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8553 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8554 | 0 \ |
| 8555 | -c "Buffering HS message" \ |
| 8556 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8557 | -C "attempt to make space by freeing buffered messages" \ |
| 8558 | -S "Buffering HS message" \ |
| 8559 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8560 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8561 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8562 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8563 | -S "Remember CCS message" |
| 8564 | |
| 8565 | # The size constraints ensure that the delayed certificate message can't |
| 8566 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8567 | # when dropping it first. |
| 8568 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8569 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8570 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8571 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8572 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8573 | hs_timeout=2500-60000" \ |
| 8574 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8575 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8576 | 0 \ |
| 8577 | -c "Buffering HS message" \ |
| 8578 | -c "attempt to make space by freeing buffered future messages" \ |
| 8579 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8580 | -S "Buffering HS message" \ |
| 8581 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8582 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8583 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8584 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8585 | -S "Remember CCS message" |
| 8586 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8587 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8588 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8589 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8590 | hs_timeout=2500-60000" \ |
| 8591 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8592 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8593 | 0 \ |
| 8594 | -C "Buffering HS message" \ |
| 8595 | -C "Next handshake message has been buffered - load"\ |
| 8596 | -s "Buffering HS message" \ |
| 8597 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8598 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8599 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8600 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8601 | -S "Remember CCS message" |
| 8602 | |
| 8603 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8604 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8605 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8606 | hs_timeout=2500-60000" \ |
| 8607 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8608 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8609 | 0 \ |
| 8610 | -C "Buffering HS message" \ |
| 8611 | -C "Next handshake message has been buffered - load"\ |
| 8612 | -S "Buffering HS message" \ |
| 8613 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8614 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8615 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8616 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8617 | -S "Remember CCS message" |
| 8618 | |
| 8619 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8620 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8621 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8622 | hs_timeout=2500-60000" \ |
| 8623 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8624 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8625 | 0 \ |
| 8626 | -C "Buffering HS message" \ |
| 8627 | -C "Next handshake message has been buffered - load"\ |
| 8628 | -S "Buffering HS message" \ |
| 8629 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8630 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8631 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8632 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8633 | -s "Remember CCS message" |
| 8634 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8635 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8636 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8637 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8638 | hs_timeout=2500-60000" \ |
| 8639 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8640 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8641 | 0 \ |
| 8642 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8643 | -s "Found buffered record from current epoch - load" \ |
| 8644 | -c "Buffer record from epoch 1" \ |
| 8645 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8646 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8647 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8648 | # from the server are delayed, so that the encrypted Finished message |
| 8649 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8650 | # in afterwards, the encrypted Finished message must be freed in order |
| 8651 | # to make space for the NewSessionTicket to be reassembled. |
| 8652 | # This works only in very particular circumstances: |
| 8653 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8654 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8655 | # the encrypted Finished message. |
| 8656 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8657 | # needs to be fragmented. |
| 8658 | # - All messages sent by the server must be small enough to be either sent |
| 8659 | # without fragmentation or be reassembled within the bounds of |
| 8660 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8661 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8662 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8663 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8664 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8665 | -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] | 8666 | "$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] | 8667 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8668 | 0 \ |
| 8669 | -s "Buffer record from epoch 1" \ |
| 8670 | -s "Found buffered record from current epoch - load" \ |
| 8671 | -c "Buffer record from epoch 1" \ |
| 8672 | -C "Found buffered record from current epoch - load" \ |
| 8673 | -c "Enough space available after freeing future epoch record" |
| 8674 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8675 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8676 | |
| 8677 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8678 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8679 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8680 | "$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] | 8681 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8682 | "$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] | 8683 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8684 | 0 \ |
| 8685 | -s "Extra-header:" \ |
| 8686 | -c "HTTP/1.0 200 OK" |
| 8687 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8688 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8689 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8690 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8691 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8692 | "$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] | 8693 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8694 | 0 \ |
| 8695 | -s "Extra-header:" \ |
| 8696 | -c "HTTP/1.0 200 OK" |
| 8697 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8698 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8699 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8700 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8701 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8702 | "$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] | 8703 | 0 \ |
| 8704 | -s "Extra-header:" \ |
| 8705 | -c "HTTP/1.0 200 OK" |
| 8706 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8707 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8708 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8709 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8710 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8711 | "$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] | 8712 | 0 \ |
| 8713 | -s "Extra-header:" \ |
| 8714 | -c "HTTP/1.0 200 OK" |
| 8715 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8716 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8717 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8718 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8719 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8720 | "$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] | 8721 | 0 \ |
| 8722 | -s "Extra-header:" \ |
| 8723 | -c "HTTP/1.0 200 OK" |
| 8724 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8725 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8726 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8727 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8728 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8729 | "$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] | 8730 | 0 \ |
| 8731 | -s "Extra-header:" \ |
| 8732 | -c "HTTP/1.0 200 OK" |
| 8733 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8734 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8735 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8736 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8737 | "$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] | 8738 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8739 | "$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] | 8740 | 0 \ |
| 8741 | -s "Extra-header:" \ |
| 8742 | -c "HTTP/1.0 200 OK" |
| 8743 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8744 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8745 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8746 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8747 | "$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] | 8748 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8749 | "$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] | 8750 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8751 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8752 | 0 \ |
| 8753 | -s "a session has been resumed" \ |
| 8754 | -c "a session has been resumed" \ |
| 8755 | -s "Extra-header:" \ |
| 8756 | -c "HTTP/1.0 200 OK" |
| 8757 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8758 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8759 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8760 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8761 | "$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] | 8762 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8763 | "$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] | 8764 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8765 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8766 | 0 \ |
| 8767 | -s "a session has been resumed" \ |
| 8768 | -c "a session has been resumed" \ |
| 8769 | -s "Extra-header:" \ |
| 8770 | -c "HTTP/1.0 200 OK" |
| 8771 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8772 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8774 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8775 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8776 | "$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] | 8777 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8778 | "$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] | 8779 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8780 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8781 | 0 \ |
| 8782 | -c "=> renegotiate" \ |
| 8783 | -s "=> renegotiate" \ |
| 8784 | -s "Extra-header:" \ |
| 8785 | -c "HTTP/1.0 200 OK" |
| 8786 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8787 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8789 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8790 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8791 | "$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] | 8792 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8793 | "$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] | 8794 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8795 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8796 | 0 \ |
| 8797 | -c "=> renegotiate" \ |
| 8798 | -s "=> renegotiate" \ |
| 8799 | -s "Extra-header:" \ |
| 8800 | -c "HTTP/1.0 200 OK" |
| 8801 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8802 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8803 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8804 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8805 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8806 | "$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] | 8807 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8808 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8809 | "$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] | 8810 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8811 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8812 | 0 \ |
| 8813 | -c "=> renegotiate" \ |
| 8814 | -s "=> renegotiate" \ |
| 8815 | -s "Extra-header:" \ |
| 8816 | -c "HTTP/1.0 200 OK" |
| 8817 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8818 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8820 | 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] | 8821 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8822 | "$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] | 8823 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8824 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8825 | "$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] | 8826 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8827 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8828 | 0 \ |
| 8829 | -c "=> renegotiate" \ |
| 8830 | -s "=> renegotiate" \ |
| 8831 | -s "Extra-header:" \ |
| 8832 | -c "HTTP/1.0 200 OK" |
| 8833 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8834 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8835 | ## all versions installed on the CI machines), reported here: |
| 8836 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8837 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8838 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8839 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8840 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8841 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8842 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8843 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8844 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8845 | "$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] | 8846 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8847 | -c "HTTP/1.0 200 OK" |
| 8848 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8849 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8850 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8851 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8852 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8853 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8854 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8855 | "$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] | 8856 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8857 | -c "HTTP/1.0 200 OK" |
| 8858 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8859 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8860 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8861 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8862 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8863 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8864 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8865 | "$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] | 8866 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8867 | -c "HTTP/1.0 200 OK" |
| 8868 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8869 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8870 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8871 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8872 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8873 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8874 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8875 | "$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] | 8876 | 0 \ |
| 8877 | -s "Extra-header:" \ |
| 8878 | -c "Extra-header:" |
| 8879 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8880 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8881 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8882 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8883 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8884 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8885 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8886 | "$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] | 8887 | 0 \ |
| 8888 | -s "Extra-header:" \ |
| 8889 | -c "Extra-header:" |
| 8890 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8891 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8892 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8893 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8894 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8895 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8896 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8897 | "$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] | 8898 | 0 \ |
| 8899 | -s "Extra-header:" \ |
| 8900 | -c "Extra-header:" |
| 8901 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8902 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8903 | run_test "export keys functionality" \ |
| 8904 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8905 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8906 | 0 \ |
| 8907 | -s "exported maclen is " \ |
| 8908 | -s "exported keylen is " \ |
| 8909 | -s "exported ivlen is " \ |
| 8910 | -c "exported maclen is " \ |
| 8911 | -c "exported keylen is " \ |
| 8912 | -c "exported ivlen is " |
| 8913 | |
Piotr Nowicki | 195a8f7 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8914 | # Test heap memory usage after handshake |
| 8915 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8916 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8917 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 8918 | run_tests_memory_after_hanshake |
| 8919 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8920 | # Final report |
| 8921 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8922 | echo "------------------------------------------------------------------------" |
| 8923 | |
| 8924 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8925 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8926 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8927 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8928 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8929 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8930 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8931 | |
| 8932 | exit $FAILS |