| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved | 
|  | 8 | # | 
|  | 9 | # Purpose | 
|  | 10 | # | 
|  | 11 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 12 | # | 
|  | 13 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 14 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 15 | # (session resumption from cache or ticket, renego, etc). | 
|  | 16 | # | 
|  | 17 | # The tests assume a build with default options, with exceptions expressed | 
|  | 18 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 19 | # performance. | 
|  | 20 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u | 
|  | 23 |  | 
| Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 24 | # Limit the size of each log to 10 GiB, in case of failures with this script | 
|  | 25 | # where it may output seemingly unlimited length error logs. | 
|  | 26 | ulimit -f 20971520 | 
|  | 27 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 28 | ORIGINAL_PWD=$PWD | 
|  | 29 | if ! cd "$(dirname "$0")"; then | 
|  | 30 | exit 125 | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 31 | fi | 
|  | 32 |  | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 33 | # default values, can be overridden by the environment | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 34 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 35 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 36 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 37 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 39 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 42 | guess_config_name() { | 
|  | 43 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then | 
|  | 44 | echo "default" | 
|  | 45 | else | 
|  | 46 | echo "unknown" | 
|  | 47 | fi | 
|  | 48 | } | 
|  | 49 | : ${MBEDTLS_TEST_OUTCOME_FILE=} | 
|  | 50 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} | 
|  | 51 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} | 
|  | 52 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 53 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 54 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 55 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 56 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 57 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 58 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 59 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 60 |  | 
|  | 61 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 62 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 63 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 64 | else | 
|  | 65 | O_LEGACY_SRV=false | 
|  | 66 | O_LEGACY_CLI=false | 
|  | 67 | fi | 
|  | 68 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 69 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
|  | 71 | else | 
|  | 72 | G_NEXT_SRV=false | 
|  | 73 | fi | 
|  | 74 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 75 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 76 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
|  | 77 | else | 
|  | 78 | G_NEXT_CLI=false | 
|  | 79 | fi | 
|  | 80 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 81 | TESTS=0 | 
|  | 82 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 83 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 84 |  | 
| Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 85 | CONFIG_H='../include/mbedtls/config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 86 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 88 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 89 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 90 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 91 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 92 | RUN_TEST_NUMBER='' | 
|  | 93 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 94 | PRESERVE_LOGS=0 | 
|  | 95 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 97 | # port which is this plus 10000. Each port number may be independently | 
|  | 98 | # overridden by a command line option. | 
|  | 99 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 100 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 101 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 102 | print_usage() { | 
|  | 103 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 104 | printf "  -h|--help\tPrint this help.\n" | 
|  | 105 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 106 | printf "  -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" | 
|  | 107 | printf "  -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 108 | printf "  -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 109 | printf "  -s|--show-numbers\tShow test numbers in front of test names\n" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 110 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 111 | printf "     --outcome-file\tFile where test outcomes are written\n" | 
|  | 112 | printf "                \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" | 
|  | 113 | printf "     --port     \tTCP/UDP port (default: randomish 1xxxx)\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 114 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 115 | printf "     --seed     \tInteger seed value to use for this test run\n" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 116 | } | 
|  | 117 |  | 
|  | 118 | get_options() { | 
|  | 119 | while [ $# -gt 0 ]; do | 
|  | 120 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 121 | -f|--filter) | 
|  | 122 | shift; FILTER=$1 | 
|  | 123 | ;; | 
|  | 124 | -e|--exclude) | 
|  | 125 | shift; EXCLUDE=$1 | 
|  | 126 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 127 | -m|--memcheck) | 
|  | 128 | MEMCHECK=1 | 
|  | 129 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 130 | -n|--number) | 
|  | 131 | shift; RUN_TEST_NUMBER=$1 | 
|  | 132 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | -s|--show-numbers) | 
|  | 134 | SHOW_TEST_NUMBER=1 | 
|  | 135 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 136 | -p|--preserve-logs) | 
|  | 137 | PRESERVE_LOGS=1 | 
|  | 138 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 139 | --port) | 
|  | 140 | shift; SRV_PORT=$1 | 
|  | 141 | ;; | 
|  | 142 | --proxy-port) | 
|  | 143 | shift; PXY_PORT=$1 | 
|  | 144 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 145 | --seed) | 
|  | 146 | shift; SEED="$1" | 
|  | 147 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 148 | -h|--help) | 
|  | 149 | print_usage | 
|  | 150 | exit 0 | 
|  | 151 | ;; | 
|  | 152 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 153 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 154 | print_usage | 
|  | 155 | exit 1 | 
|  | 156 | ;; | 
|  | 157 | esac | 
|  | 158 | shift | 
|  | 159 | done | 
|  | 160 | } | 
|  | 161 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 162 | # Make the outcome file path relative to the original directory, not | 
|  | 163 | # to .../tests | 
|  | 164 | case "$MBEDTLS_TEST_OUTCOME_FILE" in | 
|  | 165 | [!/]*) | 
|  | 166 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 167 | ;; | 
|  | 168 | esac | 
|  | 169 |  | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 170 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 171 | # in theory and expected to be re-introduced at some point, but | 
|  | 172 | # aren't expected to succeed at the moment due to problems outside | 
|  | 173 | # our control (such as bugs in other TLS implementations). | 
|  | 174 | skip_next_test() { | 
|  | 175 | SKIP_NEXT="YES" | 
|  | 176 | } | 
|  | 177 |  | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 178 | # skip next test if the flag is not enabled in config.h | 
|  | 179 | requires_config_enabled() { | 
|  | 180 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else | 
|  | 181 | SKIP_NEXT="YES" | 
|  | 182 | fi | 
|  | 183 | } | 
|  | 184 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 185 | # skip next test if the flag is enabled in config.h | 
|  | 186 | requires_config_disabled() { | 
|  | 187 | if grep "^#define $1" $CONFIG_H > /dev/null; then | 
|  | 188 | SKIP_NEXT="YES" | 
|  | 189 | fi | 
|  | 190 | } | 
|  | 191 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 192 | get_config_value_or_default() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 193 | # This function uses the query_config command line option to query the | 
|  | 194 | # required Mbed TLS compile time configuration from the ssl_server2 | 
|  | 195 | # program. The command will always return a success value if the | 
|  | 196 | # configuration is defined and the value will be printed to stdout. | 
|  | 197 | # | 
|  | 198 | # Note that if the configuration is not defined or is defined to nothing, | 
|  | 199 | # the output of this function will be an empty string. | 
|  | 200 | ${P_SRV} "query_config=${1}" | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 201 | } | 
|  | 202 |  | 
|  | 203 | requires_config_value_at_least() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 204 | VAL="$( get_config_value_or_default "$1" )" | 
|  | 205 | if [ -z "$VAL" ]; then | 
|  | 206 | # Should never happen | 
|  | 207 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 208 | exit 1 | 
|  | 209 | elif [ "$VAL" -lt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 210 | SKIP_NEXT="YES" | 
|  | 211 | fi | 
|  | 212 | } | 
|  | 213 |  | 
|  | 214 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 215 | VAL=$( get_config_value_or_default "$1" ) | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 216 | if [ -z "$VAL" ]; then | 
|  | 217 | # Should never happen | 
|  | 218 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 219 | exit 1 | 
|  | 220 | elif [ "$VAL" -gt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 221 | SKIP_NEXT="YES" | 
|  | 222 | fi | 
|  | 223 | } | 
|  | 224 |  | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 225 | requires_ciphersuite_enabled() { | 
| Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 226 | if [ -z "$($P_CLI --help | grep $1)" ]; then | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 227 | SKIP_NEXT="YES" | 
|  | 228 | fi | 
|  | 229 | } | 
|  | 230 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 231 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 232 | requires_openssl_with_fallback_scsv() { | 
|  | 233 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 234 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 235 | then | 
|  | 236 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 237 | else | 
|  | 238 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 239 | fi | 
|  | 240 | fi | 
|  | 241 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 242 | SKIP_NEXT="YES" | 
|  | 243 | fi | 
|  | 244 | } | 
|  | 245 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 246 | # skip next test if GnuTLS isn't available | 
|  | 247 | requires_gnutls() { | 
|  | 248 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 249 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 250 | GNUTLS_AVAILABLE="YES" | 
|  | 251 | else | 
|  | 252 | GNUTLS_AVAILABLE="NO" | 
|  | 253 | fi | 
|  | 254 | fi | 
|  | 255 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 256 | SKIP_NEXT="YES" | 
|  | 257 | fi | 
|  | 258 | } | 
|  | 259 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 260 | # skip next test if GnuTLS-next isn't available | 
|  | 261 | requires_gnutls_next() { | 
|  | 262 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 263 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 264 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 265 | else | 
|  | 266 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 267 | fi | 
|  | 268 | fi | 
|  | 269 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 270 | SKIP_NEXT="YES" | 
|  | 271 | fi | 
|  | 272 | } | 
|  | 273 |  | 
|  | 274 | # skip next test if OpenSSL-legacy isn't available | 
|  | 275 | requires_openssl_legacy() { | 
|  | 276 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 277 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 278 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 279 | else | 
|  | 280 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 281 | fi | 
|  | 282 | fi | 
|  | 283 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 284 | SKIP_NEXT="YES" | 
|  | 285 | fi | 
|  | 286 | } | 
|  | 287 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 288 | # skip next test if IPv6 isn't available on this host | 
|  | 289 | requires_ipv6() { | 
|  | 290 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 291 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 292 | SRV_PID=$! | 
|  | 293 | sleep 1 | 
|  | 294 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 295 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 296 | HAS_IPV6="NO" | 
|  | 297 | else | 
|  | 298 | HAS_IPV6="YES" | 
|  | 299 | fi | 
|  | 300 | rm -r $SRV_OUT | 
|  | 301 | fi | 
|  | 302 |  | 
|  | 303 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 304 | SKIP_NEXT="YES" | 
|  | 305 | fi | 
|  | 306 | } | 
|  | 307 |  | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 308 | # skip next test if it's i686 or uname is not available | 
|  | 309 | requires_not_i686() { | 
|  | 310 | if [ -z "${IS_I686:-}" ]; then | 
|  | 311 | IS_I686="YES" | 
|  | 312 | if which "uname" >/dev/null 2>&1; then | 
|  | 313 | if [ -z "$(uname -a | grep i686)" ]; then | 
|  | 314 | IS_I686="NO" | 
|  | 315 | fi | 
|  | 316 | fi | 
|  | 317 | fi | 
|  | 318 | if [ "$IS_I686" = "YES" ]; then | 
|  | 319 | SKIP_NEXT="YES" | 
|  | 320 | fi | 
|  | 321 | } | 
|  | 322 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 323 | # Calculate the input & output maximum content lengths set in the config | 
| Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 324 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") | 
|  | 325 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
|  | 326 | MAX_OUT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 327 |  | 
|  | 328 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 329 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 330 | fi | 
|  | 331 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 332 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 333 | fi | 
|  | 334 |  | 
|  | 335 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 336 | requires_full_size_output_buffer() { | 
|  | 337 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 338 | SKIP_NEXT="YES" | 
|  | 339 | fi | 
|  | 340 | } | 
|  | 341 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 342 | # skip the next test if valgrind is in use | 
|  | 343 | not_with_valgrind() { | 
|  | 344 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 345 | SKIP_NEXT="YES" | 
|  | 346 | fi | 
|  | 347 | } | 
|  | 348 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 349 | # skip the next test if valgrind is NOT in use | 
|  | 350 | only_with_valgrind() { | 
|  | 351 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 352 | SKIP_NEXT="YES" | 
|  | 353 | fi | 
|  | 354 | } | 
|  | 355 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 356 | # multiply the client timeout delay by the given factor for the next test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 357 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 358 | CLI_DELAY_FACTOR=$1 | 
|  | 359 | } | 
|  | 360 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 361 | # wait for the given seconds after the client finished in the next test | 
|  | 362 | server_needs_more_time() { | 
|  | 363 | SRV_DELAY_SECONDS=$1 | 
|  | 364 | } | 
|  | 365 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 366 | # print_name <name> | 
|  | 367 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 368 | TESTS=$(( $TESTS + 1 )) | 
|  | 369 | LINE="" | 
|  | 370 |  | 
|  | 371 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 372 | LINE="$TESTS " | 
|  | 373 | fi | 
|  | 374 |  | 
|  | 375 | LINE="$LINE$1" | 
|  | 376 | printf "$LINE " | 
|  | 377 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 378 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 379 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 380 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 381 | } | 
|  | 382 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 383 | # record_outcome <outcome> [<failure-reason>] | 
|  | 384 | # The test name must be in $NAME. | 
|  | 385 | record_outcome() { | 
|  | 386 | echo "$1" | 
|  | 387 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then | 
|  | 388 | printf '%s;%s;%s;%s;%s;%s\n' \ | 
|  | 389 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ | 
|  | 390 | "ssl-opt" "$NAME" \ | 
|  | 391 | "$1" "${2-}" \ | 
|  | 392 | >>"$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 393 | fi | 
|  | 394 | } | 
|  | 395 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 396 | # fail <message> | 
|  | 397 | fail() { | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 398 | record_outcome "FAIL" "$1" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 399 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 400 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 401 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 402 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 403 | if [ -n "$PXY_CMD" ]; then | 
|  | 404 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 405 | fi | 
|  | 406 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 407 |  | 
| Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 408 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 409 | echo "  ! server output:" | 
|  | 410 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 411 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 412 | echo "  ! client output:" | 
|  | 413 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 414 | if [ -n "$PXY_CMD" ]; then | 
|  | 415 | echo "  ! ========================================================" | 
|  | 416 | echo "  ! proxy output:" | 
|  | 417 | cat o-pxy-${TESTS}.log | 
|  | 418 | fi | 
|  | 419 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 420 | fi | 
|  | 421 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 422 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 423 | } | 
|  | 424 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 425 | # is_polar <cmd_line> | 
|  | 426 | is_polar() { | 
|  | 427 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null | 
|  | 428 | } | 
|  | 429 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 430 | # openssl s_server doesn't have -www with DTLS | 
|  | 431 | check_osrv_dtls() { | 
|  | 432 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then | 
|  | 433 | NEEDS_INPUT=1 | 
|  | 434 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" | 
|  | 435 | else | 
|  | 436 | NEEDS_INPUT=0 | 
|  | 437 | fi | 
|  | 438 | } | 
|  | 439 |  | 
|  | 440 | # provide input to commands that need it | 
|  | 441 | provide_input() { | 
|  | 442 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 443 | return | 
|  | 444 | fi | 
|  | 445 |  | 
|  | 446 | while true; do | 
|  | 447 | echo "HTTP/1.0 200 OK" | 
|  | 448 | sleep 1 | 
|  | 449 | done | 
|  | 450 | } | 
|  | 451 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 452 | # has_mem_err <log_file_name> | 
|  | 453 | has_mem_err() { | 
|  | 454 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 455 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 456 | then | 
|  | 457 | return 1 # false: does not have errors | 
|  | 458 | else | 
|  | 459 | return 0 # true: has errors | 
|  | 460 | fi | 
|  | 461 | } | 
|  | 462 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 463 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 464 | if type lsof >/dev/null 2>/dev/null; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 465 | wait_app_start() { | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 466 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 467 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 468 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 469 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 470 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 471 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 472 | # Make a tight loop, server normally takes less than 1s to start. | 
|  | 473 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do | 
|  | 474 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 475 | echo "$3 START TIMEOUT" | 
|  | 476 | echo "$3 START TIMEOUT" >> $4 | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 477 | break | 
|  | 478 | fi | 
|  | 479 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 480 | # OSes this may be a tight loop. | 
|  | 481 | sleep 0.1 2>/dev/null || true | 
|  | 482 | done | 
|  | 483 | } | 
|  | 484 | else | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 485 | echo "Warning: lsof not available, wait_app_start = sleep" | 
|  | 486 | wait_app_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 487 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 488 | } | 
|  | 489 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 490 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 491 | # Wait for server process $2 to be listening on port $1. | 
|  | 492 | wait_server_start() { | 
|  | 493 | wait_app_start $1 $2 "SERVER" $SRV_OUT | 
|  | 494 | } | 
|  | 495 |  | 
|  | 496 | # Wait for proxy process $2 to be listening on port $1. | 
|  | 497 | wait_proxy_start() { | 
|  | 498 | wait_app_start $1 $2 "PROXY" $PXY_OUT | 
|  | 499 | } | 
|  | 500 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 501 | # Given the client or server debug output, parse the unix timestamp that is | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 502 | # included in the first 4 bytes of the random bytes and check that it's within | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 503 | # acceptable bounds | 
|  | 504 | check_server_hello_time() { | 
|  | 505 | # Extract the time from the debug (lvl 3) output of the client | 
| Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 506 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 507 | # Get the Unix timestamp for now | 
|  | 508 | CUR_TIME=$(date +'%s') | 
|  | 509 | THRESHOLD_IN_SECS=300 | 
|  | 510 |  | 
|  | 511 | # Check if the ServerHello time was printed | 
|  | 512 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 513 | return 1 | 
|  | 514 | fi | 
|  | 515 |  | 
|  | 516 | # Check the time in ServerHello is within acceptable bounds | 
|  | 517 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 518 | # The time in ServerHello is at least 5 minutes before now | 
|  | 519 | return 1 | 
|  | 520 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 521 | # The time in ServerHello is at least 5 minutes later than now | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 522 | return 1 | 
|  | 523 | else | 
|  | 524 | return 0 | 
|  | 525 | fi | 
|  | 526 | } | 
|  | 527 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 528 | # wait for client to terminate and set CLI_EXIT | 
|  | 529 | # must be called right after starting the client | 
|  | 530 | wait_client_done() { | 
|  | 531 | CLI_PID=$! | 
|  | 532 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 533 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 534 | CLI_DELAY_FACTOR=1 | 
|  | 535 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 536 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 537 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 538 |  | 
|  | 539 | wait $CLI_PID | 
|  | 540 | CLI_EXIT=$? | 
|  | 541 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 542 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 543 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 544 |  | 
|  | 545 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 546 |  | 
|  | 547 | sleep $SRV_DELAY_SECONDS | 
|  | 548 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 549 | } | 
|  | 550 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 551 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 552 | detect_dtls() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 553 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 554 | DTLS=1 | 
|  | 555 | else | 
|  | 556 | DTLS=0 | 
|  | 557 | fi | 
|  | 558 | } | 
|  | 559 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 560 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 561 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 562 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 563 | #           -u pattern  lines after pattern must be unique in client output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 564 | #           -f call shell function on client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 565 | #           -S pattern  pattern that must be absent in server output | 
|  | 566 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 567 | #           -U pattern  lines after pattern must be unique in server output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 568 | #           -F call shell function on server output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 569 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 570 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 571 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 572 |  | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 573 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : | 
|  | 574 | else | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 575 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 576 | # There was no request to run the test, so don't record its outcome. | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 577 | return | 
|  | 578 | fi | 
|  | 579 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 580 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 581 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 582 | # Do we only run numbered tests? | 
|  | 583 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : | 
|  | 584 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : | 
|  | 585 | else | 
|  | 586 | SKIP_NEXT="YES" | 
|  | 587 | fi | 
|  | 588 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 589 | # does this test use a proxy? | 
|  | 590 | if [ "X$1" = "X-p" ]; then | 
|  | 591 | PXY_CMD="$2" | 
|  | 592 | shift 2 | 
|  | 593 | else | 
|  | 594 | PXY_CMD="" | 
|  | 595 | fi | 
|  | 596 |  | 
|  | 597 | # get commands and client output | 
|  | 598 | SRV_CMD="$1" | 
|  | 599 | CLI_CMD="$2" | 
|  | 600 | CLI_EXPECT="$3" | 
|  | 601 | shift 3 | 
|  | 602 |  | 
| Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 603 | # Check if test uses files | 
|  | 604 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) | 
|  | 605 | if [ ! -z "$TEST_USES_FILES" ]; then | 
|  | 606 | requires_config_enabled MBEDTLS_FS_IO | 
|  | 607 | fi | 
|  | 608 |  | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 609 | # Check if server forces ciphersuite | 
|  | 610 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') | 
|  | 611 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then | 
|  | 612 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE | 
|  | 613 | fi | 
|  | 614 |  | 
|  | 615 | # Check if client forces ciphersuite | 
|  | 616 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') | 
|  | 617 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then | 
|  | 618 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE | 
|  | 619 | fi | 
|  | 620 |  | 
|  | 621 | # should we skip? | 
|  | 622 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 623 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 624 | record_outcome "SKIP" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 625 | SKIPS=$(( $SKIPS + 1 )) | 
|  | 626 | return | 
|  | 627 | fi | 
|  | 628 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 629 | # fix client port | 
|  | 630 | if [ -n "$PXY_CMD" ]; then | 
|  | 631 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 632 | else | 
|  | 633 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 634 | fi | 
|  | 635 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 636 | # update DTLS variable | 
|  | 637 | detect_dtls "$SRV_CMD" | 
|  | 638 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 639 | # prepend valgrind to our commands if active | 
|  | 640 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 641 | if is_polar "$SRV_CMD"; then | 
|  | 642 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 643 | fi | 
|  | 644 | if is_polar "$CLI_CMD"; then | 
|  | 645 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 646 | fi | 
|  | 647 | fi | 
|  | 648 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 649 | TIMES_LEFT=2 | 
|  | 650 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 651 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 652 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 653 | # run the commands | 
|  | 654 | if [ -n "$PXY_CMD" ]; then | 
|  | 655 | echo "$PXY_CMD" > $PXY_OUT | 
|  | 656 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 657 | PXY_PID=$! | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 658 | wait_proxy_start "$PXY_PORT" "$PXY_PID" | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 659 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 660 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 661 | check_osrv_dtls | 
|  | 662 | echo "$SRV_CMD" > $SRV_OUT | 
|  | 663 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 664 | SRV_PID=$! | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 665 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 666 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 667 | echo "$CLI_CMD" > $CLI_OUT | 
|  | 668 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 669 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 670 |  | 
| Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 671 | sleep 0.05 | 
|  | 672 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 673 | # terminate the server (and the proxy) | 
|  | 674 | kill $SRV_PID | 
|  | 675 | wait $SRV_PID | 
| Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 676 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 677 | if [ -n "$PXY_CMD" ]; then | 
|  | 678 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 679 | wait $PXY_PID | 
|  | 680 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 681 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 682 | # retry only on timeouts | 
|  | 683 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 684 | printf "RETRY " | 
|  | 685 | else | 
|  | 686 | TIMES_LEFT=0 | 
|  | 687 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 688 | done | 
|  | 689 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 690 | # check if the client and server went at least to the handshake stage | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 691 | # (useful to avoid tests with only negative assertions and non-zero | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 692 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 693 | # failure) | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 694 | if is_polar "$SRV_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 695 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 696 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 697 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 698 | return | 
|  | 699 | fi | 
|  | 700 | fi | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 701 | if is_polar "$CLI_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 702 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 703 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 704 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 705 | return | 
|  | 706 | fi | 
|  | 707 | fi | 
|  | 708 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 709 | # check server exit code | 
|  | 710 | if [ $? != 0 ]; then | 
|  | 711 | fail "server fail" | 
|  | 712 | return | 
|  | 713 | fi | 
|  | 714 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 715 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 716 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 717 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 718 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 719 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 720 | return | 
|  | 721 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 722 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 723 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 724 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 725 | # lines with 'Serious error when reading debug info', are valgrind issues as well | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 726 | while [ $# -gt 0 ] | 
|  | 727 | do | 
|  | 728 | case $1 in | 
|  | 729 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 730 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 731 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 732 | return | 
|  | 733 | fi | 
|  | 734 | ;; | 
|  | 735 |  | 
|  | 736 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 737 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 738 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 739 | return | 
|  | 740 | fi | 
|  | 741 | ;; | 
|  | 742 |  | 
|  | 743 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 744 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 745 | fail "pattern '$2' MUST NOT be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 746 | return | 
|  | 747 | fi | 
|  | 748 | ;; | 
|  | 749 |  | 
|  | 750 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 751 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 752 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 753 | return | 
|  | 754 | fi | 
|  | 755 | ;; | 
|  | 756 |  | 
|  | 757 | # The filtering in the following two options (-u and -U) do the following | 
|  | 758 | #   - ignore valgrind output | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 759 | #   - filter out everything but lines right after the pattern occurrences | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 760 | #   - keep one of each non-unique line | 
|  | 761 | #   - count how many lines remain | 
|  | 762 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 763 | # if there were no duplicates. | 
|  | 764 | "-U") | 
|  | 765 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then | 
|  | 766 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 767 | return | 
|  | 768 | fi | 
|  | 769 | ;; | 
|  | 770 |  | 
|  | 771 | "-u") | 
|  | 772 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then | 
|  | 773 | fail "lines following pattern '$2' must be unique in Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 774 | return | 
|  | 775 | fi | 
|  | 776 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 777 | "-F") | 
|  | 778 | if ! $2 "$SRV_OUT"; then | 
|  | 779 | fail "function call to '$2' failed on Server output" | 
|  | 780 | return | 
|  | 781 | fi | 
|  | 782 | ;; | 
|  | 783 | "-f") | 
|  | 784 | if ! $2 "$CLI_OUT"; then | 
|  | 785 | fail "function call to '$2' failed on Client output" | 
|  | 786 | return | 
|  | 787 | fi | 
|  | 788 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 789 |  | 
|  | 790 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 791 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 792 | exit 1 | 
|  | 793 | esac | 
|  | 794 | shift 2 | 
|  | 795 | done | 
|  | 796 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 797 | # check valgrind's results | 
|  | 798 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 799 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 800 | fail "Server has memory errors" | 
|  | 801 | return | 
|  | 802 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 803 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 804 | fail "Client has memory errors" | 
|  | 805 | return | 
|  | 806 | fi | 
|  | 807 | fi | 
|  | 808 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 809 | # if we're here, everything is ok | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 810 | record_outcome "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 811 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 812 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 813 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 814 | if [ -n "$PXY_CMD" ]; then | 
|  | 815 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 816 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 817 | fi | 
|  | 818 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 819 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 820 | } | 
|  | 821 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 822 | run_test_psa() { | 
|  | 823 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 824 | run_test    "PSA-supported ciphersuite: $1" \ | 
| Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 825 | "$P_SRV debug_level=3 force_version=tls1_2" \ | 
|  | 826 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 827 | 0 \ | 
|  | 828 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 829 | -c "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 830 | -c "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 831 | -c "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 832 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 833 | -s "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 834 | -s "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 835 | -s "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 836 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 837 | -S "Failed to setup PSA-based cipher context"\ | 
|  | 838 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 839 | -c "Perform PSA-based ECDH computation."\ | 
| Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 840 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 841 | -S "error" \ | 
|  | 842 | -C "error" | 
|  | 843 | } | 
|  | 844 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 845 | run_test_psa_force_curve() { | 
|  | 846 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 847 | run_test    "PSA - ECDH with $1" \ | 
|  | 848 | "$P_SRV debug_level=4 force_version=tls1_2" \ | 
|  | 849 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ | 
|  | 850 | 0 \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 851 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 852 | -c "Successfully setup PSA-based encryption cipher context" \ | 
|  | 853 | -c "PSA calc verify" \ | 
|  | 854 | -c "calc PSA finished" \ | 
|  | 855 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 856 | -s "Successfully setup PSA-based encryption cipher context" \ | 
|  | 857 | -s "PSA calc verify" \ | 
|  | 858 | -s "calc PSA finished" \ | 
|  | 859 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 860 | -S "Failed to setup PSA-based cipher context"\ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 861 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 862 | -c "Perform PSA-based ECDH computation."\ | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 863 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 864 | -S "error" \ | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 865 | -C "error" | 
|  | 866 | } | 
|  | 867 |  | 
|  | 868 | cleanup() { | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 869 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
|  | 870 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 871 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 872 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 873 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 | 
|  | 874 | exit 1 | 
|  | 875 | } | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 876 |  | 
|  | 877 | # | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 878 | # MAIN | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 879 | # | 
|  | 880 |  | 
|  | 881 | get_options "$@" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 882 |  | 
|  | 883 | # sanity checks, avoid an avalanche of errors | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 884 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 885 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 886 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
|  | 887 | if [ ! -x "$P_SRV_BIN" ]; then | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 888 | echo "Command '$P_SRV_BIN' is not an executable file" | 
|  | 889 | exit 1 | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 890 | fi | 
|  | 891 | if [ ! -x "$P_CLI_BIN" ]; then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 892 | echo "Command '$P_CLI_BIN' is not an executable file" | 
|  | 893 | exit 1 | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 894 | fi | 
|  | 895 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 896 | echo "Command '$P_PXY_BIN' is not an executable file" | 
|  | 897 | exit 1 | 
|  | 898 | fi | 
|  | 899 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 900 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 901 | echo "Memcheck not possible. Valgrind not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 902 | exit 1 | 
|  | 903 | fi | 
|  | 904 | fi | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 905 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 906 | echo "Command '$OPENSSL_CMD' not found" | 
|  | 907 | exit 1 | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 908 | fi | 
|  | 909 |  | 
|  | 910 | # used by watchdog | 
|  | 911 | MAIN_PID="$$" | 
|  | 912 |  | 
|  | 913 | # We use somewhat arbitrary delays for tests: | 
|  | 914 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 915 | # - how long do we allow for the client to finish? | 
|  | 916 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 917 | # Things are slower with valgrind, so give extra time here. | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 918 | # | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 919 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 920 | # script and the risk of spurious errors because we didn't wait long enough. | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 921 | # The watchdog delay on the other hand doesn't affect normal running time of | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 922 | # the script, only the case where a client or server gets stuck. | 
|  | 923 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 924 | START_DELAY=6 | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 925 | DOG_DELAY=60 | 
|  | 926 | else | 
|  | 927 | START_DELAY=2 | 
|  | 928 | DOG_DELAY=20 | 
|  | 929 | fi | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 930 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 931 | # some particular tests need more time: | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 932 | # - for the client, we multiply the usual watchdog limit by a factor | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 933 | # - for the server, we sleep for a number of seconds after the client exits | 
| Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 934 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 935 | CLI_DELAY_FACTOR=1 | 
|  | 936 | SRV_DELAY_SECONDS=0 | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 937 |  | 
| Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 938 | # fix commands to use this port, force IPv4 while at it | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 939 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later | 
|  | 940 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 941 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 942 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 943 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
|  | 944 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" | 
|  | 945 | G_SRV="$G_SRV -p $SRV_PORT" | 
|  | 946 | G_CLI="$G_CLI -p +SRV_PORT" | 
|  | 947 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 948 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 949 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
|  | 950 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" | 
|  | 951 | fi | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 952 |  | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 953 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 954 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 955 | fi | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 956 |  | 
|  | 957 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
|  | 958 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
|  | 959 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 960 |  | 
|  | 961 | # Allow SHA-1, because many of our test certificates use it | 
|  | 962 | P_SRV="$P_SRV allow_sha1=1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 963 | P_CLI="$P_CLI allow_sha1=1" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 964 |  | 
|  | 965 | # Also pick a unique name for intermediate files | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 966 | SRV_OUT="srv_out.$$" | 
|  | 967 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 968 | PXY_OUT="pxy_out.$$" | 
|  | 969 | SESSION="session.$$" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 970 |  | 
|  | 971 | SKIP_NEXT="NO" | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 972 |  | 
|  | 973 | trap cleanup INT TERM HUP | 
|  | 974 |  | 
|  | 975 | # Basic test | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 976 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 977 | # Checks that: | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 978 | # - things work with all ciphersuites active (used with config-full in all.sh) | 
|  | 979 | # - the expected (highest security) parameters are selected | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 980 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 981 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 982 | "$P_SRV debug_level=3" \ | 
|  | 983 | "$P_CLI" \ | 
|  | 984 | 0 \ | 
|  | 985 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 986 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 987 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 988 | -s "ECDHE curve: secp521r1" \ | 
|  | 989 | -S "error" \ | 
|  | 990 | -C "error" | 
|  | 991 |  | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 992 | run_test    "Default, DTLS" \ | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 993 | "$P_SRV dtls=1" \ | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 994 | "$P_CLI dtls=1" \ | 
|  | 995 | 0 \ | 
|  | 996 | -s "Protocol is DTLSv1.2" \ | 
|  | 997 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
|  | 998 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 999 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1000 | run_test    "CA callback on client" \ | 
|  | 1001 | "$P_SRV debug_level=3" \ | 
|  | 1002 | "$P_CLI ca_callback=1 debug_level=3 " \ | 
|  | 1003 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1004 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1005 | -S "error" \ | 
|  | 1006 | -C "error" | 
|  | 1007 |  | 
|  | 1008 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1009 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1010 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1011 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1012 | run_test    "CA callback on server" \ | 
|  | 1013 | "$P_SRV auth_mode=required" \ | 
|  | 1014 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ | 
|  | 1015 | key_file=data_files/server5.key" \ | 
|  | 1016 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1017 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1018 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1019 | -S "error" \ | 
|  | 1020 | -C "error" | 
|  | 1021 |  | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1022 | # Test using an opaque private key for client authentication | 
|  | 1023 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1024 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1025 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1026 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1027 | run_test    "Opaque key for client authentication" \ | 
|  | 1028 | "$P_SRV auth_mode=required" \ | 
|  | 1029 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1030 | key_file=data_files/server5.key" \ | 
|  | 1031 | 0 \ | 
|  | 1032 | -c "key type: Opaque" \ | 
|  | 1033 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1034 | -S "error" \ | 
|  | 1035 | -C "error" | 
|  | 1036 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1037 | # Test ciphersuites which we expect to be fully supported by PSA Crypto | 
|  | 1038 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. | 
|  | 1039 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM | 
|  | 1040 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 | 
|  | 1041 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM | 
|  | 1042 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 | 
|  | 1043 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | 
|  | 1044 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | 
|  | 1045 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | 
|  | 1046 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | 
|  | 1047 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | 
|  | 1048 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1049 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED | 
|  | 1050 | run_test_psa_force_curve "secp521r1" | 
|  | 1051 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED | 
|  | 1052 | run_test_psa_force_curve "brainpoolP512r1" | 
|  | 1053 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED | 
|  | 1054 | run_test_psa_force_curve "secp384r1" | 
|  | 1055 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED | 
|  | 1056 | run_test_psa_force_curve "brainpoolP384r1" | 
|  | 1057 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 1058 | run_test_psa_force_curve "secp256r1" | 
|  | 1059 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED | 
|  | 1060 | run_test_psa_force_curve "secp256k1" | 
|  | 1061 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED | 
|  | 1062 | run_test_psa_force_curve "brainpoolP256r1" | 
|  | 1063 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED | 
|  | 1064 | run_test_psa_force_curve "secp224r1" | 
|  | 1065 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED | 
|  | 1066 | run_test_psa_force_curve "secp224k1" | 
|  | 1067 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED | 
|  | 1068 | run_test_psa_force_curve "secp192r1" | 
|  | 1069 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED | 
|  | 1070 | run_test_psa_force_curve "secp192k1" | 
|  | 1071 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1072 | # Test current time in ServerHello | 
|  | 1073 | requires_config_enabled MBEDTLS_HAVE_TIME | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1074 | run_test    "ServerHello contains gmt_unix_time" \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1075 | "$P_SRV debug_level=3" \ | 
|  | 1076 | "$P_CLI debug_level=3" \ | 
|  | 1077 | 0 \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1078 | -f "check_server_hello_time" \ | 
|  | 1079 | -F "check_server_hello_time" | 
|  | 1080 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1081 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 1082 | run_test    "Unique IV in GCM" \ | 
|  | 1083 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 1084 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 1085 | 0 \ | 
|  | 1086 | -u "IV used" \ | 
|  | 1087 | -U "IV used" | 
|  | 1088 |  | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1089 | # Tests for certificate verification callback | 
|  | 1090 | run_test    "Configuration-specific CRT verification callback" \ | 
|  | 1091 | "$P_SRV debug_level=3" \ | 
|  | 1092 | "$P_CLI context_crt_cb=0 debug_level=3" \ | 
|  | 1093 | 0 \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1094 | -S "error" \ | 
|  | 1095 | -c "Verify requested for " \ | 
|  | 1096 | -c "Use configuration-specific verification callback" \ | 
|  | 1097 | -C "Use context-specific verification callback" \ | 
|  | 1098 | -C "error" | 
|  | 1099 |  | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1100 | run_test    "Context-specific CRT verification callback" \ | 
|  | 1101 | "$P_SRV debug_level=3" \ | 
|  | 1102 | "$P_CLI context_crt_cb=1 debug_level=3" \ | 
|  | 1103 | 0 \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1104 | -S "error" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1105 | -c "Verify requested for " \ | 
|  | 1106 | -c "Use context-specific verification callback" \ | 
|  | 1107 | -C "Use configuration-specific verification callback" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1108 | -C "error" | 
|  | 1109 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1110 | # Tests for rc4 option | 
|  | 1111 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1112 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1113 | run_test    "RC4: server disabled, client enabled" \ | 
|  | 1114 | "$P_SRV" \ | 
|  | 1115 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1116 | 1 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1117 | -s "SSL - The server has no ciphersuites in common" | 
|  | 1118 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1119 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1120 | run_test    "RC4: server half, client enabled" \ | 
|  | 1121 | "$P_SRV arc4=1" \ | 
|  | 1122 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1123 | 1 \ | 
|  | 1124 | -s "SSL - The server has no ciphersuites in common" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1125 |  | 
|  | 1126 | run_test    "RC4: server enabled, client disabled" \ | 
|  | 1127 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1128 | "$P_CLI" \ | 
|  | 1129 | 1 \ | 
|  | 1130 | -s "SSL - The server has no ciphersuites in common" | 
|  | 1131 |  | 
|  | 1132 | run_test    "RC4: both enabled" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1133 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1134 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1135 | 0 \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1136 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1137 | -S "SSL - The server has no ciphersuites in common" | 
|  | 1138 |  | 
| Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1139 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier | 
|  | 1140 |  | 
|  | 1141 | requires_gnutls | 
|  | 1142 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 1143 | run_test    "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ | 
|  | 1144 | "$G_SRV"\ | 
|  | 1145 | "$P_CLI force_version=tls1_1" \ | 
|  | 1146 | 0 | 
|  | 1147 |  | 
|  | 1148 | requires_gnutls | 
|  | 1149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 | 
|  | 1150 | run_test    "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ | 
|  | 1151 | "$G_SRV"\ | 
|  | 1152 | "$P_CLI force_version=tls1" \ | 
|  | 1153 | 0 | 
|  | 1154 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1155 | # Tests for SHA-1 support | 
|  | 1156 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1157 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1158 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 1159 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1160 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1161 | 1 \ | 
|  | 1162 | -c "The certificate is signed with an unacceptable hash" | 
|  | 1163 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1164 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1165 | run_test    "SHA-1 allowed by default in server certificate" \ | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1166 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1167 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1168 | 0 | 
|  | 1169 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1170 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 1171 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1172 | "$P_CLI allow_sha1=1" \ | 
|  | 1173 | 0 | 
|  | 1174 |  | 
|  | 1175 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 1176 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 1177 | "$P_CLI allow_sha1=0" \ | 
|  | 1178 | 0 | 
|  | 1179 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1180 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1181 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 1182 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1183 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1184 | 1 \ | 
|  | 1185 | -s "The certificate is signed with an unacceptable hash" | 
|  | 1186 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1187 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1188 | run_test    "SHA-1 allowed by default in client certificate" \ | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1189 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1190 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1191 | 0 | 
|  | 1192 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1193 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 1194 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 1195 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1196 | 0 | 
|  | 1197 |  | 
|  | 1198 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 1199 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1200 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 1201 | 0 | 
|  | 1202 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1203 | # Tests for datagram packing | 
|  | 1204 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 1205 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1206 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1207 | 0 \ | 
|  | 1208 | -c "next record in same datagram" \ | 
|  | 1209 | -s "next record in same datagram" | 
|  | 1210 |  | 
|  | 1211 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 1212 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1213 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1214 | 0 \ | 
|  | 1215 | -s "next record in same datagram" \ | 
|  | 1216 | -C "next record in same datagram" | 
|  | 1217 |  | 
|  | 1218 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 1219 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1220 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1221 | 0 \ | 
|  | 1222 | -S "next record in same datagram" \ | 
|  | 1223 | -c "next record in same datagram" | 
|  | 1224 |  | 
|  | 1225 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 1226 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1227 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1228 | 0 \ | 
|  | 1229 | -S "next record in same datagram" \ | 
|  | 1230 | -C "next record in same datagram" | 
|  | 1231 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1232 | # Tests for Truncated HMAC extension | 
|  | 1233 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1234 | run_test    "Truncated HMAC: client default, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1235 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1236 | "$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] | 1237 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1238 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1239 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1240 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1242 | run_test    "Truncated HMAC: client disabled, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1243 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1244 | "$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] | 1245 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1246 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1247 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1248 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1250 | run_test    "Truncated HMAC: client enabled, server default" \ | 
|  | 1251 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1252 | "$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] | 1253 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1254 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1255 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1256 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1257 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1258 | run_test    "Truncated HMAC: client enabled, server disabled" \ | 
|  | 1259 | "$P_SRV debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1260 | "$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] | 1261 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1262 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1263 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1264 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1265 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1266 | run_test    "Truncated HMAC: client disabled, server enabled" \ | 
|  | 1267 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1268 | "$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] | 1269 | 0 \ | 
|  | 1270 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1271 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1272 |  | 
|  | 1273 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1274 | run_test    "Truncated HMAC: client enabled, server enabled" \ | 
|  | 1275 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1276 | "$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] | 1277 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1278 | -S "dumping 'expected mac' (20 bytes)" \ | 
|  | 1279 | -s "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1280 |  | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1281 | run_test    "Truncated HMAC, DTLS: client default, server default" \ | 
|  | 1282 | "$P_SRV dtls=1 debug_level=4" \ | 
|  | 1283 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 1284 | 0 \ | 
|  | 1285 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1286 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1287 |  | 
|  | 1288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1289 | run_test    "Truncated HMAC, DTLS: client disabled, server default" \ | 
|  | 1290 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1291 | "$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] | 1292 | 0 \ | 
|  | 1293 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1294 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1295 |  | 
|  | 1296 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1297 | run_test    "Truncated HMAC, DTLS: client enabled, server default" \ | 
|  | 1298 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1299 | "$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] | 1300 | 0 \ | 
|  | 1301 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1302 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1303 |  | 
|  | 1304 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1305 | run_test    "Truncated HMAC, DTLS: client enabled, server disabled" \ | 
|  | 1306 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1307 | "$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] | 1308 | 0 \ | 
|  | 1309 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1310 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1311 |  | 
|  | 1312 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1313 | run_test    "Truncated HMAC, DTLS: client disabled, server enabled" \ | 
|  | 1314 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1315 | "$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] | 1316 | 0 \ | 
|  | 1317 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1318 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1319 |  | 
|  | 1320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1321 | run_test    "Truncated HMAC, DTLS: client enabled, server enabled" \ | 
|  | 1322 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1323 | "$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] | 1324 | 0 \ | 
|  | 1325 | -S "dumping 'expected mac' (20 bytes)" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1326 | -s "dumping 'expected mac' (10 bytes)" | 
|  | 1327 |  | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1328 | # Tests for Context serialization | 
|  | 1329 |  | 
|  | 1330 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1331 | run_test    "Context serialization, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1332 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1333 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1334 | 0 \ | 
|  | 1335 | -c "Deserializing connection..." \ | 
|  | 1336 | -S "Deserializing connection..." | 
|  | 1337 |  | 
|  | 1338 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1339 | run_test    "Context serialization, client serializes, ChaChaPoly" \ | 
|  | 1340 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1341 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1342 | 0 \ | 
|  | 1343 | -c "Deserializing connection..." \ | 
|  | 1344 | -S "Deserializing connection..." | 
|  | 1345 |  | 
|  | 1346 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1347 | run_test    "Context serialization, client serializes, GCM" \ | 
|  | 1348 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1349 | "$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] | 1350 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1351 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1352 | -S "Deserializing connection..." | 
|  | 1353 |  | 
|  | 1354 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1355 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1356 | run_test    "Context serialization, client serializes, with CID" \ | 
|  | 1357 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1358 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1359 | 0 \ | 
|  | 1360 | -c "Deserializing connection..." \ | 
|  | 1361 | -S "Deserializing connection..." | 
|  | 1362 |  | 
|  | 1363 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1364 | run_test    "Context serialization, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1365 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1366 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1367 | 0 \ | 
|  | 1368 | -C "Deserializing connection..." \ | 
|  | 1369 | -s "Deserializing connection..." | 
|  | 1370 |  | 
|  | 1371 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1372 | run_test    "Context serialization, server serializes, ChaChaPoly" \ | 
|  | 1373 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1374 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1375 | 0 \ | 
|  | 1376 | -C "Deserializing connection..." \ | 
|  | 1377 | -s "Deserializing connection..." | 
|  | 1378 |  | 
|  | 1379 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1380 | run_test    "Context serialization, server serializes, GCM" \ | 
|  | 1381 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1382 | "$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] | 1383 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1384 | -C "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1385 | -s "Deserializing connection..." | 
|  | 1386 |  | 
|  | 1387 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1388 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1389 | run_test    "Context serialization, server serializes, with CID" \ | 
|  | 1390 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1391 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1392 | 0 \ | 
|  | 1393 | -C "Deserializing connection..." \ | 
|  | 1394 | -s "Deserializing connection..." | 
|  | 1395 |  | 
|  | 1396 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1397 | run_test    "Context serialization, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1398 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1399 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1400 | 0 \ | 
|  | 1401 | -c "Deserializing connection..." \ | 
|  | 1402 | -s "Deserializing connection..." | 
|  | 1403 |  | 
|  | 1404 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1405 | run_test    "Context serialization, both serialize, ChaChaPoly" \ | 
|  | 1406 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1407 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1408 | 0 \ | 
|  | 1409 | -c "Deserializing connection..." \ | 
|  | 1410 | -s "Deserializing connection..." | 
|  | 1411 |  | 
|  | 1412 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1413 | run_test    "Context serialization, both serialize, GCM" \ | 
|  | 1414 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1415 | "$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] | 1416 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1417 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1418 | -s "Deserializing connection..." | 
|  | 1419 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1420 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1421 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1422 | run_test    "Context serialization, both serialize, with CID" \ | 
|  | 1423 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1424 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1425 | 0 \ | 
|  | 1426 | -c "Deserializing connection..." \ | 
|  | 1427 | -s "Deserializing connection..." | 
|  | 1428 |  | 
|  | 1429 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1430 | run_test    "Context serialization, re-init, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1431 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1432 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1433 | 0 \ | 
|  | 1434 | -c "Deserializing connection..." \ | 
|  | 1435 | -S "Deserializing connection..." | 
|  | 1436 |  | 
|  | 1437 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1438 | run_test    "Context serialization, re-init, client serializes, ChaChaPoly" \ | 
|  | 1439 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1440 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1441 | 0 \ | 
|  | 1442 | -c "Deserializing connection..." \ | 
|  | 1443 | -S "Deserializing connection..." | 
|  | 1444 |  | 
|  | 1445 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1446 | run_test    "Context serialization, re-init, client serializes, GCM" \ | 
|  | 1447 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1448 | "$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] | 1449 | 0 \ | 
|  | 1450 | -c "Deserializing connection..." \ | 
|  | 1451 | -S "Deserializing connection..." | 
|  | 1452 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1453 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1454 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1455 | run_test    "Context serialization, re-init, client serializes, with CID" \ | 
|  | 1456 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1457 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1458 | 0 \ | 
|  | 1459 | -c "Deserializing connection..." \ | 
|  | 1460 | -S "Deserializing connection..." | 
|  | 1461 |  | 
|  | 1462 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1463 | run_test    "Context serialization, re-init, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1464 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1465 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1466 | 0 \ | 
|  | 1467 | -C "Deserializing connection..." \ | 
|  | 1468 | -s "Deserializing connection..." | 
|  | 1469 |  | 
|  | 1470 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1471 | run_test    "Context serialization, re-init, server serializes, ChaChaPoly" \ | 
|  | 1472 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1473 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1474 | 0 \ | 
|  | 1475 | -C "Deserializing connection..." \ | 
|  | 1476 | -s "Deserializing connection..." | 
|  | 1477 |  | 
|  | 1478 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1479 | run_test    "Context serialization, re-init, server serializes, GCM" \ | 
|  | 1480 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1481 | "$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] | 1482 | 0 \ | 
|  | 1483 | -C "Deserializing connection..." \ | 
|  | 1484 | -s "Deserializing connection..." | 
|  | 1485 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1486 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1487 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1488 | run_test    "Context serialization, re-init, server serializes, with CID" \ | 
|  | 1489 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1490 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1491 | 0 \ | 
|  | 1492 | -C "Deserializing connection..." \ | 
|  | 1493 | -s "Deserializing connection..." | 
|  | 1494 |  | 
|  | 1495 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1496 | run_test    "Context serialization, re-init, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1497 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1498 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1499 | 0 \ | 
|  | 1500 | -c "Deserializing connection..." \ | 
|  | 1501 | -s "Deserializing connection..." | 
|  | 1502 |  | 
|  | 1503 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1504 | run_test    "Context serialization, re-init, both serialize, ChaChaPoly" \ | 
|  | 1505 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1506 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1507 | 0 \ | 
|  | 1508 | -c "Deserializing connection..." \ | 
|  | 1509 | -s "Deserializing connection..." | 
|  | 1510 |  | 
|  | 1511 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1512 | run_test    "Context serialization, re-init, both serialize, GCM" \ | 
|  | 1513 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1514 | "$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] | 1515 | 0 \ | 
|  | 1516 | -c "Deserializing connection..." \ | 
|  | 1517 | -s "Deserializing connection..." | 
|  | 1518 |  | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1519 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1520 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1521 | run_test    "Context serialization, re-init, both serialize, with CID" \ | 
|  | 1522 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1523 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1524 | 0 \ | 
|  | 1525 | -c "Deserializing connection..." \ | 
|  | 1526 | -s "Deserializing connection..." | 
|  | 1527 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1528 | # Tests for DTLS Connection ID extension | 
|  | 1529 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1530 | # So far, the CID API isn't implemented, so we can't | 
|  | 1531 | # grep for output witnessing its use. This needs to be | 
|  | 1532 | # changed once the CID extension is implemented. | 
|  | 1533 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1534 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1535 | run_test    "Connection ID: Cli enabled, Srv disabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1536 | "$P_SRV debug_level=3 dtls=1 cid=0" \ | 
|  | 1537 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1538 | 0 \ | 
|  | 1539 | -s "Disable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1540 | -s "found CID extension"           \ | 
|  | 1541 | -s "Client sent CID extension, but CID disabled" \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1542 | -c "Enable use of CID extension."  \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1543 | -c "client hello, adding CID extension" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1544 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1545 | -C "found CID extension" \ | 
|  | 1546 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1547 | -C "Copy CIDs into SSL transform" \ | 
|  | 1548 | -c "Use of Connection ID was rejected by the server" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1549 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1550 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1551 | run_test    "Connection ID: Cli disabled, Srv enabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1552 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1553 | "$P_CLI debug_level=3 dtls=1 cid=0" \ | 
|  | 1554 | 0 \ | 
|  | 1555 | -c "Disable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1556 | -C "client hello, adding CID extension"           \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1557 | -S "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1558 | -s "Enable use of CID extension." \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1559 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1560 | -C "found CID extension" \ | 
|  | 1561 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1562 | -C "Copy CIDs into SSL transform"  \ | 
| Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1563 | -s "Use of Connection ID was not offered by client" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1564 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1565 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1566 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1567 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1568 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1569 | 0 \ | 
|  | 1570 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1571 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1572 | -c "client hello, adding CID extension" \ | 
|  | 1573 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1574 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1575 | -s "server hello, adding CID extension" \ | 
|  | 1576 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1577 | -c "Use of CID extension negotiated" \ | 
|  | 1578 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1579 | -c "Copy CIDs into SSL transform" \ | 
|  | 1580 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1581 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1582 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1583 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1584 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1586 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1587 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1588 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ | 
|  | 1589 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ | 
|  | 1590 | 0 \ | 
|  | 1591 | -c "Enable use of CID extension." \ | 
|  | 1592 | -s "Enable use of CID extension." \ | 
|  | 1593 | -c "client hello, adding CID extension" \ | 
|  | 1594 | -s "found CID extension"           \ | 
|  | 1595 | -s "Use of CID extension negotiated" \ | 
|  | 1596 | -s "server hello, adding CID extension" \ | 
|  | 1597 | -c "found CID extension" \ | 
|  | 1598 | -c "Use of CID extension negotiated" \ | 
|  | 1599 | -s "Copy CIDs into SSL transform" \ | 
|  | 1600 | -c "Copy CIDs into SSL transform" \ | 
|  | 1601 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1602 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1603 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1604 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1605 | -c "ignoring unexpected CID" \ | 
|  | 1606 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1607 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1608 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1609 | run_test    "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
|  | 1610 | -p "$P_PXY mtu=800" \ | 
|  | 1611 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1612 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1613 | 0 \ | 
|  | 1614 | -c "Enable use of CID extension." \ | 
|  | 1615 | -s "Enable use of CID extension." \ | 
|  | 1616 | -c "client hello, adding CID extension" \ | 
|  | 1617 | -s "found CID extension"           \ | 
|  | 1618 | -s "Use of CID extension negotiated" \ | 
|  | 1619 | -s "server hello, adding CID extension" \ | 
|  | 1620 | -c "found CID extension" \ | 
|  | 1621 | -c "Use of CID extension negotiated" \ | 
|  | 1622 | -s "Copy CIDs into SSL transform" \ | 
|  | 1623 | -c "Copy CIDs into SSL transform" \ | 
|  | 1624 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1625 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1626 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1627 | -c "Use of Connection ID has been negotiated" | 
|  | 1628 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1629 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1630 | 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] | 1631 | -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] | 1632 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1633 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1634 | 0 \ | 
|  | 1635 | -c "Enable use of CID extension." \ | 
|  | 1636 | -s "Enable use of CID extension." \ | 
|  | 1637 | -c "client hello, adding CID extension" \ | 
|  | 1638 | -s "found CID extension"           \ | 
|  | 1639 | -s "Use of CID extension negotiated" \ | 
|  | 1640 | -s "server hello, adding CID extension" \ | 
|  | 1641 | -c "found CID extension" \ | 
|  | 1642 | -c "Use of CID extension negotiated" \ | 
|  | 1643 | -s "Copy CIDs into SSL transform" \ | 
|  | 1644 | -c "Copy CIDs into SSL transform" \ | 
|  | 1645 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1646 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1647 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1648 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1649 | -c "ignoring unexpected CID" \ | 
|  | 1650 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1651 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1652 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1653 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1654 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1655 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 1656 | 0 \ | 
|  | 1657 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1658 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1659 | -c "client hello, adding CID extension" \ | 
|  | 1660 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1661 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1662 | -s "server hello, adding CID extension" \ | 
|  | 1663 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1664 | -c "Use of CID extension negotiated" \ | 
|  | 1665 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1666 | -c "Copy CIDs into SSL transform" \ | 
|  | 1667 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1668 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 1669 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1670 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1671 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1672 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1673 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1674 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1675 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1676 | 0 \ | 
|  | 1677 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1678 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1679 | -c "client hello, adding CID extension" \ | 
|  | 1680 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1681 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1682 | -s "server hello, adding CID extension" \ | 
|  | 1683 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1684 | -c "Use of CID extension negotiated" \ | 
|  | 1685 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1686 | -c "Copy CIDs into SSL transform" \ | 
|  | 1687 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1688 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 1689 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1690 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1691 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1692 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1693 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1694 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1695 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 1696 | 0 \ | 
|  | 1697 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1698 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1699 | -c "client hello, adding CID extension" \ | 
|  | 1700 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1701 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1702 | -s "server hello, adding CID extension" \ | 
|  | 1703 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1704 | -c "Use of CID extension negotiated" \ | 
|  | 1705 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1706 | -c "Copy CIDs into SSL transform" \ | 
|  | 1707 | -S "Use of Connection ID has been negotiated" \ | 
|  | 1708 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1709 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1710 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1711 | 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] | 1712 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1713 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1714 | 0 \ | 
|  | 1715 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1716 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1717 | -c "client hello, adding CID extension" \ | 
|  | 1718 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1719 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1720 | -s "server hello, adding CID extension" \ | 
|  | 1721 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1722 | -c "Use of CID extension negotiated" \ | 
|  | 1723 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1724 | -c "Copy CIDs into SSL transform" \ | 
|  | 1725 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1726 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1727 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1728 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1729 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1730 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1731 | 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] | 1732 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1733 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1734 | 0 \ | 
|  | 1735 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1736 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1737 | -c "client hello, adding CID extension" \ | 
|  | 1738 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1739 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1740 | -s "server hello, adding CID extension" \ | 
|  | 1741 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1742 | -c "Use of CID extension negotiated" \ | 
|  | 1743 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1744 | -c "Copy CIDs into SSL transform" \ | 
|  | 1745 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1746 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 1747 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1748 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1749 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1750 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1751 | 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] | 1752 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1753 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1754 | 0 \ | 
|  | 1755 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1756 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1757 | -c "client hello, adding CID extension" \ | 
|  | 1758 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1759 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1760 | -s "server hello, adding CID extension" \ | 
|  | 1761 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1762 | -c "Use of CID extension negotiated" \ | 
|  | 1763 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1764 | -c "Copy CIDs into SSL transform" \ | 
|  | 1765 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1766 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 1767 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1768 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1769 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1771 | 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] | 1772 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1773 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1774 | 0 \ | 
|  | 1775 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1776 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1777 | -c "client hello, adding CID extension" \ | 
|  | 1778 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1779 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1780 | -s "server hello, adding CID extension" \ | 
|  | 1781 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1782 | -c "Use of CID extension negotiated" \ | 
|  | 1783 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1784 | -c "Copy CIDs into SSL transform" \ | 
|  | 1785 | -S "Use of Connection ID has been negotiated" \ | 
|  | 1786 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1787 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1788 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1789 | 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] | 1790 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1791 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 1792 | 0 \ | 
|  | 1793 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1794 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1795 | -c "client hello, adding CID extension" \ | 
|  | 1796 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1797 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1798 | -s "server hello, adding CID extension" \ | 
|  | 1799 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1800 | -c "Use of CID extension negotiated" \ | 
|  | 1801 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1802 | -c "Copy CIDs into SSL transform" \ | 
|  | 1803 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1804 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1805 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1806 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1807 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1808 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1809 | 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] | 1810 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1811 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 1812 | 0 \ | 
|  | 1813 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1814 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1815 | -c "client hello, adding CID extension" \ | 
|  | 1816 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1817 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1818 | -s "server hello, adding CID extension" \ | 
|  | 1819 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1820 | -c "Use of CID extension negotiated" \ | 
|  | 1821 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1822 | -c "Copy CIDs into SSL transform" \ | 
|  | 1823 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1824 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 1825 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1826 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1827 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1828 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1829 | 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] | 1830 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1831 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 1832 | 0 \ | 
|  | 1833 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1834 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1835 | -c "client hello, adding CID extension" \ | 
|  | 1836 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1837 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1838 | -s "server hello, adding CID extension" \ | 
|  | 1839 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1840 | -c "Use of CID extension negotiated" \ | 
|  | 1841 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1842 | -c "Copy CIDs into SSL transform" \ | 
|  | 1843 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1844 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 1845 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1846 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1847 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1848 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1849 | 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] | 1850 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1851 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 1852 | 0 \ | 
|  | 1853 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1854 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1855 | -c "client hello, adding CID extension" \ | 
|  | 1856 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1857 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1858 | -s "server hello, adding CID extension" \ | 
|  | 1859 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1860 | -c "Use of CID extension negotiated" \ | 
|  | 1861 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1862 | -c "Copy CIDs into SSL transform" \ | 
|  | 1863 | -S "Use of Connection ID has been negotiated" \ | 
|  | 1864 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1865 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1866 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1868 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1869 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 1870 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 1871 | 0 \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1872 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1873 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1874 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1875 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1876 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1877 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1878 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1879 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1880 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1881 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1882 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1883 | run_test    "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1884 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 1885 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 1886 | 0 \ | 
|  | 1887 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1888 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1889 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1890 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1891 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1892 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1893 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1894 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1895 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1896 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1897 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1898 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ | 
|  | 1899 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 1900 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 1901 | 0 \ | 
|  | 1902 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1903 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1904 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1905 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1906 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1907 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1908 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1909 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1910 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1912 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1913 | 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] | 1914 | -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] | 1915 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 1916 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 1917 | 0 \ | 
|  | 1918 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1919 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1920 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1921 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1922 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1923 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1924 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1925 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1926 | -c "ignoring unexpected CID" \ | 
|  | 1927 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1928 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1929 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 1931 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1932 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 1933 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 1934 | 0 \ | 
|  | 1935 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1936 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1937 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1938 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1939 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1940 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1941 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1942 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1943 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1944 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1945 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1946 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ | 
|  | 1947 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 1948 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 1949 | 0 \ | 
|  | 1950 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1951 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1952 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1953 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1954 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1955 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1956 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1957 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1958 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1959 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1960 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1961 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1962 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1963 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 1964 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 1965 | 0 \ | 
|  | 1966 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1967 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1968 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1969 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1970 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1971 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1972 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1973 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1974 | -c "ignoring unexpected CID" \ | 
|  | 1975 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1976 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1978 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 1979 | run_test    "Connection ID: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1980 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 1981 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 1982 | 0 \ | 
|  | 1983 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1984 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1985 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1986 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 1987 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 1988 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 1989 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1991 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1992 | run_test    "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ | 
|  | 1993 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 1994 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 1995 | 0 \ | 
|  | 1996 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1997 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 1998 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 1999 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2000 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2001 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2002 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2004 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2005 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2006 | -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] | 2007 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2008 | "$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" \ | 
|  | 2009 | 0 \ | 
|  | 2010 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2011 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2012 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2013 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2014 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2015 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2016 | -c "ignoring unexpected CID" \ | 
|  | 2017 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2018 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2019 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2020 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2021 | run_test    "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2022 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2023 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2024 | 0 \ | 
|  | 2025 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2026 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2027 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2028 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2029 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2030 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2031 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2032 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2033 | -s "(after renegotiation) Use of Connection ID was not offered by client" | 
|  | 2034 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2036 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2037 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2038 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2039 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2040 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2041 | 0 \ | 
|  | 2042 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2043 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2044 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2045 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2046 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2047 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2048 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2049 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2050 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ | 
|  | 2051 | -c "ignoring unexpected CID" \ | 
|  | 2052 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2053 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2055 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2056 | run_test    "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ | 
|  | 2057 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2058 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2059 | 0 \ | 
|  | 2060 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2061 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2062 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2063 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2064 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2065 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2066 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2067 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2068 | -c "(after renegotiation) Use of Connection ID was rejected by the server" | 
|  | 2069 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2070 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2072 | run_test    "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2073 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2074 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2075 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2076 | 0 \ | 
|  | 2077 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2078 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2079 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2080 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2081 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2082 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2083 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2084 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2085 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ | 
|  | 2086 | -c "ignoring unexpected CID" \ | 
|  | 2087 | -s "ignoring unexpected CID" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2088 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2089 | # Tests for Encrypt-then-MAC extension | 
|  | 2090 |  | 
|  | 2091 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2092 | "$P_SRV debug_level=3 \ | 
|  | 2093 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2094 | "$P_CLI debug_level=3" \ | 
|  | 2095 | 0 \ | 
|  | 2096 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2097 | -s "found encrypt then mac extension" \ | 
|  | 2098 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 2099 | -c "found encrypt_then_mac extension" \ | 
|  | 2100 | -c "using encrypt then mac" \ | 
|  | 2101 | -s "using encrypt then mac" | 
|  | 2102 |  | 
|  | 2103 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2104 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 2105 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2106 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2107 | 0 \ | 
|  | 2108 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2109 | -s "found encrypt then mac extension" \ | 
|  | 2110 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2111 | -C "found encrypt_then_mac extension" \ | 
|  | 2112 | -C "using encrypt then mac" \ | 
|  | 2113 | -S "using encrypt then mac" | 
|  | 2114 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2115 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 2116 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2117 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2118 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2119 | 0 \ | 
|  | 2120 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2121 | -s "found encrypt then mac extension" \ | 
|  | 2122 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2123 | -C "found encrypt_then_mac extension" \ | 
|  | 2124 | -C "using encrypt then mac" \ | 
|  | 2125 | -S "using encrypt then mac" | 
|  | 2126 |  | 
|  | 2127 | run_test    "Encrypt then MAC: client enabled, stream cipher" \ | 
|  | 2128 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2129 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2130 | "$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] | 2131 | 0 \ | 
|  | 2132 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2133 | -s "found encrypt then mac extension" \ | 
|  | 2134 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2135 | -C "found encrypt_then_mac extension" \ | 
|  | 2136 | -C "using encrypt then mac" \ | 
|  | 2137 | -S "using encrypt then mac" | 
|  | 2138 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2139 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2140 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2141 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2142 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 2143 | 0 \ | 
|  | 2144 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2145 | -S "found encrypt then mac extension" \ | 
|  | 2146 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2147 | -C "found encrypt_then_mac extension" \ | 
|  | 2148 | -C "using encrypt then mac" \ | 
|  | 2149 | -S "using encrypt then mac" | 
|  | 2150 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2152 | run_test    "Encrypt then MAC: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2153 | "$P_SRV debug_level=3 min_version=ssl3 \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2154 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2155 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 2156 | 0 \ | 
|  | 2157 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2158 | -S "found encrypt then mac extension" \ | 
|  | 2159 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2160 | -C "found encrypt_then_mac extension" \ | 
|  | 2161 | -C "using encrypt then mac" \ | 
|  | 2162 | -S "using encrypt then mac" | 
|  | 2163 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2164 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2165 | run_test    "Encrypt then MAC: client enabled, server SSLv3" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2166 | "$P_SRV debug_level=3 force_version=ssl3 \ | 
|  | 2167 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2168 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2169 | 0 \ | 
|  | 2170 | -c "client hello, adding encrypt_then_mac extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2171 | -S "found encrypt then mac extension" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2172 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2173 | -C "found encrypt_then_mac extension" \ | 
|  | 2174 | -C "using encrypt then mac" \ | 
|  | 2175 | -S "using encrypt then mac" | 
|  | 2176 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2177 | # Tests for Extended Master Secret extension | 
|  | 2178 |  | 
|  | 2179 | run_test    "Extended Master Secret: default" \ | 
|  | 2180 | "$P_SRV debug_level=3" \ | 
|  | 2181 | "$P_CLI debug_level=3" \ | 
|  | 2182 | 0 \ | 
|  | 2183 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2184 | -s "found extended master secret extension" \ | 
|  | 2185 | -s "server hello, adding extended master secret extension" \ | 
|  | 2186 | -c "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2187 | -c "session hash for extended master secret" \ | 
|  | 2188 | -s "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2189 |  | 
|  | 2190 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 2191 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 2192 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 2193 | 0 \ | 
|  | 2194 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2195 | -s "found extended master secret extension" \ | 
|  | 2196 | -S "server hello, adding extended master secret extension" \ | 
|  | 2197 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2198 | -C "session hash for extended master secret" \ | 
|  | 2199 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2200 |  | 
|  | 2201 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 2202 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 2203 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 2204 | 0 \ | 
|  | 2205 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2206 | -S "found extended master secret extension" \ | 
|  | 2207 | -S "server hello, adding extended master secret extension" \ | 
|  | 2208 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2209 | -C "session hash for extended master secret" \ | 
|  | 2210 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2211 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2213 | run_test    "Extended Master Secret: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2214 | "$P_SRV debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2215 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 2216 | 0 \ | 
|  | 2217 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2218 | -S "found extended master secret extension" \ | 
|  | 2219 | -S "server hello, adding extended master secret extension" \ | 
|  | 2220 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2221 | -C "session hash for extended master secret" \ | 
|  | 2222 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2223 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2225 | run_test    "Extended Master Secret: client enabled, server SSLv3" \ | 
|  | 2226 | "$P_SRV debug_level=3 force_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2227 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2228 | 0 \ | 
|  | 2229 | -c "client hello, adding extended_master_secret extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2230 | -S "found extended master secret extension" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2231 | -S "server hello, adding extended master secret extension" \ | 
|  | 2232 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2233 | -C "session hash for extended master secret" \ | 
|  | 2234 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2235 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2236 | # Tests for FALLBACK_SCSV | 
|  | 2237 |  | 
|  | 2238 | run_test    "Fallback SCSV: default" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2239 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2240 | "$P_CLI debug_level=3 force_version=tls1_1" \ | 
|  | 2241 | 0 \ | 
|  | 2242 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2243 | -S "received FALLBACK_SCSV" \ | 
|  | 2244 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2245 | -C "is a fatal alert message (msg 86)" | 
|  | 2246 |  | 
|  | 2247 | run_test    "Fallback SCSV: explicitly disabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2248 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2249 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 2250 | 0 \ | 
|  | 2251 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2252 | -S "received FALLBACK_SCSV" \ | 
|  | 2253 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2254 | -C "is a fatal alert message (msg 86)" | 
|  | 2255 |  | 
|  | 2256 | run_test    "Fallback SCSV: enabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2257 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2258 | "$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] | 2259 | 1 \ | 
|  | 2260 | -c "adding FALLBACK_SCSV" \ | 
|  | 2261 | -s "received FALLBACK_SCSV" \ | 
|  | 2262 | -s "inapropriate fallback" \ | 
|  | 2263 | -c "is a fatal alert message (msg 86)" | 
|  | 2264 |  | 
|  | 2265 | run_test    "Fallback SCSV: enabled, max version" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2266 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2267 | "$P_CLI debug_level=3 fallback=1" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2268 | 0 \ | 
|  | 2269 | -c "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2270 | -s "received FALLBACK_SCSV" \ | 
|  | 2271 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2272 | -C "is a fatal alert message (msg 86)" | 
|  | 2273 |  | 
|  | 2274 | requires_openssl_with_fallback_scsv | 
|  | 2275 | run_test    "Fallback SCSV: default, openssl server" \ | 
|  | 2276 | "$O_SRV" \ | 
|  | 2277 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 2278 | 0 \ | 
|  | 2279 | -C "adding FALLBACK_SCSV" \ | 
|  | 2280 | -C "is a fatal alert message (msg 86)" | 
|  | 2281 |  | 
|  | 2282 | requires_openssl_with_fallback_scsv | 
|  | 2283 | run_test    "Fallback SCSV: enabled, openssl server" \ | 
|  | 2284 | "$O_SRV" \ | 
|  | 2285 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ | 
|  | 2286 | 1 \ | 
|  | 2287 | -c "adding FALLBACK_SCSV" \ | 
|  | 2288 | -c "is a fatal alert message (msg 86)" | 
|  | 2289 |  | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2290 | requires_openssl_with_fallback_scsv | 
|  | 2291 | run_test    "Fallback SCSV: disabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2292 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2293 | "$O_CLI -tls1_1" \ | 
|  | 2294 | 0 \ | 
|  | 2295 | -S "received FALLBACK_SCSV" \ | 
|  | 2296 | -S "inapropriate fallback" | 
|  | 2297 |  | 
|  | 2298 | requires_openssl_with_fallback_scsv | 
|  | 2299 | run_test    "Fallback SCSV: enabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2300 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2301 | "$O_CLI -tls1_1 -fallback_scsv" \ | 
|  | 2302 | 1 \ | 
|  | 2303 | -s "received FALLBACK_SCSV" \ | 
|  | 2304 | -s "inapropriate fallback" | 
|  | 2305 |  | 
|  | 2306 | requires_openssl_with_fallback_scsv | 
|  | 2307 | run_test    "Fallback SCSV: enabled, max version, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2308 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2309 | "$O_CLI -fallback_scsv" \ | 
|  | 2310 | 0 \ | 
|  | 2311 | -s "received FALLBACK_SCSV" \ | 
|  | 2312 | -S "inapropriate fallback" | 
|  | 2313 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2314 | # Test sending and receiving empty application data records | 
|  | 2315 |  | 
|  | 2316 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 2317 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 2318 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 2319 | 0 \ | 
|  | 2320 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2321 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2322 | -c "0 bytes written in 1 fragments" | 
|  | 2323 |  | 
|  | 2324 | run_test    "Default, no Encrypt then MAC: empty application data record" \ | 
|  | 2325 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 2326 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 2327 | 0 \ | 
|  | 2328 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2329 | -c "0 bytes written in 1 fragments" | 
|  | 2330 |  | 
|  | 2331 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 2332 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 2333 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 2334 | 0 \ | 
|  | 2335 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2336 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2337 | -c "0 bytes written in 1 fragments" | 
|  | 2338 |  | 
|  | 2339 | run_test    "Default, no Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 2340 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 2341 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 2342 | 0 \ | 
|  | 2343 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2344 | -c "0 bytes written in 1 fragments" | 
|  | 2345 |  | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2346 | ## ClientHello generated with | 
|  | 2347 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." | 
|  | 2348 | ## then manually twiddling the ciphersuite list. | 
|  | 2349 | ## The ClientHello content is spelled out below as a hex string as | 
|  | 2350 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". | 
|  | 2351 | ## The expected response is an inappropriate_fallback alert. | 
|  | 2352 | requires_openssl_with_fallback_scsv | 
|  | 2353 | run_test    "Fallback SCSV: beginning of list" \ | 
|  | 2354 | "$P_SRV debug_level=2" \ | 
|  | 2355 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ | 
|  | 2356 | 0 \ | 
|  | 2357 | -s "received FALLBACK_SCSV" \ | 
|  | 2358 | -s "inapropriate fallback" | 
|  | 2359 |  | 
|  | 2360 | requires_openssl_with_fallback_scsv | 
|  | 2361 | run_test    "Fallback SCSV: end of list" \ | 
|  | 2362 | "$P_SRV debug_level=2" \ | 
|  | 2363 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ | 
|  | 2364 | 0 \ | 
|  | 2365 | -s "received FALLBACK_SCSV" \ | 
|  | 2366 | -s "inapropriate fallback" | 
|  | 2367 |  | 
|  | 2368 | ## Here the expected response is a valid ServerHello prefix, up to the random. | 
|  | 2369 | requires_openssl_with_fallback_scsv | 
|  | 2370 | run_test    "Fallback SCSV: not in list" \ | 
|  | 2371 | "$P_SRV debug_level=2" \ | 
|  | 2372 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ | 
|  | 2373 | 0 \ | 
|  | 2374 | -S "received FALLBACK_SCSV" \ | 
|  | 2375 | -S "inapropriate fallback" | 
|  | 2376 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2377 | # Tests for CBC 1/n-1 record splitting | 
|  | 2378 |  | 
|  | 2379 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 2380 | "$P_SRV" \ | 
|  | 2381 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2382 | request_size=123 force_version=tls1_2" \ | 
|  | 2383 | 0 \ | 
|  | 2384 | -s "Read from client: 123 bytes read" \ | 
|  | 2385 | -S "Read from client: 1 bytes read" \ | 
|  | 2386 | -S "122 bytes read" | 
|  | 2387 |  | 
|  | 2388 | run_test    "CBC Record splitting: TLS 1.1, no splitting" \ | 
|  | 2389 | "$P_SRV" \ | 
|  | 2390 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2391 | request_size=123 force_version=tls1_1" \ | 
|  | 2392 | 0 \ | 
|  | 2393 | -s "Read from client: 123 bytes read" \ | 
|  | 2394 | -S "Read from client: 1 bytes read" \ | 
|  | 2395 | -S "122 bytes read" | 
|  | 2396 |  | 
|  | 2397 | run_test    "CBC Record splitting: TLS 1.0, splitting" \ | 
|  | 2398 | "$P_SRV" \ | 
|  | 2399 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2400 | request_size=123 force_version=tls1" \ | 
|  | 2401 | 0 \ | 
|  | 2402 | -S "Read from client: 123 bytes read" \ | 
|  | 2403 | -s "Read from client: 1 bytes read" \ | 
|  | 2404 | -s "122 bytes read" | 
|  | 2405 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2407 | run_test    "CBC Record splitting: SSLv3, splitting" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2408 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2409 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2410 | request_size=123 force_version=ssl3" \ | 
|  | 2411 | 0 \ | 
|  | 2412 | -S "Read from client: 123 bytes read" \ | 
|  | 2413 | -s "Read from client: 1 bytes read" \ | 
|  | 2414 | -s "122 bytes read" | 
|  | 2415 |  | 
|  | 2416 | 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] | 2417 | "$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] | 2418 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 2419 | request_size=123 force_version=tls1" \ | 
|  | 2420 | 0 \ | 
|  | 2421 | -s "Read from client: 123 bytes read" \ | 
|  | 2422 | -S "Read from client: 1 bytes read" \ | 
|  | 2423 | -S "122 bytes read" | 
|  | 2424 |  | 
|  | 2425 | run_test    "CBC Record splitting: TLS 1.0, splitting disabled" \ | 
|  | 2426 | "$P_SRV" \ | 
|  | 2427 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2428 | request_size=123 force_version=tls1 recsplit=0" \ | 
|  | 2429 | 0 \ | 
|  | 2430 | -s "Read from client: 123 bytes read" \ | 
|  | 2431 | -S "Read from client: 1 bytes read" \ | 
|  | 2432 | -S "122 bytes read" | 
|  | 2433 |  | 
| Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2434 | run_test    "CBC Record splitting: TLS 1.0, splitting, nbio" \ | 
|  | 2435 | "$P_SRV nbio=2" \ | 
|  | 2436 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2437 | request_size=123 force_version=tls1" \ | 
|  | 2438 | 0 \ | 
|  | 2439 | -S "Read from client: 123 bytes read" \ | 
|  | 2440 | -s "Read from client: 1 bytes read" \ | 
|  | 2441 | -s "122 bytes read" | 
|  | 2442 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2443 | # Tests for Session Tickets | 
|  | 2444 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2445 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2446 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2447 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2448 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2449 | -c "client hello, adding session ticket extension" \ | 
|  | 2450 | -s "found session ticket extension" \ | 
|  | 2451 | -s "server hello, adding session ticket extension" \ | 
|  | 2452 | -c "found session_ticket extension" \ | 
|  | 2453 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2454 | -S "session successfully restored from cache" \ | 
|  | 2455 | -s "session successfully restored from ticket" \ | 
|  | 2456 | -s "a session has been resumed" \ | 
|  | 2457 | -c "a session has been resumed" | 
|  | 2458 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2459 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2460 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2461 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2462 | 0 \ | 
|  | 2463 | -c "client hello, adding session ticket extension" \ | 
|  | 2464 | -s "found session ticket extension" \ | 
|  | 2465 | -s "server hello, adding session ticket extension" \ | 
|  | 2466 | -c "found session_ticket extension" \ | 
|  | 2467 | -c "parse new session ticket" \ | 
|  | 2468 | -S "session successfully restored from cache" \ | 
|  | 2469 | -s "session successfully restored from ticket" \ | 
|  | 2470 | -s "a session has been resumed" \ | 
|  | 2471 | -c "a session has been resumed" | 
|  | 2472 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2473 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2474 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 2475 | "$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] | 2476 | 0 \ | 
|  | 2477 | -c "client hello, adding session ticket extension" \ | 
|  | 2478 | -s "found session ticket extension" \ | 
|  | 2479 | -s "server hello, adding session ticket extension" \ | 
|  | 2480 | -c "found session_ticket extension" \ | 
|  | 2481 | -c "parse new session ticket" \ | 
|  | 2482 | -S "session successfully restored from cache" \ | 
|  | 2483 | -S "session successfully restored from ticket" \ | 
|  | 2484 | -S "a session has been resumed" \ | 
|  | 2485 | -C "a session has been resumed" | 
|  | 2486 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2487 | run_test    "Session resume using tickets: session copy" \ | 
|  | 2488 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2489 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ | 
|  | 2490 | 0 \ | 
|  | 2491 | -c "client hello, adding session ticket extension" \ | 
|  | 2492 | -s "found session ticket extension" \ | 
|  | 2493 | -s "server hello, adding session ticket extension" \ | 
|  | 2494 | -c "found session_ticket extension" \ | 
|  | 2495 | -c "parse new session ticket" \ | 
|  | 2496 | -S "session successfully restored from cache" \ | 
|  | 2497 | -s "session successfully restored from ticket" \ | 
|  | 2498 | -s "a session has been resumed" \ | 
|  | 2499 | -c "a session has been resumed" | 
|  | 2500 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2501 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2502 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2503 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2504 | 0 \ | 
|  | 2505 | -c "client hello, adding session ticket extension" \ | 
|  | 2506 | -c "found session_ticket extension" \ | 
|  | 2507 | -c "parse new session ticket" \ | 
|  | 2508 | -c "a session has been resumed" | 
|  | 2509 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2510 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2511 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2512 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2513 | $O_CLI -sess_in $SESSION; \ | 
|  | 2514 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2515 | 0 \ | 
|  | 2516 | -s "found session ticket extension" \ | 
|  | 2517 | -s "server hello, adding session ticket extension" \ | 
|  | 2518 | -S "session successfully restored from cache" \ | 
|  | 2519 | -s "session successfully restored from ticket" \ | 
|  | 2520 | -s "a session has been resumed" | 
|  | 2521 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2522 | # Tests for Session Tickets with DTLS | 
|  | 2523 |  | 
|  | 2524 | run_test    "Session resume using tickets, DTLS: basic" \ | 
|  | 2525 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ | 
|  | 2526 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ | 
|  | 2527 | 0 \ | 
|  | 2528 | -c "client hello, adding session ticket extension" \ | 
|  | 2529 | -s "found session ticket extension" \ | 
|  | 2530 | -s "server hello, adding session ticket extension" \ | 
|  | 2531 | -c "found session_ticket extension" \ | 
|  | 2532 | -c "parse new session ticket" \ | 
|  | 2533 | -S "session successfully restored from cache" \ | 
|  | 2534 | -s "session successfully restored from ticket" \ | 
|  | 2535 | -s "a session has been resumed" \ | 
|  | 2536 | -c "a session has been resumed" | 
|  | 2537 |  | 
|  | 2538 | run_test    "Session resume using tickets, DTLS: cache disabled" \ | 
|  | 2539 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ | 
|  | 2540 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ | 
|  | 2541 | 0 \ | 
|  | 2542 | -c "client hello, adding session ticket extension" \ | 
|  | 2543 | -s "found session ticket extension" \ | 
|  | 2544 | -s "server hello, adding session ticket extension" \ | 
|  | 2545 | -c "found session_ticket extension" \ | 
|  | 2546 | -c "parse new session ticket" \ | 
|  | 2547 | -S "session successfully restored from cache" \ | 
|  | 2548 | -s "session successfully restored from ticket" \ | 
|  | 2549 | -s "a session has been resumed" \ | 
|  | 2550 | -c "a session has been resumed" | 
|  | 2551 |  | 
|  | 2552 | run_test    "Session resume using tickets, DTLS: timeout" \ | 
|  | 2553 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 2554 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ | 
|  | 2555 | 0 \ | 
|  | 2556 | -c "client hello, adding session ticket extension" \ | 
|  | 2557 | -s "found session ticket extension" \ | 
|  | 2558 | -s "server hello, adding session ticket extension" \ | 
|  | 2559 | -c "found session_ticket extension" \ | 
|  | 2560 | -c "parse new session ticket" \ | 
|  | 2561 | -S "session successfully restored from cache" \ | 
|  | 2562 | -S "session successfully restored from ticket" \ | 
|  | 2563 | -S "a session has been resumed" \ | 
|  | 2564 | -C "a session has been resumed" | 
|  | 2565 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2566 | run_test    "Session resume using tickets, DTLS: session copy" \ | 
|  | 2567 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ | 
|  | 2568 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ | 
|  | 2569 | 0 \ | 
|  | 2570 | -c "client hello, adding session ticket extension" \ | 
|  | 2571 | -s "found session ticket extension" \ | 
|  | 2572 | -s "server hello, adding session ticket extension" \ | 
|  | 2573 | -c "found session_ticket extension" \ | 
|  | 2574 | -c "parse new session ticket" \ | 
|  | 2575 | -S "session successfully restored from cache" \ | 
|  | 2576 | -s "session successfully restored from ticket" \ | 
|  | 2577 | -s "a session has been resumed" \ | 
|  | 2578 | -c "a session has been resumed" | 
|  | 2579 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2580 | run_test    "Session resume using tickets, DTLS: openssl server" \ | 
|  | 2581 | "$O_SRV -dtls1" \ | 
|  | 2582 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2583 | 0 \ | 
|  | 2584 | -c "client hello, adding session ticket extension" \ | 
|  | 2585 | -c "found session_ticket extension" \ | 
|  | 2586 | -c "parse new session ticket" \ | 
|  | 2587 | -c "a session has been resumed" | 
|  | 2588 |  | 
|  | 2589 | run_test    "Session resume using tickets, DTLS: openssl client" \ | 
|  | 2590 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
|  | 2591 | "( $O_CLI -dtls1 -sess_out $SESSION; \ | 
|  | 2592 | $O_CLI -dtls1 -sess_in $SESSION; \ | 
|  | 2593 | rm -f $SESSION )" \ | 
|  | 2594 | 0 \ | 
|  | 2595 | -s "found session ticket extension" \ | 
|  | 2596 | -s "server hello, adding session ticket extension" \ | 
|  | 2597 | -S "session successfully restored from cache" \ | 
|  | 2598 | -s "session successfully restored from ticket" \ | 
|  | 2599 | -s "a session has been resumed" | 
|  | 2600 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2601 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2602 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2603 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2604 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2605 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2606 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2607 | -c "client hello, adding session ticket extension" \ | 
|  | 2608 | -s "found session ticket extension" \ | 
|  | 2609 | -S "server hello, adding session ticket extension" \ | 
|  | 2610 | -C "found session_ticket extension" \ | 
|  | 2611 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2612 | -s "session successfully restored from cache" \ | 
|  | 2613 | -S "session successfully restored from ticket" \ | 
|  | 2614 | -s "a session has been resumed" \ | 
|  | 2615 | -c "a session has been resumed" | 
|  | 2616 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2617 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2618 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2619 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2620 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2621 | -C "client hello, adding session ticket extension" \ | 
|  | 2622 | -S "found session ticket extension" \ | 
|  | 2623 | -S "server hello, adding session ticket extension" \ | 
|  | 2624 | -C "found session_ticket extension" \ | 
|  | 2625 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2626 | -s "session successfully restored from cache" \ | 
|  | 2627 | -S "session successfully restored from ticket" \ | 
|  | 2628 | -s "a session has been resumed" \ | 
|  | 2629 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2630 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2631 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2632 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 2633 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2634 | 0 \ | 
|  | 2635 | -S "session successfully restored from cache" \ | 
|  | 2636 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2637 | -S "a session has been resumed" \ | 
|  | 2638 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2639 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2640 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2641 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 2642 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2643 | 0 \ | 
|  | 2644 | -s "session successfully restored from cache" \ | 
|  | 2645 | -S "session successfully restored from ticket" \ | 
|  | 2646 | -s "a session has been resumed" \ | 
|  | 2647 | -c "a session has been resumed" | 
|  | 2648 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2649 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2650 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2651 | "$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] | 2652 | 0 \ | 
|  | 2653 | -s "session successfully restored from cache" \ | 
|  | 2654 | -S "session successfully restored from ticket" \ | 
|  | 2655 | -s "a session has been resumed" \ | 
|  | 2656 | -c "a session has been resumed" | 
|  | 2657 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2658 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2659 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 2660 | "$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] | 2661 | 0 \ | 
|  | 2662 | -S "session successfully restored from cache" \ | 
|  | 2663 | -S "session successfully restored from ticket" \ | 
|  | 2664 | -S "a session has been resumed" \ | 
|  | 2665 | -C "a session has been resumed" | 
|  | 2666 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2667 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2668 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 2669 | "$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] | 2670 | 0 \ | 
|  | 2671 | -s "session successfully restored from cache" \ | 
|  | 2672 | -S "session successfully restored from ticket" \ | 
|  | 2673 | -s "a session has been resumed" \ | 
|  | 2674 | -c "a session has been resumed" | 
|  | 2675 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2676 | run_test    "Session resume using cache: session copy" \ | 
|  | 2677 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2678 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
|  | 2679 | 0 \ | 
|  | 2680 | -s "session successfully restored from cache" \ | 
|  | 2681 | -S "session successfully restored from ticket" \ | 
|  | 2682 | -s "a session has been resumed" \ | 
|  | 2683 | -c "a session has been resumed" | 
|  | 2684 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2685 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2686 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2687 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2688 | $O_CLI -sess_in $SESSION; \ | 
|  | 2689 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2690 | 0 \ | 
|  | 2691 | -s "found session ticket extension" \ | 
|  | 2692 | -S "server hello, adding session ticket extension" \ | 
|  | 2693 | -s "session successfully restored from cache" \ | 
|  | 2694 | -S "session successfully restored from ticket" \ | 
|  | 2695 | -s "a session has been resumed" | 
|  | 2696 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2697 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2698 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2699 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2700 | 0 \ | 
|  | 2701 | -C "found session_ticket extension" \ | 
|  | 2702 | -C "parse new session ticket" \ | 
|  | 2703 | -c "a session has been resumed" | 
|  | 2704 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2705 | # Tests for Session Resume based on session-ID and cache, DTLS | 
|  | 2706 |  | 
|  | 2707 | run_test    "Session resume using cache, DTLS: tickets enabled on client" \ | 
|  | 2708 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
|  | 2709 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2710 | 0 \ | 
|  | 2711 | -c "client hello, adding session ticket extension" \ | 
|  | 2712 | -s "found session ticket extension" \ | 
|  | 2713 | -S "server hello, adding session ticket extension" \ | 
|  | 2714 | -C "found session_ticket extension" \ | 
|  | 2715 | -C "parse new session ticket" \ | 
|  | 2716 | -s "session successfully restored from cache" \ | 
|  | 2717 | -S "session successfully restored from ticket" \ | 
|  | 2718 | -s "a session has been resumed" \ | 
|  | 2719 | -c "a session has been resumed" | 
|  | 2720 |  | 
|  | 2721 | run_test    "Session resume using cache, DTLS: tickets enabled on server" \ | 
|  | 2722 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
|  | 2723 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 2724 | 0 \ | 
|  | 2725 | -C "client hello, adding session ticket extension" \ | 
|  | 2726 | -S "found session ticket extension" \ | 
|  | 2727 | -S "server hello, adding session ticket extension" \ | 
|  | 2728 | -C "found session_ticket extension" \ | 
|  | 2729 | -C "parse new session ticket" \ | 
|  | 2730 | -s "session successfully restored from cache" \ | 
|  | 2731 | -S "session successfully restored from ticket" \ | 
|  | 2732 | -s "a session has been resumed" \ | 
|  | 2733 | -c "a session has been resumed" | 
|  | 2734 |  | 
|  | 2735 | run_test    "Session resume using cache, DTLS: cache_max=0" \ | 
|  | 2736 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ | 
|  | 2737 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 2738 | 0 \ | 
|  | 2739 | -S "session successfully restored from cache" \ | 
|  | 2740 | -S "session successfully restored from ticket" \ | 
|  | 2741 | -S "a session has been resumed" \ | 
|  | 2742 | -C "a session has been resumed" | 
|  | 2743 |  | 
|  | 2744 | run_test    "Session resume using cache, DTLS: cache_max=1" \ | 
|  | 2745 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ | 
|  | 2746 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 2747 | 0 \ | 
|  | 2748 | -s "session successfully restored from cache" \ | 
|  | 2749 | -S "session successfully restored from ticket" \ | 
|  | 2750 | -s "a session has been resumed" \ | 
|  | 2751 | -c "a session has been resumed" | 
|  | 2752 |  | 
|  | 2753 | run_test    "Session resume using cache, DTLS: timeout > delay" \ | 
|  | 2754 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
|  | 2755 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ | 
|  | 2756 | 0 \ | 
|  | 2757 | -s "session successfully restored from cache" \ | 
|  | 2758 | -S "session successfully restored from ticket" \ | 
|  | 2759 | -s "a session has been resumed" \ | 
|  | 2760 | -c "a session has been resumed" | 
|  | 2761 |  | 
|  | 2762 | run_test    "Session resume using cache, DTLS: timeout < delay" \ | 
|  | 2763 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 2764 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ | 
|  | 2765 | 0 \ | 
|  | 2766 | -S "session successfully restored from cache" \ | 
|  | 2767 | -S "session successfully restored from ticket" \ | 
|  | 2768 | -S "a session has been resumed" \ | 
|  | 2769 | -C "a session has been resumed" | 
|  | 2770 |  | 
|  | 2771 | run_test    "Session resume using cache, DTLS: no timeout" \ | 
|  | 2772 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 2773 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ | 
|  | 2774 | 0 \ | 
|  | 2775 | -s "session successfully restored from cache" \ | 
|  | 2776 | -S "session successfully restored from ticket" \ | 
|  | 2777 | -s "a session has been resumed" \ | 
|  | 2778 | -c "a session has been resumed" | 
|  | 2779 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2780 | run_test    "Session resume using cache, DTLS: session copy" \ | 
|  | 2781 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
|  | 2782 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
|  | 2783 | 0 \ | 
|  | 2784 | -s "session successfully restored from cache" \ | 
|  | 2785 | -S "session successfully restored from ticket" \ | 
|  | 2786 | -s "a session has been resumed" \ | 
|  | 2787 | -c "a session has been resumed" | 
|  | 2788 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2789 | run_test    "Session resume using cache, DTLS: openssl client" \ | 
|  | 2790 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
|  | 2791 | "( $O_CLI -dtls1 -sess_out $SESSION; \ | 
|  | 2792 | $O_CLI -dtls1 -sess_in $SESSION; \ | 
|  | 2793 | rm -f $SESSION )" \ | 
|  | 2794 | 0 \ | 
|  | 2795 | -s "found session ticket extension" \ | 
|  | 2796 | -S "server hello, adding session ticket extension" \ | 
|  | 2797 | -s "session successfully restored from cache" \ | 
|  | 2798 | -S "session successfully restored from ticket" \ | 
|  | 2799 | -s "a session has been resumed" | 
|  | 2800 |  | 
|  | 2801 | run_test    "Session resume using cache, DTLS: openssl server" \ | 
|  | 2802 | "$O_SRV -dtls1" \ | 
|  | 2803 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 2804 | 0 \ | 
|  | 2805 | -C "found session_ticket extension" \ | 
|  | 2806 | -C "parse new session ticket" \ | 
|  | 2807 | -c "a session has been resumed" | 
|  | 2808 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2809 | # Tests for Max Fragment Length extension | 
|  | 2810 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2811 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then | 
|  | 2812 | 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] | 2813 | exit 1 | 
|  | 2814 | fi | 
|  | 2815 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2816 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then | 
|  | 2817 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" | 
|  | 2818 | fi | 
|  | 2819 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2820 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2821 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2822 | "$P_SRV debug_level=3" \ | 
|  | 2823 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2824 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2825 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 2826 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2827 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2828 | -S "found max fragment length extension" \ | 
|  | 2829 | -S "server hello, max_fragment_length extension" \ | 
|  | 2830 | -C "found max_fragment_length extension" | 
|  | 2831 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2832 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2833 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 2834 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2835 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2836 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2837 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 2838 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2839 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2840 | -S "found max fragment length extension" \ | 
|  | 2841 | -S "server hello, max_fragment_length extension" \ | 
|  | 2842 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2843 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 2844 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2845 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2846 |  | 
|  | 2847 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 2848 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 2849 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2850 | "$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] | 2851 | 1 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2852 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 2853 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2854 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2855 | -S "found max fragment length extension" \ | 
|  | 2856 | -S "server hello, max_fragment_length extension" \ | 
|  | 2857 | -C "found max_fragment_length extension" \ | 
|  | 2858 | -c "fragment larger than.*maximum " | 
|  | 2859 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2860 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 2861 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 2862 | # content length configuration.) | 
|  | 2863 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2864 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 2865 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 2866 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2867 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2868 | 0 \ | 
|  | 2869 | -C "Maximum fragment length is 16384" \ | 
|  | 2870 | -S "Maximum fragment length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2871 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 2872 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2873 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2874 |  | 
|  | 2875 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 2876 | run_test    "Max fragment length DTLS: disabled, larger message" \ | 
|  | 2877 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2878 | "$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] | 2879 | 1 \ | 
|  | 2880 | -C "Maximum fragment length is 16384" \ | 
|  | 2881 | -S "Maximum fragment length is 16384" \ | 
|  | 2882 | -c "fragment larger than.*maximum " | 
|  | 2883 |  | 
|  | 2884 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2885 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2886 | "$P_SRV debug_level=3" \ | 
|  | 2887 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2888 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2889 | -c "Maximum fragment length is 4096" \ | 
|  | 2890 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2891 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 2892 | -s "found max fragment length extension" \ | 
|  | 2893 | -s "server hello, max_fragment_length extension" \ | 
|  | 2894 | -c "found max_fragment_length extension" | 
|  | 2895 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2896 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2897 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2898 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 2899 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2900 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2901 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2902 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2903 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 2904 | -S "found max fragment length extension" \ | 
|  | 2905 | -S "server hello, max_fragment_length extension" \ | 
|  | 2906 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2907 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2908 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2909 | requires_gnutls | 
|  | 2910 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2911 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2912 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2913 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2914 | -c "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2915 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 2916 | -c "found max_fragment_length extension" | 
|  | 2917 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2918 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2919 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 2920 | "$P_SRV debug_level=3" \ | 
|  | 2921 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 2922 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2923 | -c "Maximum fragment length is 2048" \ | 
|  | 2924 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2925 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 2926 | -s "found max fragment length extension" \ | 
|  | 2927 | -s "server hello, max_fragment_length extension" \ | 
|  | 2928 | -c "found max_fragment_length extension" \ | 
|  | 2929 | -c "2048 bytes written in 1 fragments" \ | 
|  | 2930 | -s "2048 bytes read" | 
|  | 2931 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2932 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2933 | run_test    "Max fragment length: client, larger message" \ | 
|  | 2934 | "$P_SRV debug_level=3" \ | 
|  | 2935 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 2936 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2937 | -c "Maximum fragment length is 2048" \ | 
|  | 2938 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2939 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 2940 | -s "found max fragment length extension" \ | 
|  | 2941 | -s "server hello, max_fragment_length extension" \ | 
|  | 2942 | -c "found max_fragment_length extension" \ | 
|  | 2943 | -c "2345 bytes written in 2 fragments" \ | 
|  | 2944 | -s "2048 bytes read" \ | 
|  | 2945 | -s "297 bytes read" | 
|  | 2946 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2947 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2948 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2949 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 2950 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 2951 | 1 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2952 | -c "Maximum fragment length is 2048" \ | 
|  | 2953 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2954 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 2955 | -s "found max fragment length extension" \ | 
|  | 2956 | -s "server hello, max_fragment_length extension" \ | 
|  | 2957 | -c "found max_fragment_length extension" \ | 
|  | 2958 | -c "fragment larger than.*maximum" | 
|  | 2959 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2960 | # Tests for renegotiation | 
|  | 2961 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2962 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2963 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2964 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2965 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2966 | 0 \ | 
|  | 2967 | -C "client hello, adding renegotiation extension" \ | 
|  | 2968 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2969 | -S "found renegotiation extension" \ | 
|  | 2970 | -s "server hello, secure renegotiation extension" \ | 
|  | 2971 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2972 | -C "=> renegotiate" \ | 
|  | 2973 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2974 | -S "write hello request" | 
|  | 2975 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2976 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2977 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2978 | "$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] | 2979 | "$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] | 2980 | 0 \ | 
|  | 2981 | -c "client hello, adding renegotiation extension" \ | 
|  | 2982 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2983 | -s "found renegotiation extension" \ | 
|  | 2984 | -s "server hello, secure renegotiation extension" \ | 
|  | 2985 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2986 | -c "=> renegotiate" \ | 
|  | 2987 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2988 | -S "write hello request" | 
|  | 2989 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2990 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2991 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2992 | "$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] | 2993 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2994 | 0 \ | 
|  | 2995 | -c "client hello, adding renegotiation extension" \ | 
|  | 2996 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2997 | -s "found renegotiation extension" \ | 
|  | 2998 | -s "server hello, secure renegotiation extension" \ | 
|  | 2999 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3000 | -c "=> renegotiate" \ | 
|  | 3001 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3002 | -s "write hello request" | 
|  | 3003 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3004 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3005 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 3006 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3007 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3008 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 3009 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 3010 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3011 | 0 \ | 
|  | 3012 | -c "client hello, adding renegotiation extension" \ | 
|  | 3013 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3014 | -s "found renegotiation extension" \ | 
|  | 3015 | -s "server hello, secure renegotiation extension" \ | 
|  | 3016 | -c "found renegotiation extension" \ | 
|  | 3017 | -c "=> renegotiate" \ | 
|  | 3018 | -s "=> renegotiate" \ | 
|  | 3019 | -S "write hello request" \ | 
|  | 3020 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3021 |  | 
|  | 3022 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3023 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 3024 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3025 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3026 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 3027 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 3028 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3029 | 0 \ | 
|  | 3030 | -c "client hello, adding renegotiation extension" \ | 
|  | 3031 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3032 | -s "found renegotiation extension" \ | 
|  | 3033 | -s "server hello, secure renegotiation extension" \ | 
|  | 3034 | -c "found renegotiation extension" \ | 
|  | 3035 | -c "=> renegotiate" \ | 
|  | 3036 | -s "=> renegotiate" \ | 
|  | 3037 | -s "write hello request" \ | 
|  | 3038 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3039 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3041 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3042 | "$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] | 3043 | "$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] | 3044 | 0 \ | 
|  | 3045 | -c "client hello, adding renegotiation extension" \ | 
|  | 3046 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3047 | -s "found renegotiation extension" \ | 
|  | 3048 | -s "server hello, secure renegotiation extension" \ | 
|  | 3049 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3050 | -c "=> renegotiate" \ | 
|  | 3051 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3052 | -s "write hello request" | 
|  | 3053 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3055 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3056 | "$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] | 3057 | "$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] | 3058 | 1 \ | 
|  | 3059 | -c "client hello, adding renegotiation extension" \ | 
|  | 3060 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3061 | -S "found renegotiation extension" \ | 
|  | 3062 | -s "server hello, secure renegotiation extension" \ | 
|  | 3063 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3064 | -c "=> renegotiate" \ | 
|  | 3065 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3066 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3067 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3068 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3069 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3070 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3071 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3072 | "$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] | 3073 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3074 | 0 \ | 
|  | 3075 | -C "client hello, adding renegotiation extension" \ | 
|  | 3076 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3077 | -S "found renegotiation extension" \ | 
|  | 3078 | -s "server hello, secure renegotiation extension" \ | 
|  | 3079 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3080 | -C "=> renegotiate" \ | 
|  | 3081 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3082 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3083 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3084 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3085 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3087 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3088 | "$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] | 3089 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3090 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3091 | 0 \ | 
|  | 3092 | -C "client hello, adding renegotiation extension" \ | 
|  | 3093 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3094 | -S "found renegotiation extension" \ | 
|  | 3095 | -s "server hello, secure renegotiation extension" \ | 
|  | 3096 | -c "found renegotiation extension" \ | 
|  | 3097 | -C "=> renegotiate" \ | 
|  | 3098 | -S "=> renegotiate" \ | 
|  | 3099 | -s "write hello request" \ | 
|  | 3100 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3101 | -S "failed" | 
|  | 3102 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3103 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3104 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3105 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3106 | "$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] | 3107 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3108 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3109 | 0 \ | 
|  | 3110 | -C "client hello, adding renegotiation extension" \ | 
|  | 3111 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3112 | -S "found renegotiation extension" \ | 
|  | 3113 | -s "server hello, secure renegotiation extension" \ | 
|  | 3114 | -c "found renegotiation extension" \ | 
|  | 3115 | -C "=> renegotiate" \ | 
|  | 3116 | -S "=> renegotiate" \ | 
|  | 3117 | -s "write hello request" \ | 
|  | 3118 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3119 | -S "failed" | 
|  | 3120 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3122 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3123 | "$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] | 3124 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3125 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3126 | 0 \ | 
|  | 3127 | -C "client hello, adding renegotiation extension" \ | 
|  | 3128 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3129 | -S "found renegotiation extension" \ | 
|  | 3130 | -s "server hello, secure renegotiation extension" \ | 
|  | 3131 | -c "found renegotiation extension" \ | 
|  | 3132 | -C "=> renegotiate" \ | 
|  | 3133 | -S "=> renegotiate" \ | 
|  | 3134 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3135 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3136 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3138 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3139 | "$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] | 3140 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3141 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3142 | 0 \ | 
|  | 3143 | -c "client hello, adding renegotiation extension" \ | 
|  | 3144 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3145 | -s "found renegotiation extension" \ | 
|  | 3146 | -s "server hello, secure renegotiation extension" \ | 
|  | 3147 | -c "found renegotiation extension" \ | 
|  | 3148 | -c "=> renegotiate" \ | 
|  | 3149 | -s "=> renegotiate" \ | 
|  | 3150 | -s "write hello request" \ | 
|  | 3151 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3152 | -S "failed" | 
|  | 3153 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3154 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3155 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3156 | "$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] | 3157 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3158 | 0 \ | 
|  | 3159 | -C "client hello, adding renegotiation extension" \ | 
|  | 3160 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3161 | -S "found renegotiation extension" \ | 
|  | 3162 | -s "server hello, secure renegotiation extension" \ | 
|  | 3163 | -c "found renegotiation extension" \ | 
|  | 3164 | -S "record counter limit reached: renegotiate" \ | 
|  | 3165 | -C "=> renegotiate" \ | 
|  | 3166 | -S "=> renegotiate" \ | 
|  | 3167 | -S "write hello request" \ | 
|  | 3168 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3169 | -S "failed" | 
|  | 3170 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3171 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3172 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3173 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3174 | "$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] | 3175 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3176 | 0 \ | 
|  | 3177 | -c "client hello, adding renegotiation extension" \ | 
|  | 3178 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3179 | -s "found renegotiation extension" \ | 
|  | 3180 | -s "server hello, secure renegotiation extension" \ | 
|  | 3181 | -c "found renegotiation extension" \ | 
|  | 3182 | -s "record counter limit reached: renegotiate" \ | 
|  | 3183 | -c "=> renegotiate" \ | 
|  | 3184 | -s "=> renegotiate" \ | 
|  | 3185 | -s "write hello request" \ | 
|  | 3186 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3187 | -S "failed" | 
|  | 3188 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3190 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3191 | "$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] | 3192 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3193 | 0 \ | 
|  | 3194 | -c "client hello, adding renegotiation extension" \ | 
|  | 3195 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3196 | -s "found renegotiation extension" \ | 
|  | 3197 | -s "server hello, secure renegotiation extension" \ | 
|  | 3198 | -c "found renegotiation extension" \ | 
|  | 3199 | -s "record counter limit reached: renegotiate" \ | 
|  | 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 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3207 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3208 | "$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] | 3209 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 3210 | 0 \ | 
|  | 3211 | -C "client hello, adding renegotiation extension" \ | 
|  | 3212 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3213 | -S "found renegotiation extension" \ | 
|  | 3214 | -s "server hello, secure renegotiation extension" \ | 
|  | 3215 | -c "found renegotiation extension" \ | 
|  | 3216 | -S "record counter limit reached: renegotiate" \ | 
|  | 3217 | -C "=> renegotiate" \ | 
|  | 3218 | -S "=> renegotiate" \ | 
|  | 3219 | -S "write hello request" \ | 
|  | 3220 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3221 | -S "failed" | 
|  | 3222 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3223 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3224 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3225 | "$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] | 3226 | "$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] | 3227 | 0 \ | 
|  | 3228 | -c "client hello, adding renegotiation extension" \ | 
|  | 3229 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3230 | -s "found renegotiation extension" \ | 
|  | 3231 | -s "server hello, secure renegotiation extension" \ | 
|  | 3232 | -c "found renegotiation extension" \ | 
|  | 3233 | -c "=> renegotiate" \ | 
|  | 3234 | -s "=> renegotiate" \ | 
|  | 3235 | -S "write hello request" | 
|  | 3236 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3237 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3238 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3239 | "$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] | 3240 | "$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] | 3241 | 0 \ | 
|  | 3242 | -c "client hello, adding renegotiation extension" \ | 
|  | 3243 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3244 | -s "found renegotiation extension" \ | 
|  | 3245 | -s "server hello, secure renegotiation extension" \ | 
|  | 3246 | -c "found renegotiation extension" \ | 
|  | 3247 | -c "=> renegotiate" \ | 
|  | 3248 | -s "=> renegotiate" \ | 
|  | 3249 | -s "write hello request" | 
|  | 3250 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3251 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3252 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3253 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3254 | "$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] | 3255 | 0 \ | 
|  | 3256 | -c "client hello, adding renegotiation extension" \ | 
|  | 3257 | -c "found renegotiation extension" \ | 
|  | 3258 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3259 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3260 | -C "error" \ | 
|  | 3261 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3262 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3263 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3264 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3265 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 3266 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3267 | "$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] | 3268 | 0 \ | 
|  | 3269 | -c "client hello, adding renegotiation extension" \ | 
|  | 3270 | -c "found renegotiation extension" \ | 
|  | 3271 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3272 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3273 | -C "error" \ | 
|  | 3274 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3275 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3276 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3277 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3278 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 3279 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3280 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3281 | 1 \ | 
|  | 3282 | -c "client hello, adding renegotiation extension" \ | 
|  | 3283 | -C "found renegotiation extension" \ | 
|  | 3284 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3285 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3286 | -c "error" \ | 
|  | 3287 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3288 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3289 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3290 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3291 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 3292 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3293 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3294 | allow_legacy=0" \ | 
|  | 3295 | 1 \ | 
|  | 3296 | -c "client hello, adding renegotiation extension" \ | 
|  | 3297 | -C "found renegotiation extension" \ | 
|  | 3298 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3299 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3300 | -c "error" \ | 
|  | 3301 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3302 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3303 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3305 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 3306 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3307 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3308 | allow_legacy=1" \ | 
|  | 3309 | 0 \ | 
|  | 3310 | -c "client hello, adding renegotiation extension" \ | 
|  | 3311 | -C "found renegotiation extension" \ | 
|  | 3312 | -c "=> renegotiate" \ | 
|  | 3313 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3314 | -C "error" \ | 
|  | 3315 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3316 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3317 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3318 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 3319 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 3320 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3321 | 0 \ | 
|  | 3322 | -c "client hello, adding renegotiation extension" \ | 
|  | 3323 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3324 | -s "found renegotiation extension" \ | 
|  | 3325 | -s "server hello, secure renegotiation extension" \ | 
|  | 3326 | -c "found renegotiation extension" \ | 
|  | 3327 | -c "=> renegotiate" \ | 
|  | 3328 | -s "=> renegotiate" \ | 
|  | 3329 | -S "write hello request" | 
|  | 3330 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3332 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 3333 | "$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] | 3334 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 3335 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3336 | 0 \ | 
|  | 3337 | -c "client hello, adding renegotiation extension" \ | 
|  | 3338 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3339 | -s "found renegotiation extension" \ | 
|  | 3340 | -s "server hello, secure renegotiation extension" \ | 
|  | 3341 | -c "found renegotiation extension" \ | 
|  | 3342 | -c "=> renegotiate" \ | 
|  | 3343 | -s "=> renegotiate" \ | 
|  | 3344 | -s "write hello request" | 
|  | 3345 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3347 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 3348 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 3349 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 3350 | 0 \ | 
|  | 3351 | -c "client hello, adding renegotiation extension" \ | 
|  | 3352 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3353 | -s "found renegotiation extension" \ | 
|  | 3354 | -s "server hello, secure renegotiation extension" \ | 
|  | 3355 | -s "record counter limit reached: renegotiate" \ | 
|  | 3356 | -c "=> renegotiate" \ | 
|  | 3357 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3358 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3359 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3360 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3362 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 3363 | "$G_SRV -u --mtu 4096" \ | 
|  | 3364 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3365 | 0 \ | 
|  | 3366 | -c "client hello, adding renegotiation extension" \ | 
|  | 3367 | -c "found renegotiation extension" \ | 
|  | 3368 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3369 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3370 | -C "error" \ | 
|  | 3371 | -s "Extra-header:" | 
|  | 3372 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3373 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 3374 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3375 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3376 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 3377 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 3378 | "$P_CLI debug_level=3" \ | 
|  | 3379 | 0 \ | 
|  | 3380 | -c "found renegotiation extension" \ | 
|  | 3381 | -C "error" \ | 
|  | 3382 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3383 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3384 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3385 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 3386 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3387 | "$P_CLI debug_level=3" \ | 
|  | 3388 | 0 \ | 
|  | 3389 | -C "found renegotiation extension" \ | 
|  | 3390 | -C "error" \ | 
|  | 3391 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3392 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3393 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3394 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 3395 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3396 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 3397 | 1 \ | 
|  | 3398 | -C "found renegotiation extension" \ | 
|  | 3399 | -c "error" \ | 
|  | 3400 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3401 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3402 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3403 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 3404 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3405 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3406 | 0 \ | 
|  | 3407 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3408 | -s "server hello, secure renegotiation extension" | 
|  | 3409 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3410 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3411 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 3412 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3413 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3414 | 0 \ | 
|  | 3415 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3416 | -S "server hello, secure renegotiation extension" | 
|  | 3417 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3418 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3419 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 3420 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3421 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3422 | 1 \ | 
|  | 3423 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3424 | -S "server hello, secure renegotiation extension" | 
|  | 3425 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3426 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 3427 |  | 
|  | 3428 | requires_gnutls | 
|  | 3429 | run_test    "DER format: no trailing bytes" \ | 
|  | 3430 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 3431 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3432 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3433 | 0 \ | 
|  | 3434 | -c "Handshake was completed" \ | 
|  | 3435 |  | 
|  | 3436 | requires_gnutls | 
|  | 3437 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 3438 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 3439 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3440 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3441 | 0 \ | 
|  | 3442 | -c "Handshake was completed" \ | 
|  | 3443 |  | 
|  | 3444 | requires_gnutls | 
|  | 3445 | run_test    "DER format: with a trailing random byte" \ | 
|  | 3446 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 3447 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3448 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3449 | 0 \ | 
|  | 3450 | -c "Handshake was completed" \ | 
|  | 3451 |  | 
|  | 3452 | requires_gnutls | 
|  | 3453 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 3454 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 3455 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3456 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3457 | 0 \ | 
|  | 3458 | -c "Handshake was completed" \ | 
|  | 3459 |  | 
|  | 3460 | requires_gnutls | 
|  | 3461 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 3462 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 3463 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3464 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3465 | 0 \ | 
|  | 3466 | -c "Handshake was completed" \ | 
|  | 3467 |  | 
|  | 3468 | requires_gnutls | 
|  | 3469 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 3470 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 3471 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3472 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3473 | 0 \ | 
|  | 3474 | -c "Handshake was completed" \ | 
|  | 3475 |  | 
|  | 3476 | requires_gnutls | 
|  | 3477 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 3478 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 3479 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3480 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3481 | 0 \ | 
|  | 3482 | -c "Handshake was completed" \ | 
|  | 3483 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3484 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication | 
|  | 3485 | # When updating these tests, modify the matching authentication tests accordingly | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3486 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3487 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3488 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3489 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3490 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3491 | 1 \ | 
|  | 3492 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3493 | -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] | 3494 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3495 | -c "X509 - Certificate verification failed" | 
|  | 3496 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3497 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3498 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3499 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3500 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3501 | 0 \ | 
|  | 3502 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3503 | -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] | 3504 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3505 | -C "X509 - Certificate verification failed" | 
|  | 3506 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3507 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 3508 | "$P_SRV" \ | 
|  | 3509 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 3510 | 0 \ | 
|  | 3511 | -c "x509_verify_cert() returned" \ | 
|  | 3512 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3513 | -c "! Certificate verification flags"\ | 
|  | 3514 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 3515 | -C "X509 - Certificate verification failed" \ | 
|  | 3516 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 3517 |  | 
|  | 3518 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 3519 | "$P_SRV" \ | 
|  | 3520 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 3521 | 1 \ | 
|  | 3522 | -c "x509_verify_cert() returned" \ | 
|  | 3523 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3524 | -c "! Certificate verification flags"\ | 
|  | 3525 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3526 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 3527 |  | 
|  | 3528 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 3529 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 3530 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 3531 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 3532 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 3533 | # different means to have the server ignoring the client's supported curve list. | 
|  | 3534 |  | 
|  | 3535 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3536 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 3537 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3538 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3539 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 3540 | 1 \ | 
|  | 3541 | -c "bad certificate (EC key curve)"\ | 
|  | 3542 | -c "! Certificate verification flags"\ | 
|  | 3543 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 3544 |  | 
|  | 3545 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3546 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 3547 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3548 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3549 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 3550 | 1 \ | 
|  | 3551 | -c "bad certificate (EC key curve)"\ | 
|  | 3552 | -c "! Certificate verification flags"\ | 
|  | 3553 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 3554 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3555 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3556 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3557 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3558 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3559 | 0 \ | 
|  | 3560 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3561 | -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] | 3562 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3563 | -C "X509 - Certificate verification failed" | 
|  | 3564 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3565 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 3566 | "$P_SRV auth_mode=required" \ | 
|  | 3567 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3568 | key_file=data_files/server6.key \ | 
|  | 3569 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 3570 | 0 \ | 
|  | 3571 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3572 | -c "Supported Signature Algorithm found: 5," | 
|  | 3573 |  | 
|  | 3574 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 3575 | "$P_SRV auth_mode=required" \ | 
|  | 3576 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3577 | key_file=data_files/server6.key \ | 
|  | 3578 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 3579 | 0 \ | 
|  | 3580 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3581 | -c "Supported Signature Algorithm found: 5," | 
|  | 3582 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3583 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 3584 | run_test    "Authentication: client has no cert, server required (SSLv3)" \ | 
|  | 3585 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ | 
|  | 3586 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ | 
|  | 3587 | key_file=data_files/server5.key" \ | 
|  | 3588 | 1 \ | 
|  | 3589 | -S "skip write certificate request" \ | 
|  | 3590 | -C "skip parse certificate request" \ | 
|  | 3591 | -c "got a certificate request" \ | 
|  | 3592 | -c "got no certificate to send" \ | 
|  | 3593 | -S "x509_verify_cert() returned" \ | 
|  | 3594 | -s "client has no certificate" \ | 
|  | 3595 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3596 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3597 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 3598 |  | 
|  | 3599 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 3600 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3601 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 3602 | key_file=data_files/server5.key" \ | 
|  | 3603 | 1 \ | 
|  | 3604 | -S "skip write certificate request" \ | 
|  | 3605 | -C "skip parse certificate request" \ | 
|  | 3606 | -c "got a certificate request" \ | 
|  | 3607 | -c "= write certificate$" \ | 
|  | 3608 | -C "skip write certificate$" \ | 
|  | 3609 | -S "x509_verify_cert() returned" \ | 
|  | 3610 | -s "client has no certificate" \ | 
|  | 3611 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3612 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3613 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 3614 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3615 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3616 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3617 | "$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] | 3618 | key_file=data_files/server5.key" \ | 
|  | 3619 | 1 \ | 
|  | 3620 | -S "skip write certificate request" \ | 
|  | 3621 | -C "skip parse certificate request" \ | 
|  | 3622 | -c "got a certificate request" \ | 
|  | 3623 | -C "skip write certificate" \ | 
|  | 3624 | -C "skip write certificate verify" \ | 
|  | 3625 | -S "skip parse certificate verify" \ | 
|  | 3626 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3627 | -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] | 3628 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3629 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3630 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3631 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3632 | # We don't check that the client receives the alert because it might | 
|  | 3633 | # detect that its write end of the connection is closed and abort | 
|  | 3634 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3635 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3636 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 3637 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3638 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 3639 | key_file=data_files/server5.key" \ | 
|  | 3640 | 1 \ | 
|  | 3641 | -S "skip write certificate request" \ | 
|  | 3642 | -C "skip parse certificate request" \ | 
|  | 3643 | -c "got a certificate request" \ | 
|  | 3644 | -C "skip write certificate" \ | 
|  | 3645 | -C "skip write certificate verify" \ | 
|  | 3646 | -S "skip parse certificate verify" \ | 
|  | 3647 | -s "x509_verify_cert() returned" \ | 
|  | 3648 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3649 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3650 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3651 | -s "X509 - Certificate verification failed" | 
|  | 3652 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3653 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3654 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 3655 | "$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] | 3656 | key_file=data_files/server5.key" \ | 
|  | 3657 | 0 \ | 
|  | 3658 | -S "skip write certificate request" \ | 
|  | 3659 | -C "skip parse certificate request" \ | 
|  | 3660 | -c "got a certificate request" \ | 
|  | 3661 | -C "skip write certificate" \ | 
|  | 3662 | -C "skip write certificate verify" \ | 
|  | 3663 | -S "skip parse certificate verify" \ | 
|  | 3664 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3665 | -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] | 3666 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 3667 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3668 | -S "X509 - Certificate verification failed" | 
|  | 3669 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3670 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3671 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 3672 | "$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] | 3673 | key_file=data_files/server5.key" \ | 
|  | 3674 | 0 \ | 
|  | 3675 | -s "skip write certificate request" \ | 
|  | 3676 | -C "skip parse certificate request" \ | 
|  | 3677 | -c "got no certificate request" \ | 
|  | 3678 | -c "skip write certificate" \ | 
|  | 3679 | -c "skip write certificate verify" \ | 
|  | 3680 | -s "skip parse certificate verify" \ | 
|  | 3681 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3682 | -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] | 3683 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 3684 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3685 | -S "X509 - Certificate verification failed" | 
|  | 3686 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3687 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3688 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 3689 | "$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] | 3690 | 0 \ | 
|  | 3691 | -S "skip write certificate request" \ | 
|  | 3692 | -C "skip parse certificate request" \ | 
|  | 3693 | -c "got a certificate request" \ | 
|  | 3694 | -C "skip write certificate$" \ | 
|  | 3695 | -C "got no certificate to send" \ | 
|  | 3696 | -S "SSLv3 client has no certificate" \ | 
|  | 3697 | -c "skip write certificate verify" \ | 
|  | 3698 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3699 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3700 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 3701 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3702 | -S "X509 - Certificate verification failed" | 
|  | 3703 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3704 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3705 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3706 | "$O_CLI" \ | 
|  | 3707 | 0 \ | 
|  | 3708 | -S "skip write certificate request" \ | 
|  | 3709 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3710 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3711 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3712 | -S "X509 - Certificate verification failed" | 
|  | 3713 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3714 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3715 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3716 | "$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] | 3717 | 0 \ | 
|  | 3718 | -C "skip parse certificate request" \ | 
|  | 3719 | -c "got a certificate request" \ | 
|  | 3720 | -C "skip write certificate$" \ | 
|  | 3721 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3722 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3723 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3724 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 3725 | "$O_SRV -Verify 10" \ | 
|  | 3726 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 3727 | 1 \ | 
|  | 3728 | -C "skip parse certificate request" \ | 
|  | 3729 | -c "got a certificate request" \ | 
|  | 3730 | -C "skip write certificate$" \ | 
|  | 3731 | -c "skip write certificate verify" \ | 
|  | 3732 | -c "! mbedtls_ssl_handshake returned" | 
|  | 3733 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3734 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3735 | run_test    "Authentication: client no cert, ssl3" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3736 | "$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] | 3737 | "$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] | 3738 | 0 \ | 
|  | 3739 | -S "skip write certificate request" \ | 
|  | 3740 | -C "skip parse certificate request" \ | 
|  | 3741 | -c "got a certificate request" \ | 
|  | 3742 | -C "skip write certificate$" \ | 
|  | 3743 | -c "skip write certificate verify" \ | 
|  | 3744 | -c "got no certificate to send" \ | 
|  | 3745 | -s "SSLv3 client has no certificate" \ | 
|  | 3746 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3747 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3748 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 3749 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3750 | -S "X509 - Certificate verification failed" | 
|  | 3751 |  | 
| Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3752 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its | 
|  | 3753 | # default value (8) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3754 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3755 | MAX_IM_CA='8' | 
| Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 3756 | 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] | 3757 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3758 | 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] | 3759 | 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] | 3760 | 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] | 3761 | printf "test value of ${MAX_IM_CA}. \n" | 
|  | 3762 | printf "\n" | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3763 | printf "The tests assume this value and if it changes, the tests in this\n" | 
|  | 3764 | printf "script should also be adjusted.\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3765 | printf "\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3766 |  | 
|  | 3767 | exit 1 | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3768 | fi | 
|  | 3769 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3770 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3771 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 3772 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 3773 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 3774 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 3775 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3776 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3777 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3778 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3779 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 3780 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3781 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3782 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 3783 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3784 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3785 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3786 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3787 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 3788 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3789 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3790 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 3791 | auth_mode=optional" \ | 
|  | 3792 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3793 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3794 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3795 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3796 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 3797 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3798 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3799 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 3800 | auth_mode=none" \ | 
|  | 3801 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3802 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3803 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3804 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3805 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 3806 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 3807 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3808 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3809 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3810 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3811 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3812 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3813 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 3814 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 3815 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3816 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3817 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3818 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3819 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3820 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3821 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 3822 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 3823 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 3824 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 3825 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3826 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3827 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3828 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3829 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 3830 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 3831 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 3832 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 3833 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3834 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3835 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3836 | # Tests for CA list in CertificateRequest messages | 
|  | 3837 |  | 
|  | 3838 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 3839 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 3840 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 3841 | key_file=data_files/server6.key" \ | 
|  | 3842 | 0 \ | 
|  | 3843 | -s "requested DN" | 
|  | 3844 |  | 
|  | 3845 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 3846 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 3847 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 3848 | key_file=data_files/server6.key" \ | 
|  | 3849 | 0 \ | 
|  | 3850 | -S "requested DN" | 
|  | 3851 |  | 
|  | 3852 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 3853 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 3854 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 3855 | key_file=data_files/server5.key" \ | 
|  | 3856 | 1 \ | 
|  | 3857 | -S "requested DN" \ | 
|  | 3858 | -s "x509_verify_cert() returned" \ | 
|  | 3859 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3860 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3861 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3862 | -s "X509 - Certificate verification failed" | 
|  | 3863 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3864 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests | 
|  | 3865 | # When updating these tests, modify the matching authentication tests accordingly | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3866 |  | 
|  | 3867 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3868 | run_test    "Authentication, CA callback: server badcert, client required" \ | 
|  | 3869 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3870 | key_file=data_files/server5.key" \ | 
|  | 3871 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 3872 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3873 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3874 | -c "x509_verify_cert() returned" \ | 
|  | 3875 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3876 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3877 | -c "X509 - Certificate verification failed" | 
|  | 3878 |  | 
|  | 3879 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3880 | run_test    "Authentication, CA callback: server badcert, client optional" \ | 
|  | 3881 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3882 | key_file=data_files/server5.key" \ | 
|  | 3883 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 3884 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3885 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3886 | -c "x509_verify_cert() returned" \ | 
|  | 3887 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3888 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 3889 | -C "X509 - Certificate verification failed" | 
|  | 3890 |  | 
|  | 3891 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 3892 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 3893 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 3894 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 3895 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 3896 | # different means to have the server ignoring the client's supported curve list. | 
|  | 3897 |  | 
|  | 3898 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3899 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3900 | run_test    "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 3901 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3902 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3903 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 3904 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3905 | -c "use CA callback for X.509 CRT verification" \ | 
|  | 3906 | -c "bad certificate (EC key curve)" \ | 
|  | 3907 | -c "! Certificate verification flags" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3908 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 3909 |  | 
|  | 3910 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 3911 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3912 | run_test    "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 3913 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 3914 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3915 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 3916 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3917 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3918 | -c "bad certificate (EC key curve)"\ | 
|  | 3919 | -c "! Certificate verification flags"\ | 
|  | 3920 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 3921 |  | 
|  | 3922 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3923 | run_test    "Authentication, CA callback: client SHA256, server required" \ | 
|  | 3924 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 3925 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3926 | key_file=data_files/server6.key \ | 
|  | 3927 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 3928 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3929 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3930 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3931 | -c "Supported Signature Algorithm found: 5," | 
|  | 3932 |  | 
|  | 3933 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3934 | run_test    "Authentication, CA callback: client SHA384, server required" \ | 
|  | 3935 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 3936 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 3937 | key_file=data_files/server6.key \ | 
|  | 3938 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 3939 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3940 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3941 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 3942 | -c "Supported Signature Algorithm found: 5," | 
|  | 3943 |  | 
|  | 3944 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3945 | run_test    "Authentication, CA callback: client badcert, server required" \ | 
|  | 3946 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 3947 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 3948 | key_file=data_files/server5.key" \ | 
|  | 3949 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3950 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3951 | -S "skip write certificate request" \ | 
|  | 3952 | -C "skip parse certificate request" \ | 
|  | 3953 | -c "got a certificate request" \ | 
|  | 3954 | -C "skip write certificate" \ | 
|  | 3955 | -C "skip write certificate verify" \ | 
|  | 3956 | -S "skip parse certificate verify" \ | 
|  | 3957 | -s "x509_verify_cert() returned" \ | 
|  | 3958 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3959 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3960 | -s "send alert level=2 message=48" \ | 
|  | 3961 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3962 | -s "X509 - Certificate verification failed" | 
|  | 3963 | # We don't check that the client receives the alert because it might | 
|  | 3964 | # detect that its write end of the connection is closed and abort | 
|  | 3965 | # before reading the alert message. | 
|  | 3966 |  | 
|  | 3967 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3968 | run_test    "Authentication, CA callback: client cert not trusted, server required" \ | 
|  | 3969 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 3970 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 3971 | key_file=data_files/server5.key" \ | 
|  | 3972 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3973 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3974 | -S "skip write certificate request" \ | 
|  | 3975 | -C "skip parse certificate request" \ | 
|  | 3976 | -c "got a certificate request" \ | 
|  | 3977 | -C "skip write certificate" \ | 
|  | 3978 | -C "skip write certificate verify" \ | 
|  | 3979 | -S "skip parse certificate verify" \ | 
|  | 3980 | -s "x509_verify_cert() returned" \ | 
|  | 3981 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 3982 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 3983 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 3984 | -s "X509 - Certificate verification failed" | 
|  | 3985 |  | 
|  | 3986 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 3987 | run_test    "Authentication, CA callback: client badcert, server optional" \ | 
|  | 3988 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 3989 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 3990 | key_file=data_files/server5.key" \ | 
|  | 3991 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3992 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3993 | -S "skip write certificate request" \ | 
|  | 3994 | -C "skip parse certificate request" \ | 
|  | 3995 | -c "got a certificate request" \ | 
|  | 3996 | -C "skip write certificate" \ | 
|  | 3997 | -C "skip write certificate verify" \ | 
|  | 3998 | -S "skip parse certificate verify" \ | 
|  | 3999 | -s "x509_verify_cert() returned" \ | 
|  | 4000 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4001 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4002 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4003 | -S "X509 - Certificate verification failed" | 
|  | 4004 |  | 
|  | 4005 | requires_full_size_output_buffer | 
|  | 4006 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4007 | run_test    "Authentication, CA callback: server max_int chain, client default" \ | 
|  | 4008 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4009 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4010 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4011 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4012 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4013 | -C "X509 - A fatal error occurred" | 
|  | 4014 |  | 
|  | 4015 | requires_full_size_output_buffer | 
|  | 4016 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4017 | run_test    "Authentication, CA callback: server max_int+1 chain, client default" \ | 
|  | 4018 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4019 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4020 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4021 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4022 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4023 | -c "X509 - A fatal error occurred" | 
|  | 4024 |  | 
|  | 4025 | requires_full_size_output_buffer | 
|  | 4026 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4027 | run_test    "Authentication, CA callback: server max_int+1 chain, client optional" \ | 
|  | 4028 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4029 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4030 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4031 | debug_level=3 auth_mode=optional" \ | 
|  | 4032 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4033 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4034 | -c "X509 - A fatal error occurred" | 
|  | 4035 |  | 
|  | 4036 | requires_full_size_output_buffer | 
|  | 4037 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4038 | run_test    "Authentication, CA callback: client max_int+1 chain, server optional" \ | 
|  | 4039 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4040 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4041 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4042 | 1 \ | 
| 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 | -s "X509 - A fatal error occurred" | 
|  | 4045 |  | 
|  | 4046 | requires_full_size_output_buffer | 
|  | 4047 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4048 | run_test    "Authentication, CA callback: client max_int+1 chain, server required" \ | 
|  | 4049 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4050 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4051 | key_file=data_files/dir-maxpath/10.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 "X509 - A fatal error occurred" | 
|  | 4055 |  | 
|  | 4056 | requires_full_size_output_buffer | 
|  | 4057 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4058 | run_test    "Authentication, CA callback: client max_int chain, server required" \ | 
|  | 4059 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4060 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4061 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4062 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4063 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4064 | -S "X509 - A fatal error occurred" | 
|  | 4065 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4066 | # Tests for certificate selection based on SHA verson | 
|  | 4067 |  | 
|  | 4068 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 4069 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4070 | key_file=data_files/server5.key \ | 
|  | 4071 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4072 | key_file2=data_files/server5.key" \ | 
|  | 4073 | "$P_CLI force_version=tls1_2" \ | 
|  | 4074 | 0 \ | 
|  | 4075 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4076 | -C "signed using.*ECDSA with SHA1" | 
|  | 4077 |  | 
|  | 4078 | run_test    "Certificate hash: client TLS 1.1 -> SHA-1" \ | 
|  | 4079 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4080 | key_file=data_files/server5.key \ | 
|  | 4081 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4082 | key_file2=data_files/server5.key" \ | 
|  | 4083 | "$P_CLI force_version=tls1_1" \ | 
|  | 4084 | 0 \ | 
|  | 4085 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 4086 | -c "signed using.*ECDSA with SHA1" | 
|  | 4087 |  | 
|  | 4088 | run_test    "Certificate hash: client TLS 1.0 -> SHA-1" \ | 
|  | 4089 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4090 | key_file=data_files/server5.key \ | 
|  | 4091 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4092 | key_file2=data_files/server5.key" \ | 
|  | 4093 | "$P_CLI force_version=tls1" \ | 
|  | 4094 | 0 \ | 
|  | 4095 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 4096 | -c "signed using.*ECDSA with SHA1" | 
|  | 4097 |  | 
|  | 4098 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ | 
|  | 4099 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4100 | key_file=data_files/server5.key \ | 
|  | 4101 | crt_file2=data_files/server6.crt \ | 
|  | 4102 | key_file2=data_files/server6.key" \ | 
|  | 4103 | "$P_CLI force_version=tls1_1" \ | 
|  | 4104 | 0 \ | 
|  | 4105 | -c "serial number.*09" \ | 
|  | 4106 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4107 | -C "signed using.*ECDSA with SHA1" | 
|  | 4108 |  | 
|  | 4109 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ | 
|  | 4110 | "$P_SRV crt_file=data_files/server6.crt \ | 
|  | 4111 | key_file=data_files/server6.key \ | 
|  | 4112 | crt_file2=data_files/server5.crt \ | 
|  | 4113 | key_file2=data_files/server5.key" \ | 
|  | 4114 | "$P_CLI force_version=tls1_1" \ | 
|  | 4115 | 0 \ | 
|  | 4116 | -c "serial number.*0A" \ | 
|  | 4117 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4118 | -C "signed using.*ECDSA with SHA1" | 
|  | 4119 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4120 | # tests for SNI | 
|  | 4121 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4122 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4123 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4124 | 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] | 4125 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4126 | 0 \ | 
|  | 4127 | -S "parse ServerName extension" \ | 
|  | 4128 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4129 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4130 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4131 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4132 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4133 | 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] | 4134 | 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] | 4135 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4136 | 0 \ | 
|  | 4137 | -s "parse ServerName extension" \ | 
|  | 4138 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4139 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4140 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4141 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4142 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4143 | 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] | 4144 | 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] | 4145 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4146 | 0 \ | 
|  | 4147 | -s "parse ServerName extension" \ | 
|  | 4148 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4149 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4150 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4151 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4152 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4153 | 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] | 4154 | 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] | 4155 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4156 | 1 \ | 
|  | 4157 | -s "parse ServerName extension" \ | 
|  | 4158 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4159 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4160 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4161 | -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] | 4162 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4163 | run_test    "SNI: client auth no override: optional" \ | 
|  | 4164 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4165 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4166 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4167 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4168 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4169 | -S "skip write certificate request" \ | 
|  | 4170 | -C "skip parse certificate request" \ | 
|  | 4171 | -c "got a certificate request" \ | 
|  | 4172 | -C "skip write certificate" \ | 
|  | 4173 | -C "skip write certificate verify" \ | 
|  | 4174 | -S "skip parse certificate verify" | 
|  | 4175 |  | 
|  | 4176 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 4177 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 4178 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4179 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4180 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4181 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4182 | -S "skip write certificate request" \ | 
|  | 4183 | -C "skip parse certificate request" \ | 
|  | 4184 | -c "got a certificate request" \ | 
|  | 4185 | -C "skip write certificate" \ | 
|  | 4186 | -C "skip write certificate verify" \ | 
|  | 4187 | -S "skip parse certificate verify" | 
|  | 4188 |  | 
|  | 4189 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 4190 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4191 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4192 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4193 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4194 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4195 | -s "skip write certificate request" \ | 
|  | 4196 | -C "skip parse certificate request" \ | 
|  | 4197 | -c "got no certificate request" \ | 
|  | 4198 | -c "skip write certificate" \ | 
|  | 4199 | -c "skip write certificate verify" \ | 
|  | 4200 | -s "skip parse certificate verify" | 
|  | 4201 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4202 | run_test    "SNI: CA no override" \ | 
|  | 4203 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4204 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4205 | ca_file=data_files/test-ca.crt \ | 
|  | 4206 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4207 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4208 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4209 | 1 \ | 
|  | 4210 | -S "skip write certificate request" \ | 
|  | 4211 | -C "skip parse certificate request" \ | 
|  | 4212 | -c "got a certificate request" \ | 
|  | 4213 | -C "skip write certificate" \ | 
|  | 4214 | -C "skip write certificate verify" \ | 
|  | 4215 | -S "skip parse certificate verify" \ | 
|  | 4216 | -s "x509_verify_cert() returned" \ | 
|  | 4217 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4218 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4219 |  | 
|  | 4220 | run_test    "SNI: CA override" \ | 
|  | 4221 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4222 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4223 | ca_file=data_files/test-ca.crt \ | 
|  | 4224 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4225 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4226 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4227 | 0 \ | 
|  | 4228 | -S "skip write certificate request" \ | 
|  | 4229 | -C "skip parse certificate request" \ | 
|  | 4230 | -c "got a certificate request" \ | 
|  | 4231 | -C "skip write certificate" \ | 
|  | 4232 | -C "skip write certificate verify" \ | 
|  | 4233 | -S "skip parse certificate verify" \ | 
|  | 4234 | -S "x509_verify_cert() returned" \ | 
|  | 4235 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4236 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4237 |  | 
|  | 4238 | run_test    "SNI: CA override with CRL" \ | 
|  | 4239 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4240 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4241 | ca_file=data_files/test-ca.crt \ | 
|  | 4242 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4243 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4244 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4245 | 1 \ | 
|  | 4246 | -S "skip write certificate request" \ | 
|  | 4247 | -C "skip parse certificate request" \ | 
|  | 4248 | -c "got a certificate request" \ | 
|  | 4249 | -C "skip write certificate" \ | 
|  | 4250 | -C "skip write certificate verify" \ | 
|  | 4251 | -S "skip parse certificate verify" \ | 
|  | 4252 | -s "x509_verify_cert() returned" \ | 
|  | 4253 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4254 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4255 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4256 | # Tests for SNI and DTLS | 
|  | 4257 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4258 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 4259 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4260 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 4261 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4262 | 0 \ | 
|  | 4263 | -S "parse ServerName extension" \ | 
|  | 4264 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4265 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4266 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4267 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4268 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4269 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4270 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4271 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4272 | 0 \ | 
|  | 4273 | -s "parse ServerName extension" \ | 
|  | 4274 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4275 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4276 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4277 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 4278 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4279 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4280 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4281 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 4282 | 0 \ | 
|  | 4283 | -s "parse ServerName extension" \ | 
|  | 4284 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4285 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 4286 |  | 
|  | 4287 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 4288 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4289 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4290 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4291 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 4292 | 1 \ | 
|  | 4293 | -s "parse ServerName extension" \ | 
|  | 4294 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4295 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4296 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4297 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 4298 |  | 
|  | 4299 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 4300 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4301 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4302 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4303 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4304 | 0 \ | 
|  | 4305 | -S "skip write certificate request" \ | 
|  | 4306 | -C "skip parse certificate request" \ | 
|  | 4307 | -c "got a certificate request" \ | 
|  | 4308 | -C "skip write certificate" \ | 
|  | 4309 | -C "skip write certificate verify" \ | 
|  | 4310 | -S "skip parse certificate verify" | 
|  | 4311 |  | 
|  | 4312 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 4313 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 4314 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4315 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4316 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4317 | 0 \ | 
|  | 4318 | -S "skip write certificate request" \ | 
|  | 4319 | -C "skip parse certificate request" \ | 
|  | 4320 | -c "got a certificate request" \ | 
|  | 4321 | -C "skip write certificate" \ | 
|  | 4322 | -C "skip write certificate verify" \ | 
|  | 4323 | -S "skip parse certificate verify" | 
|  | 4324 |  | 
|  | 4325 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 4326 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4327 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4328 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4329 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4330 | 0 \ | 
|  | 4331 | -s "skip write certificate request" \ | 
|  | 4332 | -C "skip parse certificate request" \ | 
|  | 4333 | -c "got no certificate request" \ | 
|  | 4334 | -c "skip write certificate" \ | 
|  | 4335 | -c "skip write certificate verify" \ | 
|  | 4336 | -s "skip parse certificate verify" | 
|  | 4337 |  | 
|  | 4338 | run_test    "SNI: DTLS, CA no override" \ | 
|  | 4339 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4340 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4341 | ca_file=data_files/test-ca.crt \ | 
|  | 4342 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4343 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4344 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4345 | 1 \ | 
|  | 4346 | -S "skip write certificate request" \ | 
|  | 4347 | -C "skip parse certificate request" \ | 
|  | 4348 | -c "got a certificate request" \ | 
|  | 4349 | -C "skip write certificate" \ | 
|  | 4350 | -C "skip write certificate verify" \ | 
|  | 4351 | -S "skip parse certificate verify" \ | 
|  | 4352 | -s "x509_verify_cert() returned" \ | 
|  | 4353 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4354 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4355 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4356 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4357 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4358 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4359 | ca_file=data_files/test-ca.crt \ | 
|  | 4360 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4361 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4362 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4363 | 0 \ | 
|  | 4364 | -S "skip write certificate request" \ | 
|  | 4365 | -C "skip parse certificate request" \ | 
|  | 4366 | -c "got a certificate request" \ | 
|  | 4367 | -C "skip write certificate" \ | 
|  | 4368 | -C "skip write certificate verify" \ | 
|  | 4369 | -S "skip parse certificate verify" \ | 
|  | 4370 | -S "x509_verify_cert() returned" \ | 
|  | 4371 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4372 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4373 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4374 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4375 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4376 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 4377 | ca_file=data_files/test-ca.crt \ | 
|  | 4378 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4379 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4380 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4381 | 1 \ | 
|  | 4382 | -S "skip write certificate request" \ | 
|  | 4383 | -C "skip parse certificate request" \ | 
|  | 4384 | -c "got a certificate request" \ | 
|  | 4385 | -C "skip write certificate" \ | 
|  | 4386 | -C "skip write certificate verify" \ | 
|  | 4387 | -S "skip parse certificate verify" \ | 
|  | 4388 | -s "x509_verify_cert() returned" \ | 
|  | 4389 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4390 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4391 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4392 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 4393 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4394 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4395 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4396 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4397 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4398 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4399 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4400 | -c "Read from server: .* bytes read" | 
|  | 4401 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4402 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4403 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 4404 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4405 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4406 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4407 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4408 | -c "Read from server: .* bytes read" | 
|  | 4409 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4410 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4411 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4412 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4413 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4414 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4415 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4416 | -c "Read from server: .* bytes read" | 
|  | 4417 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4418 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4419 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4420 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4421 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4422 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4423 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4424 | -c "Read from server: .* bytes read" | 
|  | 4425 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4426 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4427 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4428 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4429 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4430 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4431 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4432 | -c "Read from server: .* bytes read" | 
|  | 4433 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4434 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4435 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4436 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4437 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4438 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4439 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4440 | -c "Read from server: .* bytes read" | 
|  | 4441 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4442 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4443 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4444 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 4445 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4446 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4447 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4448 | -c "Read from server: .* bytes read" | 
|  | 4449 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4450 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 4451 |  | 
|  | 4452 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 4453 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4454 | "$P_CLI event=1 tickets=0" \ | 
|  | 4455 | 0 \ | 
|  | 4456 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4457 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4458 | -c "Read from server: .* bytes read" | 
|  | 4459 |  | 
|  | 4460 | run_test    "Event-driven I/O: client auth" \ | 
|  | 4461 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 4462 | "$P_CLI event=1 tickets=0" \ | 
|  | 4463 | 0 \ | 
|  | 4464 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4465 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4466 | -c "Read from server: .* bytes read" | 
|  | 4467 |  | 
|  | 4468 | run_test    "Event-driven I/O: ticket" \ | 
|  | 4469 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4470 | "$P_CLI event=1 tickets=1" \ | 
|  | 4471 | 0 \ | 
|  | 4472 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4473 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4474 | -c "Read from server: .* bytes read" | 
|  | 4475 |  | 
|  | 4476 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 4477 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4478 | "$P_CLI event=1 tickets=1" \ | 
|  | 4479 | 0 \ | 
|  | 4480 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4481 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4482 | -c "Read from server: .* bytes read" | 
|  | 4483 |  | 
|  | 4484 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 4485 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4486 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4487 | 0 \ | 
|  | 4488 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4489 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4490 | -c "Read from server: .* bytes read" | 
|  | 4491 |  | 
|  | 4492 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 4493 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4494 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4495 | 0 \ | 
|  | 4496 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4497 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4498 | -c "Read from server: .* bytes read" | 
|  | 4499 |  | 
|  | 4500 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 4501 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4502 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 4503 | 0 \ | 
|  | 4504 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4505 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4506 | -c "Read from server: .* bytes read" | 
|  | 4507 |  | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4508 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 4509 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 4510 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 4511 | 0 \ | 
|  | 4512 | -c "Read from server: .* bytes read" | 
|  | 4513 |  | 
|  | 4514 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 4515 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 4516 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 4517 | 0 \ | 
|  | 4518 | -c "Read from server: .* bytes read" | 
|  | 4519 |  | 
|  | 4520 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 4521 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 4522 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 4523 | 0 \ | 
|  | 4524 | -c "Read from server: .* bytes read" | 
|  | 4525 |  | 
|  | 4526 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 4527 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 4528 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 4529 | 0 \ | 
|  | 4530 | -c "Read from server: .* bytes read" | 
|  | 4531 |  | 
|  | 4532 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 4533 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 4534 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 4535 | 0 \ | 
|  | 4536 | -c "Read from server: .* bytes read" | 
|  | 4537 |  | 
|  | 4538 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 4539 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 4540 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 4541 | 0 \ | 
|  | 4542 | -c "Read from server: .* bytes read" | 
|  | 4543 |  | 
|  | 4544 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 4545 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 4546 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 4547 | 0 \ | 
|  | 4548 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4549 |  | 
|  | 4550 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 4551 | # During session resumption, the client will send its ApplicationData record | 
|  | 4552 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 4553 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 4554 | # because the ApplicationData request has already been queued internally. | 
|  | 4555 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4556 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4557 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 4558 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 4559 | 0 \ | 
|  | 4560 | -c "Read from server: .* bytes read" | 
|  | 4561 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4562 | # Tests for version negotiation | 
|  | 4563 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4564 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4565 | "$P_SRV" \ | 
|  | 4566 | "$P_CLI" \ | 
|  | 4567 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4568 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4569 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4570 | -s "Protocol is TLSv1.2" \ | 
|  | 4571 | -c "Protocol is TLSv1.2" | 
|  | 4572 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4573 | run_test    "Version check: cli max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4574 | "$P_SRV" \ | 
|  | 4575 | "$P_CLI max_version=tls1_1" \ | 
|  | 4576 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4577 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4578 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4579 | -s "Protocol is TLSv1.1" \ | 
|  | 4580 | -c "Protocol is TLSv1.1" | 
|  | 4581 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4582 | run_test    "Version check: srv max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4583 | "$P_SRV max_version=tls1_1" \ | 
|  | 4584 | "$P_CLI" \ | 
|  | 4585 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4586 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4587 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4588 | -s "Protocol is TLSv1.1" \ | 
|  | 4589 | -c "Protocol is TLSv1.1" | 
|  | 4590 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | 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] | 4592 | "$P_SRV max_version=tls1_1" \ | 
|  | 4593 | "$P_CLI max_version=tls1_1" \ | 
|  | 4594 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4595 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4596 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4597 | -s "Protocol is TLSv1.1" \ | 
|  | 4598 | -c "Protocol is TLSv1.1" | 
|  | 4599 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4600 | 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] | 4601 | "$P_SRV min_version=tls1_1" \ | 
|  | 4602 | "$P_CLI max_version=tls1_1" \ | 
|  | 4603 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4604 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4605 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4606 | -s "Protocol is TLSv1.1" \ | 
|  | 4607 | -c "Protocol is TLSv1.1" | 
|  | 4608 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4609 | 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] | 4610 | "$P_SRV max_version=tls1_1" \ | 
|  | 4611 | "$P_CLI min_version=tls1_1" \ | 
|  | 4612 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4613 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4614 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4615 | -s "Protocol is TLSv1.1" \ | 
|  | 4616 | -c "Protocol is TLSv1.1" | 
|  | 4617 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4618 | 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] | 4619 | "$P_SRV max_version=tls1_1" \ | 
|  | 4620 | "$P_CLI min_version=tls1_2" \ | 
|  | 4621 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4622 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4623 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4624 | -c "SSL - Handshake protocol not within min/max boundaries" | 
|  | 4625 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4626 | 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] | 4627 | "$P_SRV min_version=tls1_2" \ | 
|  | 4628 | "$P_CLI max_version=tls1_1" \ | 
|  | 4629 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4630 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4631 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4632 | -s "SSL - Handshake protocol not within min/max boundaries" | 
|  | 4633 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4634 | # Tests for ALPN extension | 
|  | 4635 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4636 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4637 | "$P_SRV debug_level=3" \ | 
|  | 4638 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4639 | 0 \ | 
|  | 4640 | -C "client hello, adding alpn extension" \ | 
|  | 4641 | -S "found alpn extension" \ | 
|  | 4642 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4643 | -S "server hello, adding alpn extension" \ | 
|  | 4644 | -C "found alpn extension " \ | 
|  | 4645 | -C "Application Layer Protocol is" \ | 
|  | 4646 | -S "Application Layer Protocol is" | 
|  | 4647 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4648 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4649 | "$P_SRV debug_level=3" \ | 
|  | 4650 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4651 | 0 \ | 
|  | 4652 | -c "client hello, adding alpn extension" \ | 
|  | 4653 | -s "found alpn extension" \ | 
|  | 4654 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4655 | -S "server hello, adding alpn extension" \ | 
|  | 4656 | -C "found alpn extension " \ | 
|  | 4657 | -c "Application Layer Protocol is (none)" \ | 
|  | 4658 | -S "Application Layer Protocol is" | 
|  | 4659 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4660 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4661 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4662 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4663 | 0 \ | 
|  | 4664 | -C "client hello, adding alpn extension" \ | 
|  | 4665 | -S "found alpn extension" \ | 
|  | 4666 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4667 | -S "server hello, adding alpn extension" \ | 
|  | 4668 | -C "found alpn extension " \ | 
|  | 4669 | -C "Application Layer Protocol is" \ | 
|  | 4670 | -s "Application Layer Protocol is (none)" | 
|  | 4671 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4672 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4673 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4674 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4675 | 0 \ | 
|  | 4676 | -c "client hello, adding alpn extension" \ | 
|  | 4677 | -s "found alpn extension" \ | 
|  | 4678 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4679 | -s "server hello, adding alpn extension" \ | 
|  | 4680 | -c "found alpn extension" \ | 
|  | 4681 | -c "Application Layer Protocol is abc" \ | 
|  | 4682 | -s "Application Layer Protocol is abc" | 
|  | 4683 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4684 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4685 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4686 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4687 | 0 \ | 
|  | 4688 | -c "client hello, adding alpn extension" \ | 
|  | 4689 | -s "found alpn extension" \ | 
|  | 4690 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4691 | -s "server hello, adding alpn extension" \ | 
|  | 4692 | -c "found alpn extension" \ | 
|  | 4693 | -c "Application Layer Protocol is abc" \ | 
|  | 4694 | -s "Application Layer Protocol is abc" | 
|  | 4695 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4696 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4697 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 4698 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4699 | 0 \ | 
|  | 4700 | -c "client hello, adding alpn extension" \ | 
|  | 4701 | -s "found alpn extension" \ | 
|  | 4702 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 4703 | -s "server hello, adding alpn extension" \ | 
|  | 4704 | -c "found alpn extension" \ | 
|  | 4705 | -c "Application Layer Protocol is 1234" \ | 
|  | 4706 | -s "Application Layer Protocol is 1234" | 
|  | 4707 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4708 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4709 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 4710 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4711 | 1 \ | 
|  | 4712 | -c "client hello, adding alpn extension" \ | 
|  | 4713 | -s "found alpn extension" \ | 
|  | 4714 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 4715 | -S "server hello, adding alpn extension" \ | 
|  | 4716 | -C "found alpn extension" \ | 
|  | 4717 | -C "Application Layer Protocol is 1234" \ | 
|  | 4718 | -S "Application Layer Protocol is 1234" | 
|  | 4719 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4720 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4721 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 4722 | # server-side certificate/suite selection | 
|  | 4723 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4724 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4725 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 4726 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 4727 | "$P_CLI" \ | 
|  | 4728 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4729 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4730 |  | 
|  | 4731 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4732 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4733 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 4734 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 4735 | "$P_CLI" \ | 
|  | 4736 | 0 \ | 
|  | 4737 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 4738 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4739 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4740 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4741 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4742 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4743 | 1 \ | 
|  | 4744 | -C "Ciphersuite is " | 
|  | 4745 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4746 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4747 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4748 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 4749 | "$P_CLI" \ | 
|  | 4750 | 0 \ | 
|  | 4751 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 4752 |  | 
|  | 4753 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4754 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4755 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4756 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4757 | "$P_CLI" \ | 
|  | 4758 | 0 \ | 
|  | 4759 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 4760 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4761 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4762 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4763 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4764 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4765 | 1 \ | 
|  | 4766 | -C "Ciphersuite is " | 
|  | 4767 |  | 
|  | 4768 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4769 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4770 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4771 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4772 | "$O_SRV -key data_files/server2.key \ | 
|  | 4773 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4774 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4775 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4776 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4777 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4778 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4779 | -c "Ciphersuite is TLS-" | 
|  | 4780 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4781 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4782 | "$O_SRV -key data_files/server2.key \ | 
|  | 4783 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4784 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4785 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4786 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4787 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4788 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4789 | -c "Ciphersuite is TLS-" | 
|  | 4790 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4791 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4792 | "$O_SRV -key data_files/server2.key \ | 
|  | 4793 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4794 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4795 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4796 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4797 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4798 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4799 | -c "Ciphersuite is TLS-" | 
|  | 4800 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4801 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4802 | "$O_SRV -key data_files/server2.key \ | 
|  | 4803 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4804 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4805 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4806 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4807 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4808 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 4809 | -C "Ciphersuite is TLS-" | 
|  | 4810 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4811 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 4812 | "$O_SRV -key data_files/server2.key \ | 
|  | 4813 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 4814 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 4815 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4816 | 0 \ | 
|  | 4817 | -c "bad certificate (usage extensions)" \ | 
|  | 4818 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4819 | -c "Ciphersuite is TLS-" \ | 
|  | 4820 | -c "! Usage does not match the keyUsage extension" | 
|  | 4821 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4822 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4823 | "$O_SRV -key data_files/server2.key \ | 
|  | 4824 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4825 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4826 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4827 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4828 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4829 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4830 | -c "Ciphersuite is TLS-" | 
|  | 4831 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4832 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4833 | "$O_SRV -key data_files/server2.key \ | 
|  | 4834 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4835 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4836 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4837 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4838 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4839 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 4840 | -C "Ciphersuite is TLS-" | 
|  | 4841 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4842 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 4843 | "$O_SRV -key data_files/server2.key \ | 
|  | 4844 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 4845 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 4846 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4847 | 0 \ | 
|  | 4848 | -c "bad certificate (usage extensions)" \ | 
|  | 4849 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4850 | -c "Ciphersuite is TLS-" \ | 
|  | 4851 | -c "! Usage does not match the keyUsage extension" | 
|  | 4852 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4853 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 4854 | # server-side checking of client cert | 
|  | 4855 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4856 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4857 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4858 | "$O_CLI -key data_files/server2.key \ | 
|  | 4859 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 4860 | 0 \ | 
|  | 4861 | -S "bad certificate (usage extensions)" \ | 
|  | 4862 | -S "Processing of the Certificate handshake message failed" | 
|  | 4863 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4864 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4865 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4866 | "$O_CLI -key data_files/server2.key \ | 
|  | 4867 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 4868 | 0 \ | 
|  | 4869 | -s "bad certificate (usage extensions)" \ | 
|  | 4870 | -S "Processing of the Certificate handshake message failed" | 
|  | 4871 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4872 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4873 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4874 | "$O_CLI -key data_files/server2.key \ | 
|  | 4875 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 4876 | 1 \ | 
|  | 4877 | -s "bad certificate (usage extensions)" \ | 
|  | 4878 | -s "Processing of the Certificate handshake message failed" | 
|  | 4879 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4880 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4881 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4882 | "$O_CLI -key data_files/server5.key \ | 
|  | 4883 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 4884 | 0 \ | 
|  | 4885 | -S "bad certificate (usage extensions)" \ | 
|  | 4886 | -S "Processing of the Certificate handshake message failed" | 
|  | 4887 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4888 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4889 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4890 | "$O_CLI -key data_files/server5.key \ | 
|  | 4891 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 4892 | 0 \ | 
|  | 4893 | -s "bad certificate (usage extensions)" \ | 
|  | 4894 | -S "Processing of the Certificate handshake message failed" | 
|  | 4895 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4896 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 4897 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4898 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4899 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4900 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 4901 | "$P_CLI" \ | 
|  | 4902 | 0 | 
|  | 4903 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4904 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4905 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4906 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 4907 | "$P_CLI" \ | 
|  | 4908 | 0 | 
|  | 4909 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4910 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4911 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 4912 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 4913 | "$P_CLI" \ | 
|  | 4914 | 0 | 
|  | 4915 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4916 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4917 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4918 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4919 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4920 | 1 | 
|  | 4921 |  | 
|  | 4922 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 4923 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4924 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4925 | "$O_SRV -key data_files/server5.key \ | 
|  | 4926 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4927 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4928 | 0 \ | 
|  | 4929 | -C "bad certificate (usage extensions)" \ | 
|  | 4930 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4931 | -c "Ciphersuite is TLS-" | 
|  | 4932 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4933 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4934 | "$O_SRV -key data_files/server5.key \ | 
|  | 4935 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4936 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4937 | 0 \ | 
|  | 4938 | -C "bad certificate (usage extensions)" \ | 
|  | 4939 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4940 | -c "Ciphersuite is TLS-" | 
|  | 4941 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4942 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4943 | "$O_SRV -key data_files/server5.key \ | 
|  | 4944 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4945 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4946 | 0 \ | 
|  | 4947 | -C "bad certificate (usage extensions)" \ | 
|  | 4948 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 4949 | -c "Ciphersuite is TLS-" | 
|  | 4950 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4951 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4952 | "$O_SRV -key data_files/server5.key \ | 
|  | 4953 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4954 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4955 | 1 \ | 
|  | 4956 | -c "bad certificate (usage extensions)" \ | 
|  | 4957 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 4958 | -C "Ciphersuite is TLS-" | 
|  | 4959 |  | 
|  | 4960 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 4961 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4962 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4963 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4964 | "$O_CLI -key data_files/server5.key \ | 
|  | 4965 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 4966 | 0 \ | 
|  | 4967 | -S "bad certificate (usage extensions)" \ | 
|  | 4968 | -S "Processing of the Certificate handshake message failed" | 
|  | 4969 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4970 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4971 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4972 | "$O_CLI -key data_files/server5.key \ | 
|  | 4973 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 4974 | 0 \ | 
|  | 4975 | -S "bad certificate (usage extensions)" \ | 
|  | 4976 | -S "Processing of the Certificate handshake message failed" | 
|  | 4977 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4978 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4979 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4980 | "$O_CLI -key data_files/server5.key \ | 
|  | 4981 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 4982 | 0 \ | 
|  | 4983 | -S "bad certificate (usage extensions)" \ | 
|  | 4984 | -S "Processing of the Certificate handshake message failed" | 
|  | 4985 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4986 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4987 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4988 | "$O_CLI -key data_files/server5.key \ | 
|  | 4989 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 4990 | 0 \ | 
|  | 4991 | -s "bad certificate (usage extensions)" \ | 
|  | 4992 | -S "Processing of the Certificate handshake message failed" | 
|  | 4993 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4994 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4995 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4996 | "$O_CLI -key data_files/server5.key \ | 
|  | 4997 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 4998 | 1 \ | 
|  | 4999 | -s "bad certificate (usage extensions)" \ | 
|  | 5000 | -s "Processing of the Certificate handshake message failed" | 
|  | 5001 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5002 | # Tests for DHM parameters loading | 
|  | 5003 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5004 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5005 | "$P_SRV" \ | 
|  | 5006 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5007 | debug_level=3" \ | 
|  | 5008 | 0 \ | 
|  | 5009 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5010 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5011 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5012 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5013 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5014 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5015 | debug_level=3" \ | 
|  | 5016 | 0 \ | 
|  | 5017 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 5018 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 5019 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5020 | # Tests for DHM client-side size checking | 
|  | 5021 |  | 
|  | 5022 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 5023 | "$P_SRV" \ | 
|  | 5024 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5025 | debug_level=1" \ | 
|  | 5026 | 0 \ | 
|  | 5027 | -C "DHM prime too short:" | 
|  | 5028 |  | 
|  | 5029 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 5030 | "$P_SRV" \ | 
|  | 5031 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5032 | debug_level=1 dhmlen=2048" \ | 
|  | 5033 | 0 \ | 
|  | 5034 | -C "DHM prime too short:" | 
|  | 5035 |  | 
|  | 5036 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 5037 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5038 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5039 | debug_level=1" \ | 
|  | 5040 | 0 \ | 
|  | 5041 | -C "DHM prime too short:" | 
|  | 5042 |  | 
|  | 5043 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 5044 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 5045 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5046 | debug_level=1" \ | 
|  | 5047 | 1 \ | 
|  | 5048 | -c "DHM prime too short:" | 
|  | 5049 |  | 
|  | 5050 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 5051 | "$P_SRV" \ | 
|  | 5052 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5053 | debug_level=1 dhmlen=2049" \ | 
|  | 5054 | 1 \ | 
|  | 5055 | -c "DHM prime too short:" | 
|  | 5056 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5057 | # Tests for PSK callback | 
|  | 5058 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5059 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5060 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 5061 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5062 | psk_identity=foo psk=abc123" \ | 
|  | 5063 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5064 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5065 | -S "SSL - Unknown identity received" \ | 
|  | 5066 | -S "SSL - Verification of the message MAC failed" | 
|  | 5067 |  | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5068 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5069 | run_test    "PSK callback: opaque psk on client, no callback" \ | 
|  | 5070 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5071 | "$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] | 5072 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5073 | 0 \ | 
|  | 5074 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5075 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5076 | -C "session hash for extended master secret"\ | 
|  | 5077 | -S "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5078 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5079 | -S "SSL - Unknown identity received" \ | 
|  | 5080 | -S "SSL - Verification of the message MAC failed" | 
|  | 5081 |  | 
|  | 5082 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5083 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384" \ | 
|  | 5084 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5085 | "$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] | 5086 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5087 | 0 \ | 
|  | 5088 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5089 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5090 | -C "session hash for extended master secret"\ | 
|  | 5091 | -S "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5092 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5093 | -S "SSL - Unknown identity received" \ | 
|  | 5094 | -S "SSL - Verification of the message MAC failed" | 
|  | 5095 |  | 
|  | 5096 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5097 | run_test    "PSK callback: opaque psk on client, no callback, EMS" \ | 
|  | 5098 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5099 | "$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] | 5100 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5101 | 0 \ | 
|  | 5102 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5103 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5104 | -c "session hash for extended master secret"\ | 
|  | 5105 | -s "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5106 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5107 | -S "SSL - Unknown identity received" \ | 
|  | 5108 | -S "SSL - Verification of the message MAC failed" | 
|  | 5109 |  | 
|  | 5110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5111 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ | 
|  | 5112 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5113 | "$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] | 5114 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5115 | 0 \ | 
|  | 5116 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5117 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5118 | -c "session hash for extended master secret"\ | 
|  | 5119 | -s "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5120 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5121 | -S "SSL - Unknown identity received" \ | 
|  | 5122 | -S "SSL - Verification of the message MAC failed" | 
|  | 5123 |  | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5124 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5125 | 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] | 5126 | "$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] | 5127 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5128 | psk_identity=foo psk=abc123" \ | 
|  | 5129 | 0 \ | 
|  | 5130 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5131 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5132 | -C "session hash for extended master secret"\ | 
|  | 5133 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5134 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5135 | -S "SSL - Unknown identity received" \ | 
|  | 5136 | -S "SSL - Verification of the message MAC failed" | 
|  | 5137 |  | 
|  | 5138 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5139 | 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] | 5140 | "$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] | 5141 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5142 | psk_identity=foo psk=abc123" \ | 
|  | 5143 | 0 \ | 
|  | 5144 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5145 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5146 | -C "session hash for extended master secret"\ | 
|  | 5147 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5148 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5149 | -S "SSL - Unknown identity received" \ | 
|  | 5150 | -S "SSL - Verification of the message MAC failed" | 
|  | 5151 |  | 
|  | 5152 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5153 | 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] | 5154 | "$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] | 5155 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5156 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5157 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5158 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5159 | -c "session hash for extended master secret"\ | 
|  | 5160 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5161 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5162 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5163 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5164 | -S "SSL - Unknown identity received" \ | 
|  | 5165 | -S "SSL - Verification of the message MAC failed" | 
|  | 5166 |  | 
|  | 5167 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5168 | 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] | 5169 | "$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] | 5170 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5171 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5172 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5173 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5174 | -c "session hash for extended master secret"\ | 
|  | 5175 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5176 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5177 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5178 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5179 | -S "SSL - Unknown identity received" \ | 
|  | 5180 | -S "SSL - Verification of the message MAC failed" | 
|  | 5181 |  | 
|  | 5182 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5183 | 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] | 5184 | "$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] | 5185 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5186 | psk_identity=def psk=beef" \ | 
|  | 5187 | 0 \ | 
|  | 5188 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5189 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5190 | -C "session hash for extended master secret"\ | 
|  | 5191 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5192 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5193 | -S "SSL - Unknown identity received" \ | 
|  | 5194 | -S "SSL - Verification of the message MAC failed" | 
|  | 5195 |  | 
|  | 5196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5197 | 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] | 5198 | "$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] | 5199 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5200 | psk_identity=def psk=beef" \ | 
|  | 5201 | 0 \ | 
|  | 5202 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5203 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5204 | -C "session hash for extended master secret"\ | 
|  | 5205 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5206 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5207 | -S "SSL - Unknown identity received" \ | 
|  | 5208 | -S "SSL - Verification of the message MAC failed" | 
|  | 5209 |  | 
|  | 5210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5211 | 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] | 5212 | "$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] | 5213 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5214 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5215 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5216 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5217 | -c "session hash for extended master secret"\ | 
|  | 5218 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5219 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5220 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5221 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5222 | -S "SSL - Unknown identity received" \ | 
|  | 5223 | -S "SSL - Verification of the message MAC failed" | 
|  | 5224 |  | 
|  | 5225 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5226 | 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] | 5227 | "$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] | 5228 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5229 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5230 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5231 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5232 | -c "session hash for extended master secret"\ | 
|  | 5233 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5234 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5235 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5236 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5237 | -S "SSL - Unknown identity received" \ | 
|  | 5238 | -S "SSL - Verification of the message MAC failed" | 
|  | 5239 |  | 
|  | 5240 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5241 | 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] | 5242 | "$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] | 5243 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5244 | psk_identity=def psk=beef" \ | 
|  | 5245 | 0 \ | 
|  | 5246 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5247 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5248 | -C "session hash for extended master secret"\ | 
|  | 5249 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5250 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5251 | -S "SSL - Unknown identity received" \ | 
|  | 5252 | -S "SSL - Verification of the message MAC failed" | 
|  | 5253 |  | 
|  | 5254 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5255 | 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] | 5256 | "$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] | 5257 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5258 | psk_identity=def psk=beef" \ | 
|  | 5259 | 0 \ | 
|  | 5260 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5261 | -s "skip PMS generation for opaque PSK"\ | 
| 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 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5265 | -S "SSL - Unknown identity received" \ | 
|  | 5266 | -S "SSL - Verification of the message MAC failed" | 
|  | 5267 |  | 
|  | 5268 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5269 | 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] | 5270 | "$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] | 5271 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5272 | psk_identity=def psk=beef" \ | 
|  | 5273 | 0 \ | 
|  | 5274 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5275 | -C "session hash for extended master secret"\ | 
|  | 5276 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5277 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5278 | -S "SSL - Unknown identity received" \ | 
|  | 5279 | -S "SSL - Verification of the message MAC failed" | 
|  | 5280 |  | 
|  | 5281 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5282 | 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] | 5283 | "$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] | 5284 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5285 | psk_identity=def psk=beef" \ | 
|  | 5286 | 0 \ | 
|  | 5287 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5288 | -C "session hash for extended master secret"\ | 
|  | 5289 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5290 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5291 | -S "SSL - Unknown identity received" \ | 
|  | 5292 | -S "SSL - Verification of the message MAC failed" | 
|  | 5293 |  | 
|  | 5294 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5295 | 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] | 5296 | "$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] | 5297 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5298 | psk_identity=def psk=beef" \ | 
|  | 5299 | 1 \ | 
|  | 5300 | -s "SSL - Verification of the message MAC failed" | 
|  | 5301 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5302 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5303 | "$P_SRV" \ | 
|  | 5304 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5305 | psk_identity=foo psk=abc123" \ | 
|  | 5306 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5307 | -s "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5308 | -S "SSL - Unknown identity received" \ | 
|  | 5309 | -S "SSL - Verification of the message MAC failed" | 
|  | 5310 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5311 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5312 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 5313 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5314 | psk_identity=foo psk=abc123" \ | 
|  | 5315 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5316 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5317 | -s "SSL - Unknown identity received" \ | 
|  | 5318 | -S "SSL - Verification of the message MAC failed" | 
|  | 5319 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5320 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5321 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5322 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5323 | psk_identity=abc psk=dead" \ | 
|  | 5324 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5325 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5326 | -S "SSL - Unknown identity received" \ | 
|  | 5327 | -S "SSL - Verification of the message MAC failed" | 
|  | 5328 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5329 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5330 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5331 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5332 | psk_identity=def psk=beef" \ | 
|  | 5333 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5334 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5335 | -S "SSL - Unknown identity received" \ | 
|  | 5336 | -S "SSL - Verification of the message MAC failed" | 
|  | 5337 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5338 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5339 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5340 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5341 | psk_identity=ghi psk=beef" \ | 
|  | 5342 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5343 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5344 | -s "SSL - Unknown identity received" \ | 
|  | 5345 | -S "SSL - Verification of the message MAC failed" | 
|  | 5346 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5347 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5348 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5349 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5350 | psk_identity=abc psk=beef" \ | 
|  | 5351 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5352 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5353 | -S "SSL - Unknown identity received" \ | 
|  | 5354 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5355 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5356 | # Tests for EC J-PAKE | 
|  | 5357 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5358 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5359 | run_test    "ECJPAKE: client not configured" \ | 
|  | 5360 | "$P_SRV debug_level=3" \ | 
|  | 5361 | "$P_CLI debug_level=3" \ | 
|  | 5362 | 0 \ | 
|  | 5363 | -C "add ciphersuite: c0ff" \ | 
|  | 5364 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5365 | -S "found ecjpake kkpp extension" \ | 
|  | 5366 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5367 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5368 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5369 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5370 | -S "None of the common ciphersuites is usable" | 
|  | 5371 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5372 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5373 | run_test    "ECJPAKE: server not configured" \ | 
|  | 5374 | "$P_SRV debug_level=3" \ | 
|  | 5375 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5376 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5377 | 1 \ | 
|  | 5378 | -c "add ciphersuite: c0ff" \ | 
|  | 5379 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5380 | -s "found ecjpake kkpp extension" \ | 
|  | 5381 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5382 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5383 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5384 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5385 | -s "None of the common ciphersuites is usable" | 
|  | 5386 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5387 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5388 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 5389 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5390 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5391 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5392 | 0 \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5393 | -c "add ciphersuite: c0ff" \ | 
|  | 5394 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5395 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5396 | -s "found ecjpake kkpp extension" \ | 
|  | 5397 | -S "skip ecjpake kkpp extension" \ | 
|  | 5398 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5399 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5400 | -c "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5401 | -S "None of the common ciphersuites is usable" \ | 
|  | 5402 | -S "SSL - Verification of the message MAC failed" | 
|  | 5403 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5404 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5405 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5406 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 5407 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5408 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 5409 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5410 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5411 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5412 | -s "SSL - Verification of the message MAC failed" | 
|  | 5413 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5414 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5415 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 5416 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5417 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5418 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5419 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5420 | -c "re-using cached ecjpake parameters" \ | 
|  | 5421 | -S "SSL - Verification of the message MAC failed" | 
|  | 5422 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5423 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5424 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 5425 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 5426 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5427 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5428 | 0 \ | 
|  | 5429 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5430 | -S "SSL - Verification of the message MAC failed" | 
|  | 5431 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5432 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5433 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5434 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 5435 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5436 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 5437 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5438 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5439 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5440 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5441 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5442 | # for tests with configs/config-thread.h | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5443 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5444 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 5445 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 5446 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 5447 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5448 | 0 | 
|  | 5449 |  | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5450 | # Tests for ciphersuites per version | 
|  | 5451 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5452 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5453 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5454 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5455 | run_test    "Per-version suites: SSL3" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5456 | "$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] | 5457 | "$P_CLI force_version=ssl3" \ | 
|  | 5458 | 0 \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5459 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5460 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 | 
|  | 5462 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5463 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5464 | run_test    "Per-version suites: TLS 1.0" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5465 | "$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] | 5466 | "$P_CLI force_version=tls1 arc4=1" \ | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5467 | 0 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5468 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5469 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 5471 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5472 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5473 | run_test    "Per-version suites: TLS 1.1" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5474 | "$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] | 5475 | "$P_CLI force_version=tls1_1" \ | 
|  | 5476 | 0 \ | 
|  | 5477 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" | 
|  | 5478 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5479 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5480 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5481 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5482 | run_test    "Per-version suites: TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5483 | "$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] | 5484 | "$P_CLI force_version=tls1_2" \ | 
|  | 5485 | 0 \ | 
|  | 5486 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" | 
|  | 5487 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5488 | # Test for ClientHello without extensions | 
|  | 5489 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5490 | requires_gnutls | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5491 | run_test    "ClientHello without extensions, SHA-1 allowed" \ | 
| Ron Eldor | 574ac57 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 5492 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5493 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5494 | 0 \ | 
|  | 5495 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 5496 |  | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5497 | requires_gnutls | 
|  | 5498 | run_test    "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ | 
|  | 5499 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt allow_sha1=0" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5500 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5501 | 0 \ | 
|  | 5502 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 5503 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5504 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5505 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5506 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5507 | "$P_SRV" \ | 
|  | 5508 | "$P_CLI request_size=100" \ | 
|  | 5509 | 0 \ | 
|  | 5510 | -s "Read from client: 100 bytes read$" | 
|  | 5511 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5512 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5513 | "$P_SRV" \ | 
|  | 5514 | "$P_CLI request_size=500" \ | 
|  | 5515 | 0 \ | 
|  | 5516 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5517 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5518 | # Tests for small client packets | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5519 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5520 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5521 | run_test    "Small client packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5522 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5523 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 5524 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5525 | 0 \ | 
|  | 5526 | -s "Read from client: 1 bytes read" | 
|  | 5527 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5528 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5529 | run_test    "Small client packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5530 | "$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] | 5531 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 5532 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5533 | 0 \ | 
|  | 5534 | -s "Read from client: 1 bytes read" | 
|  | 5535 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5536 | run_test    "Small client packet TLS 1.0 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5537 | "$P_SRV" \ | 
|  | 5538 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 5539 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5540 | 0 \ | 
|  | 5541 | -s "Read from client: 1 bytes read" | 
|  | 5542 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5543 | 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] | 5544 | "$P_SRV" \ | 
|  | 5545 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ | 
|  | 5546 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5547 | 0 \ | 
|  | 5548 | -s "Read from client: 1 bytes read" | 
|  | 5549 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5550 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5551 | run_test    "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5552 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5553 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5554 | 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] | 5555 | 0 \ | 
|  | 5556 | -s "Read from client: 1 bytes read" | 
|  | 5557 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5558 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5559 | 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] | 5560 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5561 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5562 | 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] | 5563 | 0 \ | 
|  | 5564 | -s "Read from client: 1 bytes read" | 
|  | 5565 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5566 | run_test    "Small client packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5567 | "$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] | 5568 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5569 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5570 | 0 \ | 
|  | 5571 | -s "Read from client: 1 bytes read" | 
|  | 5572 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5573 | run_test    "Small client packet TLS 1.0 StreamCipher, without EtM" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5574 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5575 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5576 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5577 | 0 \ | 
|  | 5578 | -s "Read from client: 1 bytes read" | 
|  | 5579 |  | 
|  | 5580 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5581 | run_test    "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5582 | "$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] | 5583 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5584 | 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] | 5585 | 0 \ | 
|  | 5586 | -s "Read from client: 1 bytes read" | 
|  | 5587 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5588 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5589 | 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] | 5590 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5591 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 5592 | trunc_hmac=1 etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5593 | 0 \ | 
|  | 5594 | -s "Read from client: 1 bytes read" | 
|  | 5595 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5596 | run_test    "Small client packet TLS 1.1 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5597 | "$P_SRV" \ | 
|  | 5598 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 5599 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5600 | 0 \ | 
|  | 5601 | -s "Read from client: 1 bytes read" | 
|  | 5602 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5603 | 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] | 5604 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5605 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5606 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5607 | 0 \ | 
|  | 5608 | -s "Read from client: 1 bytes read" | 
|  | 5609 |  | 
|  | 5610 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5611 | run_test    "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5612 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5613 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5614 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5615 | 0 \ | 
|  | 5616 | -s "Read from client: 1 bytes read" | 
|  | 5617 |  | 
|  | 5618 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5619 | 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] | 5620 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5621 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5622 | 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] | 5623 | 0 \ | 
|  | 5624 | -s "Read from client: 1 bytes read" | 
|  | 5625 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5626 | run_test    "Small client packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5627 | "$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] | 5628 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 5629 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5630 | 0 \ | 
|  | 5631 | -s "Read from client: 1 bytes read" | 
|  | 5632 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5633 | run_test    "Small client packet TLS 1.1 StreamCipher, without EtM" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5634 | "$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] | 5635 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5636 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5637 | 0 \ | 
|  | 5638 | -s "Read from client: 1 bytes read" | 
|  | 5639 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5640 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5641 | run_test    "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5642 | "$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] | 5643 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5644 | 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] | 5645 | 0 \ | 
|  | 5646 | -s "Read from client: 1 bytes read" | 
|  | 5647 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5648 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5649 | 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] | 5650 | "$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] | 5651 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5652 | 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] | 5653 | 0 \ | 
|  | 5654 | -s "Read from client: 1 bytes read" | 
|  | 5655 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5656 | run_test    "Small client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5657 | "$P_SRV" \ | 
|  | 5658 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5660 | 0 \ | 
|  | 5661 | -s "Read from client: 1 bytes read" | 
|  | 5662 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5663 | 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] | 5664 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5665 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5666 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 5667 | 0 \ | 
|  | 5668 | -s "Read from client: 1 bytes read" | 
|  | 5669 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5670 | 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] | 5671 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5672 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5673 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5674 | 0 \ | 
|  | 5675 | -s "Read from client: 1 bytes read" | 
|  | 5676 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5677 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5678 | run_test    "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5679 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5680 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5681 | 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] | 5682 | 0 \ | 
|  | 5683 | -s "Read from client: 1 bytes read" | 
|  | 5684 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5685 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5686 | 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] | 5687 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5688 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5689 | 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] | 5690 | 0 \ | 
|  | 5691 | -s "Read from client: 1 bytes read" | 
|  | 5692 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5693 | run_test    "Small client packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5694 | "$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] | 5695 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5696 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5697 | 0 \ | 
|  | 5698 | -s "Read from client: 1 bytes read" | 
|  | 5699 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5700 | 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] | 5701 | "$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] | 5702 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5703 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5704 | 0 \ | 
|  | 5705 | -s "Read from client: 1 bytes read" | 
|  | 5706 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5707 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5708 | run_test    "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5709 | "$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] | 5710 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5711 | 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] | 5712 | 0 \ | 
|  | 5713 | -s "Read from client: 1 bytes read" | 
|  | 5714 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5716 | 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] | 5717 | "$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] | 5718 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5719 | 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] | 5720 | 0 \ | 
|  | 5721 | -s "Read from client: 1 bytes read" | 
|  | 5722 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5723 | run_test    "Small client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5724 | "$P_SRV" \ | 
|  | 5725 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5726 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 5727 | 0 \ | 
|  | 5728 | -s "Read from client: 1 bytes read" | 
|  | 5729 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5730 | 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] | 5731 | "$P_SRV" \ | 
|  | 5732 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 5733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 5734 | 0 \ | 
|  | 5735 | -s "Read from client: 1 bytes read" | 
|  | 5736 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5737 | # Tests for small client packets in DTLS | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5738 |  | 
|  | 5739 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5740 | run_test    "Small client packet DTLS 1.0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5741 | "$P_SRV dtls=1 force_version=dtls1" \ | 
|  | 5742 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5743 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5744 | 0 \ | 
|  | 5745 | -s "Read from client: 1 bytes read" | 
|  | 5746 |  | 
|  | 5747 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5748 | run_test    "Small client packet DTLS 1.0, without EtM" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5749 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ | 
|  | 5750 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5752 | 0 \ | 
|  | 5753 | -s "Read from client: 1 bytes read" | 
|  | 5754 |  | 
|  | 5755 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5756 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5757 | run_test    "Small client packet DTLS 1.0, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5758 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 5759 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5760 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5761 | 0 \ | 
|  | 5762 | -s "Read from client: 1 bytes read" | 
|  | 5763 |  | 
|  | 5764 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5765 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5766 | run_test    "Small client packet DTLS 1.0, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5767 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5768 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5770 | 0 \ | 
|  | 5771 | -s "Read from client: 1 bytes read" | 
|  | 5772 |  | 
|  | 5773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5774 | run_test    "Small client packet DTLS 1.2" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5775 | "$P_SRV dtls=1 force_version=dtls1_2" \ | 
|  | 5776 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5777 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5778 | 0 \ | 
|  | 5779 | -s "Read from client: 1 bytes read" | 
|  | 5780 |  | 
|  | 5781 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5782 | run_test    "Small client packet DTLS 1.2, without EtM" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5783 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5784 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 5785 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5786 | 0 \ | 
|  | 5787 | -s "Read from client: 1 bytes read" | 
|  | 5788 |  | 
|  | 5789 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5790 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5791 | run_test    "Small client packet DTLS 1.2, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5792 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5793 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5794 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5795 | 0 \ | 
|  | 5796 | -s "Read from client: 1 bytes read" | 
|  | 5797 |  | 
|  | 5798 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5799 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5800 | run_test    "Small client packet DTLS 1.2, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5801 | "$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] | 5802 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5803 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5804 | 0 \ | 
|  | 5805 | -s "Read from client: 1 bytes read" | 
|  | 5806 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5807 | # Tests for small server packets | 
|  | 5808 |  | 
|  | 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 5810 | run_test    "Small server packet SSLv3 BlockCipher" \ | 
|  | 5811 | "$P_SRV response_size=1 min_version=ssl3" \ | 
|  | 5812 | "$P_CLI force_version=ssl3 \ | 
|  | 5813 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5814 | 0 \ | 
|  | 5815 | -c "Read from server: 1 bytes read" | 
|  | 5816 |  | 
|  | 5817 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 5818 | run_test    "Small server packet SSLv3 StreamCipher" \ | 
|  | 5819 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5820 | "$P_CLI force_version=ssl3 \ | 
|  | 5821 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5822 | 0 \ | 
|  | 5823 | -c "Read from server: 1 bytes read" | 
|  | 5824 |  | 
|  | 5825 | run_test    "Small server packet TLS 1.0 BlockCipher" \ | 
|  | 5826 | "$P_SRV response_size=1" \ | 
|  | 5827 | "$P_CLI force_version=tls1 \ | 
|  | 5828 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5829 | 0 \ | 
|  | 5830 | -c "Read from server: 1 bytes read" | 
|  | 5831 |  | 
|  | 5832 | run_test    "Small server packet TLS 1.0 BlockCipher, without EtM" \ | 
|  | 5833 | "$P_SRV response_size=1" \ | 
|  | 5834 | "$P_CLI force_version=tls1 etm=0 \ | 
|  | 5835 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5836 | 0 \ | 
|  | 5837 | -c "Read from server: 1 bytes read" | 
|  | 5838 |  | 
|  | 5839 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5840 | run_test    "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ | 
|  | 5841 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5842 | "$P_CLI force_version=tls1 \ | 
|  | 5843 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 5844 | 0 \ | 
|  | 5845 | -c "Read from server: 1 bytes read" | 
|  | 5846 |  | 
|  | 5847 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5848 | run_test    "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
|  | 5849 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5850 | "$P_CLI force_version=tls1 \ | 
|  | 5851 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 5852 | 0 \ | 
|  | 5853 | -c "Read from server: 1 bytes read" | 
|  | 5854 |  | 
|  | 5855 | run_test    "Small server packet TLS 1.0 StreamCipher" \ | 
|  | 5856 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5857 | "$P_CLI force_version=tls1 \ | 
|  | 5858 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5859 | 0 \ | 
|  | 5860 | -c "Read from server: 1 bytes read" | 
|  | 5861 |  | 
|  | 5862 | run_test    "Small server packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 5863 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5864 | "$P_CLI force_version=tls1 \ | 
|  | 5865 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 5866 | 0 \ | 
|  | 5867 | -c "Read from server: 1 bytes read" | 
|  | 5868 |  | 
|  | 5869 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5870 | run_test    "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ | 
|  | 5871 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5872 | "$P_CLI force_version=tls1 \ | 
|  | 5873 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5874 | 0 \ | 
|  | 5875 | -c "Read from server: 1 bytes read" | 
|  | 5876 |  | 
|  | 5877 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5878 | run_test    "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
|  | 5879 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5880 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 5881 | trunc_hmac=1 etm=0" \ | 
|  | 5882 | 0 \ | 
|  | 5883 | -c "Read from server: 1 bytes read" | 
|  | 5884 |  | 
|  | 5885 | run_test    "Small server packet TLS 1.1 BlockCipher" \ | 
|  | 5886 | "$P_SRV response_size=1" \ | 
|  | 5887 | "$P_CLI force_version=tls1_1 \ | 
|  | 5888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5889 | 0 \ | 
|  | 5890 | -c "Read from server: 1 bytes read" | 
|  | 5891 |  | 
|  | 5892 | run_test    "Small server packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 5893 | "$P_SRV response_size=1" \ | 
|  | 5894 | "$P_CLI force_version=tls1_1 \ | 
|  | 5895 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 5896 | 0 \ | 
|  | 5897 | -c "Read from server: 1 bytes read" | 
|  | 5898 |  | 
|  | 5899 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5900 | run_test    "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ | 
|  | 5901 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5902 | "$P_CLI force_version=tls1_1 \ | 
|  | 5903 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 5904 | 0 \ | 
|  | 5905 | -c "Read from server: 1 bytes read" | 
|  | 5906 |  | 
|  | 5907 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5908 | run_test    "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
|  | 5909 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5910 | "$P_CLI force_version=tls1_1 \ | 
|  | 5911 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 5912 | 0 \ | 
|  | 5913 | -c "Read from server: 1 bytes read" | 
|  | 5914 |  | 
|  | 5915 | run_test    "Small server packet TLS 1.1 StreamCipher" \ | 
|  | 5916 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5917 | "$P_CLI force_version=tls1_1 \ | 
|  | 5918 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5919 | 0 \ | 
|  | 5920 | -c "Read from server: 1 bytes read" | 
|  | 5921 |  | 
|  | 5922 | run_test    "Small server packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 5923 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5924 | "$P_CLI force_version=tls1_1 \ | 
|  | 5925 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 5926 | 0 \ | 
|  | 5927 | -c "Read from server: 1 bytes read" | 
|  | 5928 |  | 
|  | 5929 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5930 | run_test    "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ | 
|  | 5931 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5932 | "$P_CLI force_version=tls1_1 \ | 
|  | 5933 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5934 | 0 \ | 
|  | 5935 | -c "Read from server: 1 bytes read" | 
|  | 5936 |  | 
|  | 5937 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5938 | run_test    "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
|  | 5939 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5940 | "$P_CLI force_version=tls1_1 \ | 
|  | 5941 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 5942 | 0 \ | 
|  | 5943 | -c "Read from server: 1 bytes read" | 
|  | 5944 |  | 
|  | 5945 | run_test    "Small server packet TLS 1.2 BlockCipher" \ | 
|  | 5946 | "$P_SRV response_size=1" \ | 
|  | 5947 | "$P_CLI force_version=tls1_2 \ | 
|  | 5948 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 5949 | 0 \ | 
|  | 5950 | -c "Read from server: 1 bytes read" | 
|  | 5951 |  | 
|  | 5952 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 5953 | "$P_SRV response_size=1" \ | 
|  | 5954 | "$P_CLI force_version=tls1_2 \ | 
|  | 5955 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 5956 | 0 \ | 
|  | 5957 | -c "Read from server: 1 bytes read" | 
|  | 5958 |  | 
|  | 5959 | run_test    "Small server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 5960 | "$P_SRV response_size=1" \ | 
|  | 5961 | "$P_CLI force_version=tls1_2 \ | 
|  | 5962 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 5963 | 0 \ | 
|  | 5964 | -c "Read from server: 1 bytes read" | 
|  | 5965 |  | 
|  | 5966 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5967 | run_test    "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ | 
|  | 5968 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5969 | "$P_CLI force_version=tls1_2 \ | 
|  | 5970 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 5971 | 0 \ | 
|  | 5972 | -c "Read from server: 1 bytes read" | 
|  | 5973 |  | 
|  | 5974 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5975 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 5976 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 5977 | "$P_CLI force_version=tls1_2 \ | 
|  | 5978 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 5979 | 0 \ | 
|  | 5980 | -c "Read from server: 1 bytes read" | 
|  | 5981 |  | 
|  | 5982 | run_test    "Small server packet TLS 1.2 StreamCipher" \ | 
|  | 5983 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5984 | "$P_CLI force_version=tls1_2 \ | 
|  | 5985 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5986 | 0 \ | 
|  | 5987 | -c "Read from server: 1 bytes read" | 
|  | 5988 |  | 
|  | 5989 | run_test    "Small server packet TLS 1.2 StreamCipher, without EtM" \ | 
|  | 5990 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 5991 | "$P_CLI force_version=tls1_2 \ | 
|  | 5992 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 5993 | 0 \ | 
|  | 5994 | -c "Read from server: 1 bytes read" | 
|  | 5995 |  | 
|  | 5996 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 5997 | run_test    "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ | 
|  | 5998 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 5999 | "$P_CLI force_version=tls1_2 \ | 
|  | 6000 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6001 | 0 \ | 
|  | 6002 | -c "Read from server: 1 bytes read" | 
|  | 6003 |  | 
|  | 6004 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6005 | run_test    "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6006 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6007 | "$P_CLI force_version=tls1_2 \ | 
|  | 6008 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6009 | 0 \ | 
|  | 6010 | -c "Read from server: 1 bytes read" | 
|  | 6011 |  | 
|  | 6012 | run_test    "Small server packet TLS 1.2 AEAD" \ | 
|  | 6013 | "$P_SRV response_size=1" \ | 
|  | 6014 | "$P_CLI force_version=tls1_2 \ | 
|  | 6015 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6016 | 0 \ | 
|  | 6017 | -c "Read from server: 1 bytes read" | 
|  | 6018 |  | 
|  | 6019 | run_test    "Small server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 6020 | "$P_SRV response_size=1" \ | 
|  | 6021 | "$P_CLI force_version=tls1_2 \ | 
|  | 6022 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6023 | 0 \ | 
|  | 6024 | -c "Read from server: 1 bytes read" | 
|  | 6025 |  | 
|  | 6026 | # Tests for small server packets in DTLS | 
|  | 6027 |  | 
|  | 6028 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6029 | run_test    "Small server packet DTLS 1.0" \ | 
|  | 6030 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ | 
|  | 6031 | "$P_CLI dtls=1 \ | 
|  | 6032 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6033 | 0 \ | 
|  | 6034 | -c "Read from server: 1 bytes read" | 
|  | 6035 |  | 
|  | 6036 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6037 | run_test    "Small server packet DTLS 1.0, without EtM" \ | 
|  | 6038 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ | 
|  | 6039 | "$P_CLI dtls=1 \ | 
|  | 6040 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6041 | 0 \ | 
|  | 6042 | -c "Read from server: 1 bytes read" | 
|  | 6043 |  | 
|  | 6044 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6045 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6046 | run_test    "Small server packet DTLS 1.0, truncated hmac" \ | 
|  | 6047 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 6048 | "$P_CLI dtls=1 trunc_hmac=1 \ | 
|  | 6049 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6050 | 0 \ | 
|  | 6051 | -c "Read from server: 1 bytes read" | 
|  | 6052 |  | 
|  | 6053 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6054 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6055 | run_test    "Small server packet DTLS 1.0, without EtM, truncated MAC" \ | 
|  | 6056 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
|  | 6057 | "$P_CLI dtls=1 \ | 
|  | 6058 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
|  | 6059 | 0 \ | 
|  | 6060 | -c "Read from server: 1 bytes read" | 
|  | 6061 |  | 
|  | 6062 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6063 | run_test    "Small server packet DTLS 1.2" \ | 
|  | 6064 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ | 
|  | 6065 | "$P_CLI dtls=1 \ | 
|  | 6066 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6067 | 0 \ | 
|  | 6068 | -c "Read from server: 1 bytes read" | 
|  | 6069 |  | 
|  | 6070 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6071 | run_test    "Small server packet DTLS 1.2, without EtM" \ | 
|  | 6072 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ | 
|  | 6073 | "$P_CLI dtls=1 \ | 
|  | 6074 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6075 | 0 \ | 
|  | 6076 | -c "Read from server: 1 bytes read" | 
|  | 6077 |  | 
|  | 6078 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6079 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6080 | run_test    "Small server packet DTLS 1.2, truncated hmac" \ | 
|  | 6081 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ | 
|  | 6082 | "$P_CLI dtls=1 \ | 
|  | 6083 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 6084 | 0 \ | 
|  | 6085 | -c "Read from server: 1 bytes read" | 
|  | 6086 |  | 
|  | 6087 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6088 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6089 | run_test    "Small server packet DTLS 1.2, without EtM, truncated MAC" \ | 
|  | 6090 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ | 
|  | 6091 | "$P_CLI dtls=1 \ | 
|  | 6092 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
|  | 6093 | 0 \ | 
|  | 6094 | -c "Read from server: 1 bytes read" | 
|  | 6095 |  | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6096 | # A test for extensions in SSLv3 | 
|  | 6097 |  | 
|  | 6098 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6099 | run_test    "SSLv3 with extensions, server side" \ | 
|  | 6100 | "$P_SRV min_version=ssl3 debug_level=3" \ | 
|  | 6101 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ | 
|  | 6102 | 0 \ | 
|  | 6103 | -S "dumping 'client hello extensions'" \ | 
|  | 6104 | -S "server hello, total extension length:" | 
|  | 6105 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6106 | # Test for large client packets | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6107 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6108 | # How many fragments do we expect to write $1 bytes? | 
|  | 6109 | fragments_for_write() { | 
|  | 6110 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 6111 | } | 
|  | 6112 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6113 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6114 | run_test    "Large client packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6115 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6116 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6117 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6118 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6119 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6120 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6121 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6122 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6123 | run_test    "Large client packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6124 | "$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] | 6125 | "$P_CLI request_size=16384 force_version=ssl3 \ | 
|  | 6126 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6127 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6128 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6129 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6130 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6131 | run_test    "Large client packet TLS 1.0 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6132 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6133 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6134 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6135 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6136 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6137 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6138 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6139 | 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] | 6140 | "$P_SRV" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6141 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
|  | 6142 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6143 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6144 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6145 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6147 | run_test    "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6148 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6149 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6150 | 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] | 6151 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6152 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6153 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6154 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6156 | 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] | 6157 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6158 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6159 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6160 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6161 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6162 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6163 | run_test    "Large client packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6164 | "$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] | 6165 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6166 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6167 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6168 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6169 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6170 | run_test    "Large client packet TLS 1.0 StreamCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6171 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6172 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6173 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6174 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6175 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6176 |  | 
|  | 6177 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6178 | run_test    "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6179 | "$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] | 6180 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6181 | 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] | 6182 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6183 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6184 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6185 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6186 | 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] | 6187 | "$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] | 6188 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6189 | 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] | 6190 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6191 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6192 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6193 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6194 | run_test    "Large client packet TLS 1.1 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6195 | "$P_SRV" \ | 
|  | 6196 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 6197 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6198 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6199 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6200 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6201 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6202 | run_test    "Large client packet TLS 1.1 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6203 | "$P_SRV" \ | 
|  | 6204 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ | 
|  | 6205 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6206 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6207 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6208 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6210 | run_test    "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6211 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6212 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6213 | 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] | 6214 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6215 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6216 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6218 | 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] | 6219 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6220 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6221 | 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] | 6222 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6223 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6224 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6225 | run_test    "Large client packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6226 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6227 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 6228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6229 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6230 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6231 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6232 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6233 | run_test    "Large client packet TLS 1.1 StreamCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6234 | "$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] | 6235 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6236 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6237 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6238 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6239 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6240 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6242 | run_test    "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6243 | "$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] | 6244 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6245 | 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] | 6246 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6247 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6248 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6250 | 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] | 6251 | "$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] | 6252 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6253 | 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] | 6254 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6255 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6256 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6257 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6258 | run_test    "Large client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6259 | "$P_SRV" \ | 
|  | 6260 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6262 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6263 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6264 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6265 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6266 | run_test    "Large client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6267 | "$P_SRV" \ | 
|  | 6268 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ | 
|  | 6269 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 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 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6273 | 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] | 6274 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6275 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6276 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6277 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6278 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 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 | 32c5501 | 2017-11-10 08:42:54 +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.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6283 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6284 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6285 | 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] | 6286 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6287 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6288 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6289 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6290 | 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] | 6291 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6292 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6293 | 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] | 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.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6299 | "$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] | 6300 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6302 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6303 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6304 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6305 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6306 | 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] | 6307 | "$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] | 6308 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6309 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6310 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6311 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [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.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6315 | "$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] | 6316 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6317 | 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] | 6318 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6319 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6320 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6321 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6322 | 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] | 6323 | "$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] | 6324 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6325 | 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] | 6326 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6327 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6328 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6329 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6330 | run_test    "Large client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6331 | "$P_SRV" \ | 
|  | 6332 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6334 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6335 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6336 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6337 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6338 | 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] | 6339 | "$P_SRV" \ | 
|  | 6340 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6342 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6343 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6344 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6345 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6346 | # Test for large server packets | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6347 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6348 | run_test    "Large server packet SSLv3 StreamCipher" \ | 
|  | 6349 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6350 | "$P_CLI force_version=ssl3 \ | 
|  | 6351 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6352 | 0 \ | 
|  | 6353 | -c "Read from server: 16384 bytes read" | 
|  | 6354 |  | 
| Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6355 | # Checking next 4 tests logs for 1n-1 split against BEAST too | 
|  | 6356 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6357 | run_test    "Large server packet SSLv3 BlockCipher" \ | 
|  | 6358 | "$P_SRV response_size=16384 min_version=ssl3" \ | 
|  | 6359 | "$P_CLI force_version=ssl3 recsplit=0 \ | 
|  | 6360 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6361 | 0 \ | 
|  | 6362 | -c "Read from server: 1 bytes read"\ | 
|  | 6363 | -c "16383 bytes read"\ | 
|  | 6364 | -C "Read from server: 16384 bytes read" | 
|  | 6365 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6366 | run_test    "Large server packet TLS 1.0 BlockCipher" \ | 
|  | 6367 | "$P_SRV response_size=16384" \ | 
|  | 6368 | "$P_CLI force_version=tls1 recsplit=0 \ | 
|  | 6369 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6370 | 0 \ | 
|  | 6371 | -c "Read from server: 1 bytes read"\ | 
|  | 6372 | -c "16383 bytes read"\ | 
|  | 6373 | -C "Read from server: 16384 bytes read" | 
|  | 6374 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6375 | run_test    "Large server packet TLS 1.0 BlockCipher, without EtM" \ | 
|  | 6376 | "$P_SRV response_size=16384" \ | 
|  | 6377 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ | 
|  | 6378 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6379 | 0 \ | 
|  | 6380 | -c "Read from server: 1 bytes read"\ | 
|  | 6381 | -c "16383 bytes read"\ | 
|  | 6382 | -C "Read from server: 16384 bytes read" | 
|  | 6383 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6384 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6385 | run_test    "Large server packet TLS 1.0 BlockCipher truncated MAC" \ | 
|  | 6386 | "$P_SRV response_size=16384" \ | 
|  | 6387 | "$P_CLI force_version=tls1 recsplit=0 \ | 
|  | 6388 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 6389 | trunc_hmac=1" \ | 
|  | 6390 | 0 \ | 
|  | 6391 | -c "Read from server: 1 bytes read"\ | 
|  | 6392 | -c "16383 bytes read"\ | 
|  | 6393 | -C "Read from server: 16384 bytes read" | 
|  | 6394 |  | 
|  | 6395 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6396 | run_test    "Large server packet TLS 1.0 StreamCipher truncated MAC" \ | 
|  | 6397 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6398 | "$P_CLI force_version=tls1 \ | 
|  | 6399 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6400 | trunc_hmac=1" \ | 
|  | 6401 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6402 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6403 | -c "Read from server: 16384 bytes read" | 
|  | 6404 |  | 
|  | 6405 | run_test    "Large server packet TLS 1.0 StreamCipher" \ | 
|  | 6406 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6407 | "$P_CLI force_version=tls1 \ | 
|  | 6408 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6409 | 0 \ | 
|  | 6410 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6411 | -c "Read from server: 16384 bytes read" | 
|  | 6412 |  | 
|  | 6413 | run_test    "Large server packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 6414 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6415 | "$P_CLI force_version=tls1 \ | 
|  | 6416 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6417 | 0 \ | 
|  | 6418 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6419 | -c "Read from server: 16384 bytes read" | 
|  | 6420 |  | 
|  | 6421 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6422 | run_test    "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ | 
|  | 6423 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6424 | "$P_CLI force_version=tls1 \ | 
|  | 6425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6426 | 0 \ | 
|  | 6427 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6428 | -c "Read from server: 16384 bytes read" | 
|  | 6429 |  | 
|  | 6430 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6431 | run_test    "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6432 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6433 | "$P_CLI force_version=tls1 \ | 
|  | 6434 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6435 | 0 \ | 
|  | 6436 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6437 | -c "Read from server: 16384 bytes read" | 
|  | 6438 |  | 
|  | 6439 | run_test    "Large server packet TLS 1.1 BlockCipher" \ | 
|  | 6440 | "$P_SRV response_size=16384" \ | 
|  | 6441 | "$P_CLI force_version=tls1_1 \ | 
|  | 6442 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6443 | 0 \ | 
|  | 6444 | -c "Read from server: 16384 bytes read" | 
|  | 6445 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6446 | run_test    "Large server packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 6447 | "$P_SRV response_size=16384" \ | 
|  | 6448 | "$P_CLI force_version=tls1_1 etm=0 \ | 
|  | 6449 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6450 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6451 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6452 | -c "Read from server: 16384 bytes read" | 
|  | 6453 |  | 
|  | 6454 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6455 | run_test    "Large server packet TLS 1.1 BlockCipher truncated MAC" \ | 
|  | 6456 | "$P_SRV response_size=16384" \ | 
|  | 6457 | "$P_CLI force_version=tls1_1 \ | 
|  | 6458 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 6459 | trunc_hmac=1" \ | 
|  | 6460 | 0 \ | 
|  | 6461 | -c "Read from server: 16384 bytes read" | 
|  | 6462 |  | 
|  | 6463 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6464 | run_test    "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6465 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
|  | 6466 | "$P_CLI force_version=tls1_1 \ | 
|  | 6467 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6468 | 0 \ | 
|  | 6469 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6470 | -c "Read from server: 16384 bytes read" | 
|  | 6471 |  | 
|  | 6472 | run_test    "Large server packet TLS 1.1 StreamCipher" \ | 
|  | 6473 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6474 | "$P_CLI force_version=tls1_1 \ | 
|  | 6475 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6476 | 0 \ | 
|  | 6477 | -c "Read from server: 16384 bytes read" | 
|  | 6478 |  | 
|  | 6479 | run_test    "Large server packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 6480 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6481 | "$P_CLI force_version=tls1_1 \ | 
|  | 6482 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6483 | 0 \ | 
|  | 6484 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6485 | -c "Read from server: 16384 bytes read" | 
|  | 6486 |  | 
|  | 6487 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6488 | run_test    "Large server packet TLS 1.1 StreamCipher truncated MAC" \ | 
|  | 6489 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6490 | "$P_CLI force_version=tls1_1 \ | 
|  | 6491 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6492 | trunc_hmac=1" \ | 
|  | 6493 | 0 \ | 
|  | 6494 | -c "Read from server: 16384 bytes read" | 
|  | 6495 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6496 | run_test    "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6497 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6498 | "$P_CLI force_version=tls1_1 \ | 
|  | 6499 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6500 | 0 \ | 
|  | 6501 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6502 | -c "Read from server: 16384 bytes read" | 
|  | 6503 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6504 | run_test    "Large server packet TLS 1.2 BlockCipher" \ | 
|  | 6505 | "$P_SRV response_size=16384" \ | 
|  | 6506 | "$P_CLI force_version=tls1_2 \ | 
|  | 6507 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6508 | 0 \ | 
|  | 6509 | -c "Read from server: 16384 bytes read" | 
|  | 6510 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6511 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 6512 | "$P_SRV response_size=16384" \ | 
|  | 6513 | "$P_CLI force_version=tls1_2 etm=0 \ | 
|  | 6514 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6515 | 0 \ | 
|  | 6516 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6517 | -c "Read from server: 16384 bytes read" | 
|  | 6518 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6519 | run_test    "Large server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 6520 | "$P_SRV response_size=16384" \ | 
|  | 6521 | "$P_CLI force_version=tls1_2 \ | 
|  | 6522 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 6523 | 0 \ | 
|  | 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.2 BlockCipher truncated MAC" \ | 
|  | 6528 | "$P_SRV response_size=16384" \ | 
|  | 6529 | "$P_CLI force_version=tls1_2 \ | 
|  | 6530 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 6531 | trunc_hmac=1" \ | 
|  | 6532 | 0 \ | 
|  | 6533 | -c "Read from server: 16384 bytes read" | 
|  | 6534 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6535 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6536 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
|  | 6537 | "$P_CLI force_version=tls1_2 \ | 
|  | 6538 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6539 | 0 \ | 
|  | 6540 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6541 | -c "Read from server: 16384 bytes read" | 
|  | 6542 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6543 | run_test    "Large server packet TLS 1.2 StreamCipher" \ | 
|  | 6544 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6545 | "$P_CLI force_version=tls1_2 \ | 
|  | 6546 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6547 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6548 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6549 | -c "Read from server: 16384 bytes read" | 
|  | 6550 |  | 
|  | 6551 | run_test    "Large server packet TLS 1.2 StreamCipher, without EtM" \ | 
|  | 6552 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6553 | "$P_CLI force_version=tls1_2 \ | 
|  | 6554 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6555 | 0 \ | 
|  | 6556 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6557 | -c "Read from server: 16384 bytes read" | 
|  | 6558 |  | 
|  | 6559 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6560 | run_test    "Large server packet TLS 1.2 StreamCipher truncated MAC" \ | 
|  | 6561 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6562 | "$P_CLI force_version=tls1_2 \ | 
|  | 6563 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6564 | trunc_hmac=1" \ | 
|  | 6565 | 0 \ | 
|  | 6566 | -c "Read from server: 16384 bytes read" | 
|  | 6567 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6569 | run_test    "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6570 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6571 | "$P_CLI force_version=tls1_2 \ | 
|  | 6572 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6573 | 0 \ | 
|  | 6574 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6575 | -c "Read from server: 16384 bytes read" | 
|  | 6576 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6577 | run_test    "Large server packet TLS 1.2 AEAD" \ | 
|  | 6578 | "$P_SRV response_size=16384" \ | 
|  | 6579 | "$P_CLI force_version=tls1_2 \ | 
|  | 6580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6581 | 0 \ | 
|  | 6582 | -c "Read from server: 16384 bytes read" | 
|  | 6583 |  | 
|  | 6584 | run_test    "Large server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 6585 | "$P_SRV response_size=16384" \ | 
|  | 6586 | "$P_CLI force_version=tls1_2 \ | 
|  | 6587 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6588 | 0 \ | 
|  | 6589 | -c "Read from server: 16384 bytes read" | 
|  | 6590 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6591 | # Tests for restartable ECC | 
|  | 6592 |  | 
|  | 6593 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6594 | run_test    "EC restart: TLS, default" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6595 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6596 | "$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] | 6597 | 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] | 6598 | debug_level=1" \ | 
|  | 6599 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6600 | -C "x509_verify_cert.*4b00" \ | 
|  | 6601 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6602 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6603 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6604 |  | 
|  | 6605 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6606 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6607 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6608 | "$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] | 6609 | 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] | 6610 | debug_level=1 ec_max_ops=0" \ | 
|  | 6611 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6612 | -C "x509_verify_cert.*4b00" \ | 
|  | 6613 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6614 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6615 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6616 |  | 
|  | 6617 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6618 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6619 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6620 | "$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] | 6621 | 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] | 6622 | debug_level=1 ec_max_ops=65535" \ | 
|  | 6623 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6624 | -C "x509_verify_cert.*4b00" \ | 
|  | 6625 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6626 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6627 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6628 |  | 
|  | 6629 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6630 | run_test    "EC restart: TLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6631 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6632 | "$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] | 6633 | 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] | 6634 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6635 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6636 | -c "x509_verify_cert.*4b00" \ | 
|  | 6637 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6638 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6639 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6640 |  | 
|  | 6641 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6642 | run_test    "EC restart: TLS, max_ops=1000, badsign" \ | 
|  | 6643 | "$P_SRV auth_mode=required \ | 
|  | 6644 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6645 | key_file=data_files/server5.key" \ | 
|  | 6646 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6647 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6648 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6649 | 1 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6650 | -c "x509_verify_cert.*4b00" \ | 
|  | 6651 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6652 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6653 | -C "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6654 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6655 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 6656 | -c "X509 - Certificate verification failed" | 
|  | 6657 |  | 
|  | 6658 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6659 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ | 
|  | 6660 | "$P_SRV auth_mode=required \ | 
|  | 6661 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6662 | key_file=data_files/server5.key" \ | 
|  | 6663 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6664 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6665 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 6666 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6667 | -c "x509_verify_cert.*4b00" \ | 
|  | 6668 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6669 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6670 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6671 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6672 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6673 | -C "X509 - Certificate verification failed" | 
|  | 6674 |  | 
|  | 6675 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6676 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ | 
|  | 6677 | "$P_SRV auth_mode=required \ | 
|  | 6678 | crt_file=data_files/server5-badsign.crt \ | 
|  | 6679 | key_file=data_files/server5.key" \ | 
|  | 6680 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6681 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 6682 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 6683 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6684 | -C "x509_verify_cert.*4b00" \ | 
|  | 6685 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6686 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6687 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6688 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 6689 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 6690 | -C "X509 - Certificate verification failed" | 
|  | 6691 |  | 
|  | 6692 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6693 | run_test    "EC restart: DTLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6694 | "$P_SRV auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6695 | "$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] | 6696 | 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] | 6697 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 6698 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6699 | -c "x509_verify_cert.*4b00" \ | 
|  | 6700 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6701 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6702 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6703 |  | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6704 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6705 | run_test    "EC restart: TLS, max_ops=1000 no client auth" \ | 
|  | 6706 | "$P_SRV" \ | 
|  | 6707 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 6708 | debug_level=1 ec_max_ops=1000" \ | 
|  | 6709 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6710 | -c "x509_verify_cert.*4b00" \ | 
|  | 6711 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 6712 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6713 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6714 |  | 
|  | 6715 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 6716 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ | 
|  | 6717 | "$P_SRV psk=abc123" \ | 
|  | 6718 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 6719 | psk=abc123 debug_level=1 ec_max_ops=1000" \ | 
|  | 6720 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6721 | -C "x509_verify_cert.*4b00" \ | 
|  | 6722 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 6723 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 6724 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6725 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6726 | # Tests of asynchronous private key support in SSL | 
|  | 6727 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6728 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6729 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 6730 | "$P_SRV \ | 
|  | 6731 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6732 | "$P_CLI" \ | 
|  | 6733 | 0 \ | 
|  | 6734 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6735 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6736 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6737 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6738 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 6739 | "$P_SRV \ | 
|  | 6740 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6741 | "$P_CLI" \ | 
|  | 6742 | 0 \ | 
|  | 6743 | -s "Async sign callback: using key slot " \ | 
|  | 6744 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6745 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6746 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6747 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6748 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 6749 | "$P_SRV \ | 
|  | 6750 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 6751 | "$P_CLI" \ | 
|  | 6752 | 0 \ | 
|  | 6753 | -s "Async sign callback: using key slot " \ | 
|  | 6754 | -U "Async sign callback: using key slot " \ | 
|  | 6755 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 6756 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6757 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6758 |  | 
| Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6759 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 | 
|  | 6760 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. | 
|  | 6761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6762 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 6763 | run_test    "SSL async private: sign, RSA, TLS 1.1" \ | 
|  | 6764 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ | 
|  | 6765 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6766 | "$P_CLI force_version=tls1_1" \ | 
|  | 6767 | 0 \ | 
|  | 6768 | -s "Async sign callback: using key slot " \ | 
|  | 6769 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 6770 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6771 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6772 | run_test    "SSL async private: sign, SNI" \ | 
|  | 6773 | "$P_SRV debug_level=3 \ | 
|  | 6774 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 6775 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 6776 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 6777 | "$P_CLI server_name=polarssl.example" \ | 
|  | 6778 | 0 \ | 
|  | 6779 | -s "Async sign callback: using key slot " \ | 
|  | 6780 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 6781 | -s "parse ServerName extension" \ | 
|  | 6782 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 6783 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 6784 |  | 
|  | 6785 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6786 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 6787 | "$P_SRV \ | 
|  | 6788 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6789 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6790 | 0 \ | 
|  | 6791 | -s "Async decrypt callback: using key slot " \ | 
|  | 6792 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6793 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6794 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6795 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 6796 | "$P_SRV \ | 
|  | 6797 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6798 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6799 | 0 \ | 
|  | 6800 | -s "Async decrypt callback: using key slot " \ | 
|  | 6801 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6802 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6803 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6804 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6805 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 6806 | "$P_SRV psk=abc123 \ | 
|  | 6807 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 6808 | "$P_CLI psk=abc123 \ | 
|  | 6809 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6810 | 0 \ | 
|  | 6811 | -s "Async decrypt callback: using key slot " \ | 
|  | 6812 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6813 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6815 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 6816 | "$P_SRV psk=abc123 \ | 
|  | 6817 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6818 | "$P_CLI psk=abc123 \ | 
|  | 6819 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 6820 | 0 \ | 
|  | 6821 | -s "Async decrypt callback: using key slot " \ | 
|  | 6822 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 6823 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 6824 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6825 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6826 | run_test    "SSL async private: sign callback not present" \ | 
|  | 6827 | "$P_SRV \ | 
|  | 6828 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6829 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 6830 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6831 | 0 \ | 
|  | 6832 | -S "Async sign callback" \ | 
|  | 6833 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6834 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 6835 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 6836 | -s "Successful connection" | 
|  | 6837 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6839 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 6840 | "$P_SRV debug_level=1 \ | 
|  | 6841 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 6842 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 6843 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6844 | 0 \ | 
|  | 6845 | -S "Async decrypt callback" \ | 
|  | 6846 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6847 | -s "got no RSA private key" \ | 
|  | 6848 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 6849 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6850 |  | 
|  | 6851 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6852 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6853 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6854 | "$P_SRV \ | 
|  | 6855 | async_operations=s async_private_delay1=1 \ | 
|  | 6856 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6857 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6858 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6859 | 0 \ | 
|  | 6860 | -s "Async sign callback: using key slot 0," \ | 
|  | 6861 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6862 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6863 |  | 
|  | 6864 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6865 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6866 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6867 | "$P_SRV \ | 
|  | 6868 | async_operations=s async_private_delay2=1 \ | 
|  | 6869 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6870 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6871 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6872 | 0 \ | 
|  | 6873 | -s "Async sign callback: using key slot 0," \ | 
|  | 6874 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6875 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6876 |  | 
|  | 6877 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6879 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6880 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6881 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6882 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6883 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6884 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6885 | 0 \ | 
|  | 6886 | -s "Async sign callback: using key slot 1," \ | 
|  | 6887 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6888 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6889 |  | 
|  | 6890 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6891 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6892 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6893 | "$P_SRV \ | 
|  | 6894 | async_operations=s async_private_delay1=1 \ | 
|  | 6895 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 6896 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6897 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 6898 | 0 \ | 
|  | 6899 | -s "Async sign callback: no key matches this certificate." | 
|  | 6900 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6901 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6902 | run_test    "SSL async private: sign, error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6903 | "$P_SRV \ | 
|  | 6904 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6905 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6906 | "$P_CLI" \ | 
|  | 6907 | 1 \ | 
|  | 6908 | -s "Async sign callback: injected error" \ | 
|  | 6909 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6910 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6911 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6912 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6913 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6914 | run_test    "SSL async private: sign, cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6915 | "$P_SRV \ | 
|  | 6916 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6917 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6918 | "$P_CLI" \ | 
|  | 6919 | 1 \ | 
|  | 6920 | -s "Async sign callback: using key slot " \ | 
|  | 6921 | -S "Async resume" \ | 
|  | 6922 | -s "Async cancel" | 
|  | 6923 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6925 | run_test    "SSL async private: sign, error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6926 | "$P_SRV \ | 
|  | 6927 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6928 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6929 | "$P_CLI" \ | 
|  | 6930 | 1 \ | 
|  | 6931 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6932 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6933 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6934 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6935 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6936 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6937 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 6938 | "$P_SRV \ | 
|  | 6939 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6940 | async_private_error=1" \ | 
|  | 6941 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6942 | 1 \ | 
|  | 6943 | -s "Async decrypt callback: injected error" \ | 
|  | 6944 | -S "Async resume" \ | 
|  | 6945 | -S "Async cancel" \ | 
|  | 6946 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6947 |  | 
|  | 6948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6949 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 6950 | "$P_SRV \ | 
|  | 6951 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6952 | async_private_error=2" \ | 
|  | 6953 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6954 | 1 \ | 
|  | 6955 | -s "Async decrypt callback: using key slot " \ | 
|  | 6956 | -S "Async resume" \ | 
|  | 6957 | -s "Async cancel" | 
|  | 6958 |  | 
|  | 6959 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 6960 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 6961 | "$P_SRV \ | 
|  | 6962 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6963 | async_private_error=3" \ | 
|  | 6964 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6965 | 1 \ | 
|  | 6966 | -s "Async decrypt callback: using key slot " \ | 
|  | 6967 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 6968 | -S "Async cancel" \ | 
|  | 6969 | -s "! mbedtls_ssl_handshake returned" | 
|  | 6970 |  | 
|  | 6971 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6972 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6973 | "$P_SRV \ | 
|  | 6974 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6975 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6976 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6977 | 0 \ | 
|  | 6978 | -s "Async cancel" \ | 
|  | 6979 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6980 | -s "Async resume" \ | 
|  | 6981 | -s "Successful connection" | 
|  | 6982 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6983 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6984 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6985 | "$P_SRV \ | 
|  | 6986 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 6987 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6988 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 6989 | 0 \ | 
|  | 6990 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 6991 | -s "Async resume" \ | 
|  | 6992 | -s "Successful connection" | 
|  | 6993 |  | 
|  | 6994 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6995 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6996 | 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] | 6997 | "$P_SRV \ | 
|  | 6998 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 6999 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7000 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7001 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7002 | [ \$? -eq 1 ] && | 
|  | 7003 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7004 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7005 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7006 | -S "Async resume" \ | 
|  | 7007 | -s "Async cancel" \ | 
|  | 7008 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7009 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7010 | -s "Successful connection" | 
|  | 7011 |  | 
|  | 7012 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7014 | 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] | 7015 | "$P_SRV \ | 
|  | 7016 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 7017 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7018 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7019 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7020 | [ \$? -eq 1 ] && | 
|  | 7021 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7022 | 0 \ | 
|  | 7023 | -s "Async resume" \ | 
|  | 7024 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7025 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7026 | -s "Successful connection" | 
|  | 7027 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7028 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7030 | run_test    "SSL async private: renegotiation: client-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7031 | "$P_SRV \ | 
|  | 7032 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7033 | exchanges=2 renegotiation=1" \ | 
|  | 7034 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7035 | 0 \ | 
|  | 7036 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7037 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7038 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7039 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7041 | run_test    "SSL async private: renegotiation: server-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7042 | "$P_SRV \ | 
|  | 7043 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7044 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7045 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 7046 | 0 \ | 
|  | 7047 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7048 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7049 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7052 | run_test    "SSL async private: renegotiation: client-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7053 | "$P_SRV \ | 
|  | 7054 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7055 | exchanges=2 renegotiation=1" \ | 
|  | 7056 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 7057 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7058 | 0 \ | 
|  | 7059 | -s "Async decrypt callback: using key slot " \ | 
|  | 7060 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7061 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7062 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7063 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7064 | run_test    "SSL async private: renegotiation: server-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7065 | "$P_SRV \ | 
|  | 7066 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7067 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7068 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 7069 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7070 | 0 \ | 
|  | 7071 | -s "Async decrypt callback: using key slot " \ | 
|  | 7072 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7073 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7074 | # Tests for ECC extensions (rfc 4492) | 
|  | 7075 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7076 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7077 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7078 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7079 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7080 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 7081 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7082 | "$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] | 7083 | 0 \ | 
|  | 7084 | -C "client hello, adding supported_elliptic_curves extension" \ | 
|  | 7085 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 7086 | -S "found supported elliptic curves extension" \ | 
|  | 7087 | -S "found supported point formats extension" | 
|  | 7088 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7089 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7090 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7091 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7092 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7093 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7094 | "$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] | 7095 | "$P_CLI debug_level=3" \ | 
|  | 7096 | 0 \ | 
|  | 7097 | -C "found supported_point_formats extension" \ | 
|  | 7098 | -S "server hello, supported_point_formats extension" | 
|  | 7099 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7100 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7101 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7102 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7103 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7104 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 7105 | "$P_SRV debug_level=3" \ | 
|  | 7106 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7107 | 0 \ | 
|  | 7108 | -c "client hello, adding supported_elliptic_curves extension" \ | 
|  | 7109 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 7110 | -s "found supported elliptic curves extension" \ | 
|  | 7111 | -s "found supported point formats extension" | 
|  | 7112 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7113 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7114 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7115 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7116 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7117 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 7118 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7119 | "$P_CLI debug_level=3" \ | 
|  | 7120 | 0 \ | 
|  | 7121 | -c "found supported_point_formats extension" \ | 
|  | 7122 | -s "server hello, supported_point_formats extension" | 
|  | 7123 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7124 | # Tests for DTLS HelloVerifyRequest | 
|  | 7125 |  | 
|  | 7126 | run_test    "DTLS cookie: enabled" \ | 
|  | 7127 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 7128 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7129 | 0 \ | 
|  | 7130 | -s "cookie verification failed" \ | 
|  | 7131 | -s "cookie verification passed" \ | 
|  | 7132 | -S "cookie verification skipped" \ | 
|  | 7133 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7134 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7135 | -S "SSL - The requested feature is not available" | 
|  | 7136 |  | 
|  | 7137 | run_test    "DTLS cookie: disabled" \ | 
|  | 7138 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 7139 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7140 | 0 \ | 
|  | 7141 | -S "cookie verification failed" \ | 
|  | 7142 | -S "cookie verification passed" \ | 
|  | 7143 | -s "cookie verification skipped" \ | 
|  | 7144 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7145 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7146 | -S "SSL - The requested feature is not available" | 
|  | 7147 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7148 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 7149 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 7150 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 7151 | 1 \ | 
|  | 7152 | -s "cookie verification failed" \ | 
|  | 7153 | -S "cookie verification passed" \ | 
|  | 7154 | -S "cookie verification skipped" \ | 
|  | 7155 | -C "received hello verify request" \ | 
|  | 7156 | -S "hello verification requested" \ | 
|  | 7157 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7158 |  | 
|  | 7159 | requires_ipv6 | 
|  | 7160 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 7161 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7162 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7163 | 0 \ | 
|  | 7164 | -s "cookie verification failed" \ | 
|  | 7165 | -s "cookie verification passed" \ | 
|  | 7166 | -S "cookie verification skipped" \ | 
|  | 7167 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7168 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7169 | -S "SSL - The requested feature is not available" | 
|  | 7170 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7171 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 7172 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 7173 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7174 | 0 \ | 
|  | 7175 | -s "cookie verification failed" \ | 
|  | 7176 | -s "cookie verification passed" \ | 
|  | 7177 | -S "cookie verification skipped" \ | 
|  | 7178 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7179 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7180 | -S "SSL - The requested feature is not available" | 
|  | 7181 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7182 | # Tests for client reconnecting from the same port with DTLS | 
|  | 7183 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7184 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7185 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7186 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 7187 | "$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] | 7188 | 0 \ | 
|  | 7189 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7190 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7191 | -S "Client initiated reconnection from same port" | 
|  | 7192 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7193 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7194 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7195 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 7196 | "$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] | 7197 | 0 \ | 
|  | 7198 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7199 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7200 | -s "Client initiated reconnection from same port" | 
|  | 7201 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7202 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 7203 | 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] | 7204 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 7205 | "$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] | 7206 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7207 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7208 | -s "Client initiated reconnection from same port" | 
|  | 7209 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7210 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 7211 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 7212 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 7213 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 7214 | 0 \ | 
|  | 7215 | -S "The operation timed out" \ | 
|  | 7216 | -s "Client initiated reconnection from same port" | 
|  | 7217 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7218 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 7219 | "$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] | 7220 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 7221 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7222 | -s "The operation timed out" \ | 
|  | 7223 | -S "Client initiated reconnection from same port" | 
|  | 7224 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7225 | # Tests for various cases of client authentication with DTLS | 
|  | 7226 | # (focused on handshake flows and message parsing) | 
|  | 7227 |  | 
|  | 7228 | run_test    "DTLS client auth: required" \ | 
|  | 7229 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 7230 | "$P_CLI dtls=1" \ | 
|  | 7231 | 0 \ | 
|  | 7232 | -s "Verifying peer X.509 certificate... ok" | 
|  | 7233 |  | 
|  | 7234 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 7235 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 7236 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 7237 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7238 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7239 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7240 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7241 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 7242 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 7243 | 0 \ | 
|  | 7244 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7245 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7246 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7247 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 7248 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 7249 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 7250 | 1 \ | 
|  | 7251 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 7252 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 7253 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7254 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 7255 |  | 
|  | 7256 | requires_gnutls | 
|  | 7257 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 7258 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 7259 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7260 | 0 \ | 
|  | 7261 | -C "found fragmented DTLS handshake message" \ | 
|  | 7262 | -C "error" | 
|  | 7263 |  | 
|  | 7264 | requires_gnutls | 
|  | 7265 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 7266 | "$G_SRV -u --mtu 512" \ | 
|  | 7267 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7268 | 0 \ | 
|  | 7269 | -c "found fragmented DTLS handshake message" \ | 
|  | 7270 | -C "error" | 
|  | 7271 |  | 
|  | 7272 | requires_gnutls | 
|  | 7273 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 7274 | "$G_SRV -u --mtu 128" \ | 
|  | 7275 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7276 | 0 \ | 
|  | 7277 | -c "found fragmented DTLS handshake message" \ | 
|  | 7278 | -C "error" | 
|  | 7279 |  | 
|  | 7280 | requires_gnutls | 
|  | 7281 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 7282 | "$G_SRV -u --mtu 128" \ | 
|  | 7283 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7284 | 0 \ | 
|  | 7285 | -c "found fragmented DTLS handshake message" \ | 
|  | 7286 | -C "error" | 
|  | 7287 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7288 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7290 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 7291 | "$G_SRV -u --mtu 256" \ | 
|  | 7292 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7293 | 0 \ | 
|  | 7294 | -c "found fragmented DTLS handshake message" \ | 
|  | 7295 | -c "client hello, adding renegotiation extension" \ | 
|  | 7296 | -c "found renegotiation extension" \ | 
|  | 7297 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7298 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7299 | -C "error" \ | 
|  | 7300 | -s "Extra-header:" | 
|  | 7301 |  | 
|  | 7302 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7304 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 7305 | "$G_SRV -u --mtu 256" \ | 
|  | 7306 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7307 | 0 \ | 
|  | 7308 | -c "found fragmented DTLS handshake message" \ | 
|  | 7309 | -c "client hello, adding renegotiation extension" \ | 
|  | 7310 | -c "found renegotiation extension" \ | 
|  | 7311 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7312 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7313 | -C "error" \ | 
|  | 7314 | -s "Extra-header:" | 
|  | 7315 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7316 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 7317 | "$O_SRV -dtls1 -mtu 2048" \ | 
|  | 7318 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7319 | 0 \ | 
|  | 7320 | -C "found fragmented DTLS handshake message" \ | 
|  | 7321 | -C "error" | 
|  | 7322 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7323 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 7324 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7325 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7326 | 0 \ | 
|  | 7327 | -c "found fragmented DTLS handshake message" \ | 
|  | 7328 | -C "error" | 
|  | 7329 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7330 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7331 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 7332 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7333 | 0 \ | 
|  | 7334 | -c "found fragmented DTLS handshake message" \ | 
|  | 7335 | -C "error" | 
|  | 7336 |  | 
|  | 7337 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 7338 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 7339 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7340 | 0 \ | 
|  | 7341 | -c "found fragmented DTLS handshake message" \ | 
|  | 7342 | -C "error" | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7343 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7344 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 7345 | # | 
|  | 7346 | # Use client auth when we need the client to send large messages, | 
|  | 7347 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 7348 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 7349 | # Sizes reached (UDP payload): | 
|  | 7350 | # - 2037B for server certificate | 
|  | 7351 | # - 1542B for client certificate | 
|  | 7352 | # - 1013B for newsessionticket | 
|  | 7353 | # - all others below 512B | 
|  | 7354 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 7355 |  | 
|  | 7356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7357 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7358 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7359 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7360 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 7361 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7362 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7363 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7364 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7365 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7366 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7367 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7368 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7369 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7370 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7371 | 0 \ | 
|  | 7372 | -S "found fragmented DTLS handshake message" \ | 
|  | 7373 | -C "found fragmented DTLS handshake message" \ | 
|  | 7374 | -C "error" | 
|  | 7375 |  | 
|  | 7376 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7377 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7378 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7379 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7380 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7381 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7382 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7383 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7384 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7385 | max_frag_len=1024" \ | 
|  | 7386 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7387 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7388 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7389 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7390 | max_frag_len=2048" \ | 
|  | 7391 | 0 \ | 
|  | 7392 | -S "found fragmented DTLS handshake message" \ | 
|  | 7393 | -c "found fragmented DTLS handshake message" \ | 
|  | 7394 | -C "error" | 
|  | 7395 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7396 | # With the MFL extension, the server has no way of forcing | 
|  | 7397 | # the client to not exceed a certain MTU; hence, the following | 
|  | 7398 | # test can't be replicated with an MTU proxy such as the one | 
|  | 7399 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7400 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7401 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7402 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7403 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7404 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7405 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7406 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7407 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7408 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7409 | max_frag_len=512" \ | 
|  | 7410 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7411 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7412 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7413 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7414 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7415 | 0 \ | 
|  | 7416 | -S "found fragmented DTLS handshake message" \ | 
|  | 7417 | -c "found fragmented DTLS handshake message" \ | 
|  | 7418 | -C "error" | 
|  | 7419 |  | 
|  | 7420 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7421 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7422 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7424 | 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] | 7425 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7426 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7427 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7428 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7429 | max_frag_len=2048" \ | 
|  | 7430 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7431 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7432 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7433 | hs_timeout=2500-60000 \ | 
|  | 7434 | max_frag_len=1024" \ | 
|  | 7435 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7436 | -S "found fragmented DTLS handshake message" \ | 
|  | 7437 | -c "found fragmented DTLS handshake message" \ | 
|  | 7438 | -C "error" | 
|  | 7439 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7440 | # While not required by the standard defining the MFL extension | 
|  | 7441 | # (according to which it only applies to records, not to datagrams), | 
|  | 7442 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7443 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7444 | # to the peer. | 
|  | 7445 | # The next test checks that no datagrams significantly larger than the | 
|  | 7446 | # negotiated MFL are sent. | 
|  | 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7448 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7449 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7451 | 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] | 7452 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7453 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7454 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7455 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7456 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7457 | max_frag_len=2048" \ | 
|  | 7458 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7459 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7460 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7461 | hs_timeout=2500-60000 \ | 
|  | 7462 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7463 | 0 \ | 
|  | 7464 | -S "found fragmented DTLS handshake message" \ | 
|  | 7465 | -c "found fragmented DTLS handshake message" \ | 
|  | 7466 | -C "error" | 
|  | 7467 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7469 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7470 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7471 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7472 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7473 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7474 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7475 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7476 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7477 | max_frag_len=2048" \ | 
|  | 7478 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7479 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7480 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7481 | hs_timeout=2500-60000 \ | 
|  | 7482 | max_frag_len=1024" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7483 | 0 \ | 
|  | 7484 | -s "found fragmented DTLS handshake message" \ | 
|  | 7485 | -c "found fragmented DTLS handshake message" \ | 
|  | 7486 | -C "error" | 
|  | 7487 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7488 | # While not required by the standard defining the MFL extension | 
|  | 7489 | # (according to which it only applies to records, not to datagrams), | 
|  | 7490 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7491 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7492 | # to the peer. | 
|  | 7493 | # The next test checks that no datagrams significantly larger than the | 
|  | 7494 | # negotiated MFL are sent. | 
|  | 7495 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7496 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7497 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7498 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7499 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
| Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7500 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [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 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7505 | max_frag_len=2048" \ | 
|  | 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 \ | 
|  | 7510 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7511 | 0 \ | 
|  | 7512 | -s "found fragmented DTLS handshake message" \ | 
|  | 7513 | -c "found fragmented DTLS handshake message" \ | 
|  | 7514 | -C "error" | 
|  | 7515 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7517 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7518 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7519 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 7520 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7521 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7522 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7523 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7524 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7525 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7526 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7527 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7528 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7529 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7530 | 0 \ | 
|  | 7531 | -S "found fragmented DTLS handshake message" \ | 
|  | 7532 | -C "found fragmented DTLS handshake message" \ | 
|  | 7533 | -C "error" | 
|  | 7534 |  | 
|  | 7535 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7536 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7537 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7538 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 7539 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7540 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7541 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7542 | hs_timeout=3500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7543 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7544 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7545 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7546 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7547 | hs_timeout=3500-60000 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7548 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7549 | 0 \ | 
|  | 7550 | -s "found fragmented DTLS handshake message" \ | 
|  | 7551 | -C "found fragmented DTLS handshake message" \ | 
|  | 7552 | -C "error" | 
|  | 7553 |  | 
|  | 7554 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7555 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7556 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7557 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 7558 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7559 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7560 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7561 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7562 | mtu=512" \ | 
|  | 7563 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7564 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7565 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7566 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7567 | mtu=2048" \ | 
|  | 7568 | 0 \ | 
|  | 7569 | -S "found fragmented DTLS handshake message" \ | 
|  | 7570 | -c "found fragmented DTLS handshake message" \ | 
|  | 7571 | -C "error" | 
|  | 7572 |  | 
|  | 7573 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7574 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7575 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7576 | run_test    "DTLS fragmenting: both (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7577 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7578 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7579 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7580 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7581 | hs_timeout=2500-60000 \ | 
| Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7582 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7583 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7584 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7585 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7586 | hs_timeout=2500-60000 \ | 
|  | 7587 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7588 | 0 \ | 
|  | 7589 | -s "found fragmented DTLS handshake message" \ | 
|  | 7590 | -c "found fragmented DTLS handshake message" \ | 
|  | 7591 | -C "error" | 
|  | 7592 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7593 | # 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] | 7594 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7595 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7596 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7597 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7598 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7599 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7600 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 7601 | run_test    "DTLS fragmenting: both (MTU=512)" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7602 | -p "$P_PXY mtu=512" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7603 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7604 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7605 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7606 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7607 | mtu=512" \ | 
|  | 7608 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7609 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7610 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7611 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7612 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7613 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7614 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7615 | -s "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7616 | -c "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7617 | -C "error" | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7618 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7619 | # Test for automatic MTU reduction on repeated resend. | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7620 | # 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] | 7621 | # The ratio of max/min timeout should ideally equal 4 to accept two | 
|  | 7622 | # retransmissions, but in some cases (like both the server and client using | 
|  | 7623 | # fragmentation and auto-reduction) an extra retransmission might occur, | 
|  | 7624 | # hence the ratio of 8. | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7625 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7627 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7628 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7629 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7630 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7631 | requires_config_enabled MBEDTLS_GCM_C | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7632 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7633 | -p "$P_PXY mtu=508" \ | 
|  | 7634 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7635 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7636 | key_file=data_files/server7.key \ | 
|  | 7637 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7638 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7639 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7640 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7641 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7642 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7643 | 0 \ | 
|  | 7644 | -s "found fragmented DTLS handshake message" \ | 
|  | 7645 | -c "found fragmented DTLS handshake message" \ | 
|  | 7646 | -C "error" | 
|  | 7647 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7648 | # 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] | 7649 | only_with_valgrind | 
|  | 7650 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7651 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7652 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7653 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7654 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7655 | requires_config_enabled MBEDTLS_GCM_C | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7656 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7657 | -p "$P_PXY mtu=508" \ | 
|  | 7658 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7659 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7660 | key_file=data_files/server7.key \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7661 | hs_timeout=250-10000" \ | 
|  | 7662 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7663 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7664 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7665 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7666 | hs_timeout=250-10000" \ | 
|  | 7667 | 0 \ | 
|  | 7668 | -s "found fragmented DTLS handshake message" \ | 
|  | 7669 | -c "found fragmented DTLS handshake message" \ | 
|  | 7670 | -C "error" | 
|  | 7671 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7672 | # 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] | 7673 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7674 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7675 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7677 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7678 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7679 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7680 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7681 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7682 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7683 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7684 | hs_timeout=10000-60000 \ | 
|  | 7685 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7686 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7687 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7688 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7689 | hs_timeout=10000-60000 \ | 
|  | 7690 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7691 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7692 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7693 | -s "found fragmented DTLS handshake message" \ | 
|  | 7694 | -c "found fragmented DTLS handshake message" \ | 
|  | 7695 | -C "error" | 
|  | 7696 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7697 | # 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] | 7698 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend | 
|  | 7699 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 7700 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7701 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7702 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7703 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7704 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7705 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7706 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7707 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 7708 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7709 | -p "$P_PXY mtu=512" \ | 
|  | 7710 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7711 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7712 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7713 | hs_timeout=10000-60000 \ | 
|  | 7714 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7715 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7716 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7717 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7718 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7719 | hs_timeout=10000-60000 \ | 
|  | 7720 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7721 | 0 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7722 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7723 | -s "found fragmented DTLS handshake message" \ | 
|  | 7724 | -c "found fragmented DTLS handshake message" \ | 
|  | 7725 | -C "error" | 
|  | 7726 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7727 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 7728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7729 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7730 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7731 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7732 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7733 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7734 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7735 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7736 | hs_timeout=10000-60000 \ | 
|  | 7737 | mtu=1024 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7738 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7739 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7740 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7741 | hs_timeout=10000-60000 \ | 
|  | 7742 | mtu=1024 nbio=2" \ | 
|  | 7743 | 0 \ | 
|  | 7744 | -S "autoreduction" \ | 
|  | 7745 | -s "found fragmented DTLS handshake message" \ | 
|  | 7746 | -c "found fragmented DTLS handshake message" \ | 
|  | 7747 | -C "error" | 
|  | 7748 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7749 | # 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] | 7750 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 7751 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7752 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7753 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7754 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7755 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7756 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 7757 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ | 
|  | 7758 | -p "$P_PXY mtu=512" \ | 
|  | 7759 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7760 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7761 | key_file=data_files/server7.key \ | 
|  | 7762 | hs_timeout=10000-60000 \ | 
|  | 7763 | mtu=512 nbio=2" \ | 
|  | 7764 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7765 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7766 | key_file=data_files/server8.key \ | 
|  | 7767 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7768 | hs_timeout=10000-60000 \ | 
|  | 7769 | mtu=512 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7770 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7771 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7772 | -s "found fragmented DTLS handshake message" \ | 
|  | 7773 | -c "found fragmented DTLS handshake message" \ | 
|  | 7774 | -C "error" | 
|  | 7775 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7776 | # 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] | 7777 | # This ensures things still work after session_reset(). | 
|  | 7778 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7779 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 7780 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 7781 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7782 | # An autoreduction on the client-side might happen if the server is | 
|  | 7783 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7784 | # reco_delay avoids races where the client reconnects before the server has | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7785 | # resumed listening, which would result in a spurious autoreduction. | 
|  | 7786 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7787 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7788 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7789 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7790 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7791 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7792 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7793 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 7794 | -p "$P_PXY mtu=1450" \ | 
|  | 7795 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7796 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7797 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7798 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7799 | mtu=1450" \ | 
|  | 7800 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7801 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7802 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7803 | hs_timeout=10000-60000 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7804 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7805 | mtu=1450 reconnect=1 reco_delay=1" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7806 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7807 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7808 | -s "found fragmented DTLS handshake message" \ | 
|  | 7809 | -c "found fragmented DTLS handshake message" \ | 
|  | 7810 | -C "error" | 
|  | 7811 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7812 | # An autoreduction on the client-side might happen if the server is | 
|  | 7813 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7814 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7815 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7816 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7817 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7818 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7819 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7820 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7821 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
|  | 7822 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 7823 | -p "$P_PXY mtu=512" \ | 
|  | 7824 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7825 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7826 | key_file=data_files/server7.key \ | 
|  | 7827 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7828 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7829 | mtu=512" \ | 
|  | 7830 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7831 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7832 | key_file=data_files/server8.key \ | 
|  | 7833 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7834 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7835 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7836 | mtu=512" \ | 
|  | 7837 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7838 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7839 | -s "found fragmented DTLS handshake message" \ | 
|  | 7840 | -c "found fragmented DTLS handshake message" \ | 
|  | 7841 | -C "error" | 
|  | 7842 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7843 | # An autoreduction on the client-side might happen if the server is | 
|  | 7844 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7845 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7846 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7847 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7848 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7849 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7851 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7852 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7853 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 7854 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 7855 | -p "$P_PXY mtu=512" \ | 
|  | 7856 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7857 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7858 | key_file=data_files/server7.key \ | 
|  | 7859 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7860 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7861 | mtu=512" \ | 
|  | 7862 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7863 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7864 | key_file=data_files/server8.key \ | 
|  | 7865 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7866 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7867 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7868 | mtu=512" \ | 
|  | 7869 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7870 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7871 | -s "found fragmented DTLS handshake message" \ | 
|  | 7872 | -c "found fragmented DTLS handshake message" \ | 
|  | 7873 | -C "error" | 
|  | 7874 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7875 | # An autoreduction on the client-side might happen if the server is | 
|  | 7876 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7877 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7879 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7880 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7881 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7882 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7883 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7884 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7885 | requires_config_enabled MBEDTLS_CCM_C | 
|  | 7886 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7887 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7888 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7889 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7890 | key_file=data_files/server7.key \ | 
|  | 7891 | exchanges=2 renegotiation=1 \ | 
|  | 7892 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7893 | hs_timeout=10000-60000 \ | 
|  | 7894 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7895 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7896 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7897 | key_file=data_files/server8.key \ | 
|  | 7898 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7899 | hs_timeout=10000-60000 \ | 
|  | 7900 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7901 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7902 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7903 | -s "found fragmented DTLS handshake message" \ | 
|  | 7904 | -c "found fragmented DTLS handshake message" \ | 
|  | 7905 | -C "error" | 
|  | 7906 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7907 | # An autoreduction on the client-side might happen if the server is | 
|  | 7908 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7909 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7910 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7911 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7912 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7913 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7914 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7915 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7916 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7917 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7918 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
|  | 7919 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7920 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7921 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7922 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7923 | key_file=data_files/server7.key \ | 
|  | 7924 | exchanges=2 renegotiation=1 \ | 
|  | 7925 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7926 | hs_timeout=10000-60000 \ | 
|  | 7927 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7928 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7929 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7930 | key_file=data_files/server8.key \ | 
|  | 7931 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7932 | hs_timeout=10000-60000 \ | 
|  | 7933 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7934 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7935 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7936 | -s "found fragmented DTLS handshake message" \ | 
|  | 7937 | -c "found fragmented DTLS handshake message" \ | 
|  | 7938 | -C "error" | 
|  | 7939 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7940 | # An autoreduction on the client-side might happen if the server is | 
|  | 7941 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 7942 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7943 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7944 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7945 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7946 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7947 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7948 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 7949 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7950 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7951 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7952 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7953 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7954 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7955 | key_file=data_files/server7.key \ | 
|  | 7956 | exchanges=2 renegotiation=1 \ | 
|  | 7957 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7958 | hs_timeout=10000-60000 \ | 
|  | 7959 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7960 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7961 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7962 | key_file=data_files/server8.key \ | 
|  | 7963 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7964 | hs_timeout=10000-60000 \ | 
|  | 7965 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7966 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7967 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7968 | -s "found fragmented DTLS handshake message" \ | 
|  | 7969 | -c "found fragmented DTLS handshake message" \ | 
|  | 7970 | -C "error" | 
|  | 7971 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7972 | # 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] | 7973 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7974 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7975 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7976 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 7977 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7978 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7979 | client_needs_more_time 2 | 
|  | 7980 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 7981 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7982 | "$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] | 7983 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7984 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7985 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7986 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7987 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7988 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7989 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7990 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7991 | 0 \ | 
|  | 7992 | -s "found fragmented DTLS handshake message" \ | 
|  | 7993 | -c "found fragmented DTLS handshake message" \ | 
|  | 7994 | -C "error" | 
|  | 7995 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7996 | # 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] | 7997 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7998 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7999 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8000 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8001 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8002 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8003 | client_needs_more_time 2 | 
|  | 8004 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 8005 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 8006 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8007 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8008 | key_file=data_files/server7.key \ | 
|  | 8009 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8010 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8011 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8012 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8013 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8014 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8015 | 0 \ | 
|  | 8016 | -s "found fragmented DTLS handshake message" \ | 
|  | 8017 | -c "found fragmented DTLS handshake message" \ | 
|  | 8018 | -C "error" | 
|  | 8019 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8020 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 8021 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8022 | # here and below we just want to test that the we fragment in a way that | 
|  | 8023 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8025 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8026 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8028 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8029 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 8030 | "$G_SRV -u" \ | 
|  | 8031 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8032 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8033 | key_file=data_files/server8.key \ | 
|  | 8034 | mtu=512 force_version=dtls1_2" \ | 
|  | 8035 | 0 \ | 
|  | 8036 | -c "fragmenting handshake message" \ | 
|  | 8037 | -C "error" | 
|  | 8038 |  | 
|  | 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_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8043 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8044 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.0" \ | 
|  | 8045 | "$G_SRV -u" \ | 
|  | 8046 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8047 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8048 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8049 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8050 | 0 \ | 
|  | 8051 | -c "fragmenting handshake message" \ | 
|  | 8052 | -C "error" | 
|  | 8053 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8054 | # We use --insecure for the GnuTLS client because it expects | 
|  | 8055 | # the hostname / IP it connects to to be the name used in the | 
|  | 8056 | # certificate obtained from the server. Here, however, it | 
|  | 8057 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 8058 | # as the server name in the certificate. This will make the | 
|  | 8059 | # certifiate validation fail, but passing --insecure makes | 
|  | 8060 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8061 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8062 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8063 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8064 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8065 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8066 | requires_not_i686 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8067 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8068 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8069 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8070 | key_file=data_files/server7.key \ | 
|  | 8071 | mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8072 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8073 | 0 \ | 
|  | 8074 | -s "fragmenting handshake message" | 
|  | 8075 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8076 | # See previous test for the reason to use --insecure | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8077 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8078 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8079 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8080 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8081 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8082 | requires_not_i686 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8083 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.0" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8084 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8085 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8086 | key_file=data_files/server7.key \ | 
|  | 8087 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8088 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8089 | 0 \ | 
|  | 8090 | -s "fragmenting handshake message" | 
|  | 8091 |  | 
|  | 8092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8093 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8094 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8095 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8096 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 8097 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8098 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8099 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8100 | key_file=data_files/server8.key \ | 
|  | 8101 | mtu=512 force_version=dtls1_2" \ | 
|  | 8102 | 0 \ | 
|  | 8103 | -c "fragmenting handshake message" \ | 
|  | 8104 | -C "error" | 
|  | 8105 |  | 
|  | 8106 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8107 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8108 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8110 | run_test    "DTLS fragmenting: openssl server, DTLS 1.0" \ | 
|  | 8111 | "$O_SRV -dtls1 -verify 10" \ | 
|  | 8112 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8113 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8114 | key_file=data_files/server8.key \ | 
|  | 8115 | mtu=512 force_version=dtls1" \ | 
|  | 8116 | 0 \ | 
|  | 8117 | -c "fragmenting handshake message" \ | 
|  | 8118 | -C "error" | 
|  | 8119 |  | 
|  | 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 | 
|  | 8124 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 8125 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8126 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8127 | key_file=data_files/server7.key \ | 
|  | 8128 | mtu=512 force_version=dtls1_2" \ | 
|  | 8129 | "$O_CLI -dtls1_2" \ | 
|  | 8130 | 0 \ | 
|  | 8131 | -s "fragmenting handshake message" | 
|  | 8132 |  | 
|  | 8133 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8134 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8135 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8137 | run_test    "DTLS fragmenting: openssl client, DTLS 1.0" \ | 
|  | 8138 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8139 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8140 | key_file=data_files/server7.key \ | 
|  | 8141 | mtu=512 force_version=dtls1" \ | 
|  | 8142 | "$O_CLI -dtls1" \ | 
|  | 8143 | 0 \ | 
|  | 8144 | -s "fragmenting handshake message" | 
|  | 8145 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8146 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 8147 | # | 
|  | 8148 | # again we just want to test that the we fragment in a way that | 
|  | 8149 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8150 | requires_gnutls_next | 
|  | 8151 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8152 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8153 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8154 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8155 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8156 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 8157 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8158 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8159 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8160 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8161 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8162 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8163 | 0 \ | 
|  | 8164 | -c "fragmenting handshake message" \ | 
|  | 8165 | -C "error" | 
|  | 8166 |  | 
|  | 8167 | requires_gnutls_next | 
|  | 8168 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8169 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8170 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8172 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8173 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ | 
|  | 8174 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8175 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8176 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8177 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8178 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8179 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8180 | 0 \ | 
|  | 8181 | -c "fragmenting handshake message" \ | 
|  | 8182 | -C "error" | 
|  | 8183 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8184 | requires_gnutls_next | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8185 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8186 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8187 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8189 | client_needs_more_time 4 | 
|  | 8190 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 8191 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8192 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8193 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8194 | key_file=data_files/server7.key \ | 
|  | 8195 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8196 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8197 | 0 \ | 
|  | 8198 | -s "fragmenting handshake message" | 
|  | 8199 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8200 | requires_gnutls_next | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8201 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8202 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8203 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8204 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8205 | client_needs_more_time 4 | 
|  | 8206 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ | 
|  | 8207 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8208 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8209 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8210 | key_file=data_files/server7.key \ | 
|  | 8211 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8212 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8213 | 0 \ | 
|  | 8214 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8215 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8216 | ## Interop test with OpenSSL might trigger a bug in recent versions (including | 
|  | 8217 | ## all versions installed on the CI machines), reported here: | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8218 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8219 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 8220 | ## (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] | 8221 | skip_next_test | 
|  | 8222 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8223 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8224 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8225 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8226 | client_needs_more_time 4 | 
|  | 8227 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 8228 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8229 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8230 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8231 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8232 | key_file=data_files/server8.key \ | 
|  | 8233 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 8234 | 0 \ | 
|  | 8235 | -c "fragmenting handshake message" \ | 
|  | 8236 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8237 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8238 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8239 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8240 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8241 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8243 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8244 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ | 
|  | 8245 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8246 | "$O_SRV -dtls1 -verify 10" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8247 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8248 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8249 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8250 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8251 | 0 \ | 
|  | 8252 | -c "fragmenting handshake message" \ | 
|  | 8253 | -C "error" | 
|  | 8254 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8255 | skip_next_test | 
|  | 8256 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8257 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8258 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8260 | client_needs_more_time 4 | 
|  | 8261 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 8262 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8263 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8264 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8265 | key_file=data_files/server7.key \ | 
|  | 8266 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 8267 | "$O_CLI -dtls1_2" \ | 
|  | 8268 | 0 \ | 
|  | 8269 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8270 |  | 
|  | 8271 | # -nbio is added to prevent s_client from blocking in case of duplicated | 
|  | 8272 | # messages at the end of the handshake | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8273 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8275 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8276 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8278 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8279 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ | 
|  | 8280 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8281 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8282 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8283 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8284 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8285 | "$O_CLI -nbio -dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8286 | 0 \ | 
|  | 8287 | -s "fragmenting handshake message" | 
|  | 8288 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8289 | # Tests for specific things with "unreliable" UDP connection | 
|  | 8290 |  | 
|  | 8291 | not_with_valgrind # spurious resend due to timeout | 
|  | 8292 | run_test    "DTLS proxy: reference" \ | 
|  | 8293 | -p "$P_PXY" \ | 
|  | 8294 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 8295 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 8296 | 0 \ | 
|  | 8297 | -C "replayed record" \ | 
|  | 8298 | -S "replayed record" \ | 
| Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8299 | -C "Buffer record from epoch" \ | 
|  | 8300 | -S "Buffer record from epoch" \ | 
|  | 8301 | -C "ssl_buffer_message" \ | 
|  | 8302 | -S "ssl_buffer_message" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8303 | -C "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8304 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8305 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8306 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8307 | -c "HTTP/1.0 200 OK" | 
|  | 8308 |  | 
|  | 8309 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8310 | run_test    "DTLS proxy: duplicate every packet" \ | 
|  | 8311 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8312 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 8313 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8314 | 0 \ | 
|  | 8315 | -c "replayed record" \ | 
|  | 8316 | -s "replayed record" \ | 
|  | 8317 | -c "record from another epoch" \ | 
|  | 8318 | -s "record from another epoch" \ | 
|  | 8319 | -S "resend" \ | 
|  | 8320 | -s "Extra-header:" \ | 
|  | 8321 | -c "HTTP/1.0 200 OK" | 
|  | 8322 |  | 
|  | 8323 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 8324 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8325 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 8326 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8327 | 0 \ | 
|  | 8328 | -c "replayed record" \ | 
|  | 8329 | -S "replayed record" \ | 
|  | 8330 | -c "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8331 | -s "record from another epoch" \ | 
|  | 8332 | -c "resend" \ | 
|  | 8333 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8334 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8335 | -c "HTTP/1.0 200 OK" | 
|  | 8336 |  | 
|  | 8337 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
|  | 8338 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8339 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 8340 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8341 | 0 \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8342 | -c "next record in same datagram" \ | 
|  | 8343 | -s "next record in same datagram" | 
|  | 8344 |  | 
|  | 8345 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
|  | 8346 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8347 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 8348 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8349 | 0 \ | 
|  | 8350 | -c "next record in same datagram" \ | 
|  | 8351 | -s "next record in same datagram" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8352 |  | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8353 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
|  | 8354 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8355 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 8356 | "$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] | 8357 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8358 | -c "discarding invalid record (mac)" \ | 
|  | 8359 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8360 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8361 | -c "HTTP/1.0 200 OK" \ | 
|  | 8362 | -S "too many records with bad MAC" \ | 
|  | 8363 | -S "Verification of the message MAC failed" | 
|  | 8364 |  | 
|  | 8365 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 8366 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8367 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 8368 | "$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] | 8369 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8370 | -C "discarding invalid record (mac)" \ | 
|  | 8371 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8372 | -S "Extra-header:" \ | 
|  | 8373 | -C "HTTP/1.0 200 OK" \ | 
|  | 8374 | -s "too many records with bad MAC" \ | 
|  | 8375 | -s "Verification of the message MAC failed" | 
|  | 8376 |  | 
|  | 8377 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 8378 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8379 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 8380 | "$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] | 8381 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8382 | -c "discarding invalid record (mac)" \ | 
|  | 8383 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8384 | -s "Extra-header:" \ | 
|  | 8385 | -c "HTTP/1.0 200 OK" \ | 
|  | 8386 | -S "too many records with bad MAC" \ | 
|  | 8387 | -S "Verification of the message MAC failed" | 
|  | 8388 |  | 
|  | 8389 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 8390 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8391 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 8392 | "$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] | 8393 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8394 | -c "discarding invalid record (mac)" \ | 
|  | 8395 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8396 | -s "Extra-header:" \ | 
|  | 8397 | -c "HTTP/1.0 200 OK" \ | 
|  | 8398 | -s "too many records with bad MAC" \ | 
|  | 8399 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8400 |  | 
|  | 8401 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
|  | 8402 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8403 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 8404 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8405 | 0 \ | 
|  | 8406 | -c "record from another epoch" \ | 
|  | 8407 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8408 | -s "Extra-header:" \ | 
|  | 8409 | -c "HTTP/1.0 200 OK" | 
|  | 8410 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8411 | # Tests for reordering support with DTLS | 
|  | 8412 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8413 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 8414 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8415 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8416 | hs_timeout=2500-60000" \ | 
|  | 8417 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8418 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8419 | 0 \ | 
|  | 8420 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8421 | -c "Next handshake message has been buffered - load"\ | 
|  | 8422 | -S "Buffering HS message" \ | 
|  | 8423 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8424 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8425 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8426 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8427 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8428 |  | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8429 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 8430 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8431 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8432 | hs_timeout=2500-60000" \ | 
|  | 8433 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8434 | hs_timeout=2500-60000" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8435 | 0 \ | 
|  | 8436 | -c "Buffering HS message" \ | 
|  | 8437 | -c "found fragmented DTLS handshake message"\ | 
|  | 8438 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 8439 | -c "Next handshake message has been buffered - load"\ | 
|  | 8440 | -S "Buffering HS message" \ | 
|  | 8441 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8442 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8443 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8444 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8445 | -S "Remember CCS message" | 
|  | 8446 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8447 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 8448 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 8449 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 8450 | # while keeping the ServerKeyExchange. | 
|  | 8451 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
|  | 8452 | 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] | 8453 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8454 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8455 | hs_timeout=2500-60000" \ | 
|  | 8456 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8457 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8458 | 0 \ | 
|  | 8459 | -c "Buffering HS message" \ | 
|  | 8460 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8461 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 8462 | -S "Buffering HS message" \ | 
|  | 8463 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8464 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8465 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8466 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8467 | -S "Remember CCS message" | 
|  | 8468 |  | 
|  | 8469 | # The size constraints ensure that the delayed certificate message can't | 
|  | 8470 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 8471 | # when dropping it first. | 
|  | 8472 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 8473 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
|  | 8474 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 8475 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8476 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8477 | hs_timeout=2500-60000" \ | 
|  | 8478 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8479 | hs_timeout=2500-60000" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8480 | 0 \ | 
|  | 8481 | -c "Buffering HS message" \ | 
|  | 8482 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 8483 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8484 | -S "Buffering HS message" \ | 
|  | 8485 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8486 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8487 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8488 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8489 | -S "Remember CCS message" | 
|  | 8490 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8491 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 8492 | -p "$P_PXY delay_cli=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8493 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ | 
|  | 8494 | hs_timeout=2500-60000" \ | 
|  | 8495 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8496 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8497 | 0 \ | 
|  | 8498 | -C "Buffering HS message" \ | 
|  | 8499 | -C "Next handshake message has been buffered - load"\ | 
|  | 8500 | -s "Buffering HS message" \ | 
|  | 8501 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8502 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8503 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8504 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8505 | -S "Remember CCS message" | 
|  | 8506 |  | 
|  | 8507 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 8508 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8509 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8510 | hs_timeout=2500-60000" \ | 
|  | 8511 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8512 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8513 | 0 \ | 
|  | 8514 | -C "Buffering HS message" \ | 
|  | 8515 | -C "Next handshake message has been buffered - load"\ | 
|  | 8516 | -S "Buffering HS message" \ | 
|  | 8517 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8518 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8519 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8520 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8521 | -S "Remember CCS message" | 
|  | 8522 |  | 
|  | 8523 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 8524 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8525 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8526 | hs_timeout=2500-60000" \ | 
|  | 8527 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8528 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8529 | 0 \ | 
|  | 8530 | -C "Buffering HS message" \ | 
|  | 8531 | -C "Next handshake message has been buffered - load"\ | 
|  | 8532 | -S "Buffering HS message" \ | 
|  | 8533 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8534 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8535 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8536 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8537 | -s "Remember CCS message" | 
|  | 8538 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8539 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8540 | -p "$P_PXY delay_ccs=1" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8541 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 8542 | hs_timeout=2500-60000" \ | 
|  | 8543 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 8544 | hs_timeout=2500-60000" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8545 | 0 \ | 
|  | 8546 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8547 | -s "Found buffered record from current epoch - load" \ | 
|  | 8548 | -c "Buffer record from epoch 1" \ | 
|  | 8549 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8550 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8551 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 8552 | # from the server are delayed, so that the encrypted Finished message | 
|  | 8553 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 8554 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 8555 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 8556 | # This works only in very particular circumstances: | 
|  | 8557 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 8558 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 8559 | #   the encrypted Finished message. | 
|  | 8560 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 8561 | #   needs to be fragmented. | 
|  | 8562 | # - All messages sent by the server must be small enough to be either sent | 
|  | 8563 | #   without fragmentation or be reassembled within the bounds of | 
|  | 8564 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 8565 | #   handshake, omitting CRTs. | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8566 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 | 
|  | 8567 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8568 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 8569 | -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] | 8570 | "$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] | 8571 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 8572 | 0 \ | 
|  | 8573 | -s "Buffer record from epoch 1" \ | 
|  | 8574 | -s "Found buffered record from current epoch - load" \ | 
|  | 8575 | -c "Buffer record from epoch 1" \ | 
|  | 8576 | -C "Found buffered record from current epoch - load" \ | 
|  | 8577 | -c "Enough space available after freeing future epoch record" | 
|  | 8578 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8579 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 8580 |  | 
|  | 8581 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8582 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 8583 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8584 | "$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] | 8585 | psk=abc123" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8586 | "$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] | 8587 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8588 | 0 \ | 
|  | 8589 | -s "Extra-header:" \ | 
|  | 8590 | -c "HTTP/1.0 200 OK" | 
|  | 8591 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8592 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8593 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 8594 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8595 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 8596 | "$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] | 8597 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 8598 | 0 \ | 
|  | 8599 | -s "Extra-header:" \ | 
|  | 8600 | -c "HTTP/1.0 200 OK" | 
|  | 8601 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8602 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8603 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 8604 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8605 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 8606 | "$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] | 8607 | 0 \ | 
|  | 8608 | -s "Extra-header:" \ | 
|  | 8609 | -c "HTTP/1.0 200 OK" | 
|  | 8610 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8611 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8612 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 8613 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8614 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ | 
|  | 8615 | "$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] | 8616 | 0 \ | 
|  | 8617 | -s "Extra-header:" \ | 
|  | 8618 | -c "HTTP/1.0 200 OK" | 
|  | 8619 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8620 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8621 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 8622 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8623 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ | 
|  | 8624 | "$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] | 8625 | 0 \ | 
|  | 8626 | -s "Extra-header:" \ | 
|  | 8627 | -c "HTTP/1.0 200 OK" | 
|  | 8628 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8629 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8630 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 8631 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8632 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ | 
|  | 8633 | "$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] | 8634 | 0 \ | 
|  | 8635 | -s "Extra-header:" \ | 
|  | 8636 | -c "HTTP/1.0 200 OK" | 
|  | 8637 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8638 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8639 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 8640 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8641 | "$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] | 8642 | auth_mode=required" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8643 | "$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] | 8644 | 0 \ | 
|  | 8645 | -s "Extra-header:" \ | 
|  | 8646 | -c "HTTP/1.0 200 OK" | 
|  | 8647 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8648 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8649 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 8650 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8651 | "$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] | 8652 | psk=abc123 debug_level=3" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8653 | "$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] | 8654 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 8655 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8656 | 0 \ | 
|  | 8657 | -s "a session has been resumed" \ | 
|  | 8658 | -c "a session has been resumed" \ | 
|  | 8659 | -s "Extra-header:" \ | 
|  | 8660 | -c "HTTP/1.0 200 OK" | 
|  | 8661 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8662 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8663 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 8664 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8665 | "$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] | 8666 | psk=abc123 debug_level=3 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8667 | "$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] | 8668 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 8669 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 8670 | 0 \ | 
|  | 8671 | -s "a session has been resumed" \ | 
|  | 8672 | -c "a session has been resumed" \ | 
|  | 8673 | -s "Extra-header:" \ | 
|  | 8674 | -c "HTTP/1.0 200 OK" | 
|  | 8675 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8676 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8677 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8678 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 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 | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8681 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| 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 | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8683 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8684 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8685 | 0 \ | 
|  | 8686 | -c "=> renegotiate" \ | 
|  | 8687 | -s "=> renegotiate" \ | 
|  | 8688 | -s "Extra-header:" \ | 
|  | 8689 | -c "HTTP/1.0 200 OK" | 
|  | 8690 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8691 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8693 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 8694 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8695 | "$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] | 8696 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8697 | "$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] | 8698 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8699 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8700 | 0 \ | 
|  | 8701 | -c "=> renegotiate" \ | 
|  | 8702 | -s "=> renegotiate" \ | 
|  | 8703 | -s "Extra-header:" \ | 
|  | 8704 | -c "HTTP/1.0 200 OK" | 
|  | 8705 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8706 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8707 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8708 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 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=none \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8711 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8712 | debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8713 | "$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] | 8714 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8715 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8716 | 0 \ | 
|  | 8717 | -c "=> renegotiate" \ | 
|  | 8718 | -s "=> renegotiate" \ | 
|  | 8719 | -s "Extra-header:" \ | 
|  | 8720 | -c "HTTP/1.0 200 OK" | 
|  | 8721 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8722 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8724 | 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] | 8725 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8726 | "$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] | 8727 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8728 | debug_level=2 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8729 | "$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] | 8730 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8731 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 8732 | 0 \ | 
|  | 8733 | -c "=> renegotiate" \ | 
|  | 8734 | -s "=> renegotiate" \ | 
|  | 8735 | -s "Extra-header:" \ | 
|  | 8736 | -c "HTTP/1.0 200 OK" | 
|  | 8737 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8738 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including | 
|  | 8739 | ## all versions installed on the CI machines), reported here: | 
|  | 8740 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
|  | 8741 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 8742 | ## (this should happen in some 1.1.1_ release according to the ticket). | 
|  | 8743 | skip_next_test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8744 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8745 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8746 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8747 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8748 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8749 | "$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] | 8750 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8751 | -c "HTTP/1.0 200 OK" | 
|  | 8752 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8753 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8754 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8755 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8756 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 8757 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8758 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8759 | "$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] | 8760 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8761 | -c "HTTP/1.0 200 OK" | 
|  | 8762 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8763 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8764 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8765 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8766 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 8767 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 8768 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8769 | "$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] | 8770 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8771 | -c "HTTP/1.0 200 OK" | 
|  | 8772 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8773 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8774 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8775 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8776 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 8777 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 8778 | "$G_SRV -u --mtu 2048 -a" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8779 | "$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] | 8780 | 0 \ | 
|  | 8781 | -s "Extra-header:" \ | 
|  | 8782 | -c "Extra-header:" | 
|  | 8783 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8784 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8785 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8786 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8787 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 8788 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8789 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8790 | "$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] | 8791 | 0 \ | 
|  | 8792 | -s "Extra-header:" \ | 
|  | 8793 | -c "Extra-header:" | 
|  | 8794 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8795 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8796 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8797 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8798 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 8799 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8800 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8801 | "$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] | 8802 | 0 \ | 
|  | 8803 | -s "Extra-header:" \ | 
|  | 8804 | -c "Extra-header:" | 
|  | 8805 |  | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8806 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS | 
|  | 8807 | run_test    "export keys functionality" \ | 
|  | 8808 | "$P_SRV eap_tls=1 debug_level=3" \ | 
|  | 8809 | "$P_CLI eap_tls=1 debug_level=3" \ | 
|  | 8810 | 0 \ | 
|  | 8811 | -s "exported maclen is " \ | 
|  | 8812 | -s "exported keylen is " \ | 
|  | 8813 | -s "exported ivlen is "  \ | 
|  | 8814 | -c "exported maclen is " \ | 
|  | 8815 | -c "exported keylen is " \ | 
|  | 8816 | -c "exported ivlen is " | 
|  | 8817 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8818 | # Final report | 
|  | 8819 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8820 | echo "------------------------------------------------------------------------" | 
|  | 8821 |  | 
|  | 8822 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8823 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8824 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8825 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8826 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8827 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8828 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8829 |  | 
|  | 8830 | exit $FAILS |