| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved | 
|  | 8 | # | 
|  | 9 | # Purpose | 
|  | 10 | # | 
|  | 11 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 12 | # | 
|  | 13 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 14 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 15 | # (session resumption from cache or ticket, renego, etc). | 
|  | 16 | # | 
|  | 17 | # The tests assume a build with default options, with exceptions expressed | 
|  | 18 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 19 | # performance. | 
|  | 20 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u | 
|  | 23 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else | 
|  | 25 | echo "cd $( dirname $0 ) failed" >&2 | 
|  | 26 | exit 1 | 
|  | 27 | fi | 
|  | 28 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 29 | # default values, can be overriden by the environment | 
|  | 30 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 31 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 35 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 39 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 41 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 44 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 45 |  | 
|  | 46 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 47 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 48 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 49 | else | 
|  | 50 | O_LEGACY_SRV=false | 
|  | 51 | O_LEGACY_CLI=false | 
|  | 52 | fi | 
|  | 53 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 54 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 55 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
|  | 56 | else | 
|  | 57 | G_NEXT_SRV=false | 
|  | 58 | fi | 
|  | 59 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 60 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 61 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
|  | 62 | else | 
|  | 63 | G_NEXT_CLI=false | 
|  | 64 | fi | 
|  | 65 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 66 | TESTS=0 | 
|  | 67 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 68 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 69 |  | 
| Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 70 | CONFIG_H='../include/mbedtls/config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 71 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 72 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 73 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 74 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 75 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 76 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 77 | RUN_TEST_NUMBER='' | 
|  | 78 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 79 | PRESERVE_LOGS=0 | 
|  | 80 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 81 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 82 | # port which is this plus 10000. Each port number may be independently | 
|  | 83 | # overridden by a command line option. | 
|  | 84 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 85 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 86 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | print_usage() { | 
|  | 88 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 89 | printf "  -h|--help\tPrint this help.\n" | 
|  | 90 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 91 | printf "  -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" | 
|  | 92 | printf "  -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 93 | printf "  -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 94 | printf "  -s|--show-numbers\tShow test numbers in front of test names\n" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 95 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | printf "     --port\tTCP/UDP port (default: randomish 1xxxx)\n" | 
|  | 97 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 98 | printf "     --seed\tInteger seed value to use for this test run\n" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 99 | } | 
|  | 100 |  | 
|  | 101 | get_options() { | 
|  | 102 | while [ $# -gt 0 ]; do | 
|  | 103 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 104 | -f|--filter) | 
|  | 105 | shift; FILTER=$1 | 
|  | 106 | ;; | 
|  | 107 | -e|--exclude) | 
|  | 108 | shift; EXCLUDE=$1 | 
|  | 109 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | -m|--memcheck) | 
|  | 111 | MEMCHECK=1 | 
|  | 112 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 113 | -n|--number) | 
|  | 114 | shift; RUN_TEST_NUMBER=$1 | 
|  | 115 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 116 | -s|--show-numbers) | 
|  | 117 | SHOW_TEST_NUMBER=1 | 
|  | 118 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 119 | -p|--preserve-logs) | 
|  | 120 | PRESERVE_LOGS=1 | 
|  | 121 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | --port) | 
|  | 123 | shift; SRV_PORT=$1 | 
|  | 124 | ;; | 
|  | 125 | --proxy-port) | 
|  | 126 | shift; PXY_PORT=$1 | 
|  | 127 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 128 | --seed) | 
|  | 129 | shift; SEED="$1" | 
|  | 130 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | -h|--help) | 
|  | 132 | print_usage | 
|  | 133 | exit 0 | 
|  | 134 | ;; | 
|  | 135 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 136 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage | 
|  | 138 | exit 1 | 
|  | 139 | ;; | 
|  | 140 | esac | 
|  | 141 | shift | 
|  | 142 | done | 
|  | 143 | } | 
|  | 144 |  | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 146 | # in theory and expected to be re-introduced at some point, but | 
|  | 147 | # aren't expected to succeed at the moment due to problems outside | 
|  | 148 | # our control (such as bugs in other TLS implementations). | 
|  | 149 | skip_next_test() { | 
|  | 150 | SKIP_NEXT="YES" | 
|  | 151 | } | 
|  | 152 |  | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h | 
|  | 154 | requires_config_enabled() { | 
|  | 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else | 
|  | 156 | SKIP_NEXT="YES" | 
|  | 157 | fi | 
|  | 158 | } | 
|  | 159 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h | 
|  | 161 | requires_config_disabled() { | 
|  | 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then | 
|  | 163 | SKIP_NEXT="YES" | 
|  | 164 | fi | 
|  | 165 | } | 
|  | 166 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 168 | NAME="$1" | 
| Hanno Becker | e604556 | 2018-08-28 11:24:55 +0100 | [diff] [blame] | 169 | DEF_VAL=$( grep ".*#define.*${NAME}" ../include/mbedtls/config.h | | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 170 | sed 's/^.*\s\([0-9]*\)$/\1/' ) | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 171 | ../scripts/config.pl get $NAME || echo "$DEF_VAL" | 
|  | 172 | } | 
|  | 173 |  | 
|  | 174 | requires_config_value_at_least() { | 
|  | 175 | VAL=$( get_config_value_or_default "$1" ) | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 176 | if [ "$VAL" -lt "$2" ]; then | 
|  | 177 | SKIP_NEXT="YES" | 
|  | 178 | fi | 
|  | 179 | } | 
|  | 180 |  | 
|  | 181 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 182 | VAL=$( get_config_value_or_default "$1" ) | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 183 | if [ "$VAL" -gt "$2" ]; then | 
|  | 184 | SKIP_NEXT="YES" | 
|  | 185 | fi | 
|  | 186 | } | 
|  | 187 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 188 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 189 | requires_openssl_with_fallback_scsv() { | 
|  | 190 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 191 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 192 | then | 
|  | 193 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 194 | else | 
|  | 195 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 196 | fi | 
|  | 197 | fi | 
|  | 198 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 199 | SKIP_NEXT="YES" | 
|  | 200 | fi | 
|  | 201 | } | 
|  | 202 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 203 | # skip next test if GnuTLS isn't available | 
|  | 204 | requires_gnutls() { | 
|  | 205 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 206 | 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] | 207 | GNUTLS_AVAILABLE="YES" | 
|  | 208 | else | 
|  | 209 | GNUTLS_AVAILABLE="NO" | 
|  | 210 | fi | 
|  | 211 | fi | 
|  | 212 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 213 | SKIP_NEXT="YES" | 
|  | 214 | fi | 
|  | 215 | } | 
|  | 216 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 217 | # skip next test if GnuTLS-next isn't available | 
|  | 218 | requires_gnutls_next() { | 
|  | 219 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 220 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 221 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 222 | else | 
|  | 223 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 224 | fi | 
|  | 225 | fi | 
|  | 226 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 227 | SKIP_NEXT="YES" | 
|  | 228 | fi | 
|  | 229 | } | 
|  | 230 |  | 
|  | 231 | # skip next test if OpenSSL-legacy isn't available | 
|  | 232 | requires_openssl_legacy() { | 
|  | 233 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 234 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 235 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 236 | else | 
|  | 237 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 238 | fi | 
|  | 239 | fi | 
|  | 240 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 241 | SKIP_NEXT="YES" | 
|  | 242 | fi | 
|  | 243 | } | 
|  | 244 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 245 | # skip next test if IPv6 isn't available on this host | 
|  | 246 | requires_ipv6() { | 
|  | 247 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 248 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 249 | SRV_PID=$! | 
|  | 250 | sleep 1 | 
|  | 251 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 252 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 253 | HAS_IPV6="NO" | 
|  | 254 | else | 
|  | 255 | HAS_IPV6="YES" | 
|  | 256 | fi | 
|  | 257 | rm -r $SRV_OUT | 
|  | 258 | fi | 
|  | 259 |  | 
|  | 260 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 261 | SKIP_NEXT="YES" | 
|  | 262 | fi | 
|  | 263 | } | 
|  | 264 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 265 | # Calculate the input & output maximum content lengths set in the config | 
|  | 266 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") | 
|  | 267 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
|  | 268 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
|  | 269 |  | 
|  | 270 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 271 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 272 | fi | 
|  | 273 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 274 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 275 | fi | 
|  | 276 |  | 
|  | 277 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 278 | requires_full_size_output_buffer() { | 
|  | 279 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 280 | SKIP_NEXT="YES" | 
|  | 281 | fi | 
|  | 282 | } | 
|  | 283 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 284 | # skip the next test if valgrind is in use | 
|  | 285 | not_with_valgrind() { | 
|  | 286 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 287 | SKIP_NEXT="YES" | 
|  | 288 | fi | 
|  | 289 | } | 
|  | 290 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 291 | # skip the next test if valgrind is NOT in use | 
|  | 292 | only_with_valgrind() { | 
|  | 293 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 294 | SKIP_NEXT="YES" | 
|  | 295 | fi | 
|  | 296 | } | 
|  | 297 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 298 | # 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] | 299 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 300 | CLI_DELAY_FACTOR=$1 | 
|  | 301 | } | 
|  | 302 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 303 | # wait for the given seconds after the client finished in the next test | 
|  | 304 | server_needs_more_time() { | 
|  | 305 | SRV_DELAY_SECONDS=$1 | 
|  | 306 | } | 
|  | 307 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 308 | # print_name <name> | 
|  | 309 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 310 | TESTS=$(( $TESTS + 1 )) | 
|  | 311 | LINE="" | 
|  | 312 |  | 
|  | 313 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 314 | LINE="$TESTS " | 
|  | 315 | fi | 
|  | 316 |  | 
|  | 317 | LINE="$LINE$1" | 
|  | 318 | printf "$LINE " | 
|  | 319 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 320 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 321 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 322 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 323 | } | 
|  | 324 |  | 
|  | 325 | # fail <message> | 
|  | 326 | fail() { | 
|  | 327 | echo "FAIL" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 328 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 329 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 330 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 331 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 332 | if [ -n "$PXY_CMD" ]; then | 
|  | 333 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 334 | fi | 
|  | 335 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 336 |  | 
| Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 337 | 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] | 338 | echo "  ! server output:" | 
|  | 339 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 340 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 341 | echo "  ! client output:" | 
|  | 342 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 343 | if [ -n "$PXY_CMD" ]; then | 
|  | 344 | echo "  ! ========================================================" | 
|  | 345 | echo "  ! proxy output:" | 
|  | 346 | cat o-pxy-${TESTS}.log | 
|  | 347 | fi | 
|  | 348 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 349 | fi | 
|  | 350 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 351 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 352 | } | 
|  | 353 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 354 | # is_polar <cmd_line> | 
|  | 355 | is_polar() { | 
|  | 356 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null | 
|  | 357 | } | 
|  | 358 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 359 | # openssl s_server doesn't have -www with DTLS | 
|  | 360 | check_osrv_dtls() { | 
|  | 361 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then | 
|  | 362 | NEEDS_INPUT=1 | 
|  | 363 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" | 
|  | 364 | else | 
|  | 365 | NEEDS_INPUT=0 | 
|  | 366 | fi | 
|  | 367 | } | 
|  | 368 |  | 
|  | 369 | # provide input to commands that need it | 
|  | 370 | provide_input() { | 
|  | 371 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 372 | return | 
|  | 373 | fi | 
|  | 374 |  | 
|  | 375 | while true; do | 
|  | 376 | echo "HTTP/1.0 200 OK" | 
|  | 377 | sleep 1 | 
|  | 378 | done | 
|  | 379 | } | 
|  | 380 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 381 | # has_mem_err <log_file_name> | 
|  | 382 | has_mem_err() { | 
|  | 383 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 384 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 385 | then | 
|  | 386 | return 1 # false: does not have errors | 
|  | 387 | else | 
|  | 388 | return 0 # true: has errors | 
|  | 389 | fi | 
|  | 390 | } | 
|  | 391 |  | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 392 | # Wait for process $2 to be listening on port $1 | 
|  | 393 | if type lsof >/dev/null 2>/dev/null; then | 
|  | 394 | wait_server_start() { | 
|  | 395 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 396 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 397 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 398 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 399 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 400 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 401 | # Make a tight loop, server normally takes less than 1s to start. | 
|  | 402 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do | 
|  | 403 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
|  | 404 | echo "SERVERSTART TIMEOUT" | 
|  | 405 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT | 
|  | 406 | break | 
|  | 407 | fi | 
|  | 408 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 409 | # OSes this may be a tight loop. | 
|  | 410 | sleep 0.1 2>/dev/null || true | 
|  | 411 | done | 
|  | 412 | } | 
|  | 413 | else | 
| Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 414 | echo "Warning: lsof not available, wait_server_start = sleep" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 415 | wait_server_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 416 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 417 | } | 
|  | 418 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 419 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 420 | # 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] | 421 | # 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] | 422 | # acceptable bounds | 
|  | 423 | check_server_hello_time() { | 
|  | 424 | # 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] | 425 | 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] | 426 | # Get the Unix timestamp for now | 
|  | 427 | CUR_TIME=$(date +'%s') | 
|  | 428 | THRESHOLD_IN_SECS=300 | 
|  | 429 |  | 
|  | 430 | # Check if the ServerHello time was printed | 
|  | 431 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 432 | return 1 | 
|  | 433 | fi | 
|  | 434 |  | 
|  | 435 | # Check the time in ServerHello is within acceptable bounds | 
|  | 436 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 437 | # The time in ServerHello is at least 5 minutes before now | 
|  | 438 | return 1 | 
|  | 439 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 440 | # 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] | 441 | return 1 | 
|  | 442 | else | 
|  | 443 | return 0 | 
|  | 444 | fi | 
|  | 445 | } | 
|  | 446 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 447 | # wait for client to terminate and set CLI_EXIT | 
|  | 448 | # must be called right after starting the client | 
|  | 449 | wait_client_done() { | 
|  | 450 | CLI_PID=$! | 
|  | 451 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 452 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 453 | CLI_DELAY_FACTOR=1 | 
|  | 454 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 455 | ( 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] | 456 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 457 |  | 
|  | 458 | wait $CLI_PID | 
|  | 459 | CLI_EXIT=$? | 
|  | 460 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 461 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 462 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 463 |  | 
|  | 464 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 465 |  | 
|  | 466 | sleep $SRV_DELAY_SECONDS | 
|  | 467 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 468 | } | 
|  | 469 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 470 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 471 | detect_dtls() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 472 | 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] | 473 | DTLS=1 | 
|  | 474 | else | 
|  | 475 | DTLS=0 | 
|  | 476 | fi | 
|  | 477 | } | 
|  | 478 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 479 | # 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] | 480 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 481 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 482 | #           -u pattern  lines after pattern must be unique in client output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 483 | #           -f call shell function on client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 484 | #           -S pattern  pattern that must be absent in server output | 
|  | 485 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 486 | #           -U pattern  lines after pattern must be unique in server output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 487 | #           -F call shell function on server output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 488 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 489 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 490 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 491 |  | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 492 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : | 
|  | 493 | else | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 494 | SKIP_NEXT="NO" | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 495 | return | 
|  | 496 | fi | 
|  | 497 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 498 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 499 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 500 | # Do we only run numbered tests? | 
|  | 501 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : | 
|  | 502 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : | 
|  | 503 | else | 
|  | 504 | SKIP_NEXT="YES" | 
|  | 505 | fi | 
|  | 506 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 507 | # should we skip? | 
|  | 508 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 509 | SKIP_NEXT="NO" | 
|  | 510 | echo "SKIP" | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 511 | SKIPS=$(( $SKIPS + 1 )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 512 | return | 
|  | 513 | fi | 
|  | 514 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 515 | # does this test use a proxy? | 
|  | 516 | if [ "X$1" = "X-p" ]; then | 
|  | 517 | PXY_CMD="$2" | 
|  | 518 | shift 2 | 
|  | 519 | else | 
|  | 520 | PXY_CMD="" | 
|  | 521 | fi | 
|  | 522 |  | 
|  | 523 | # get commands and client output | 
|  | 524 | SRV_CMD="$1" | 
|  | 525 | CLI_CMD="$2" | 
|  | 526 | CLI_EXPECT="$3" | 
|  | 527 | shift 3 | 
|  | 528 |  | 
|  | 529 | # fix client port | 
|  | 530 | if [ -n "$PXY_CMD" ]; then | 
|  | 531 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 532 | else | 
|  | 533 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 534 | fi | 
|  | 535 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 536 | # update DTLS variable | 
|  | 537 | detect_dtls "$SRV_CMD" | 
|  | 538 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 539 | # prepend valgrind to our commands if active | 
|  | 540 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 541 | if is_polar "$SRV_CMD"; then | 
|  | 542 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 543 | fi | 
|  | 544 | if is_polar "$CLI_CMD"; then | 
|  | 545 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 546 | fi | 
|  | 547 | fi | 
|  | 548 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 549 | TIMES_LEFT=2 | 
|  | 550 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 551 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 552 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 553 | # run the commands | 
|  | 554 | if [ -n "$PXY_CMD" ]; then | 
|  | 555 | echo "$PXY_CMD" > $PXY_OUT | 
|  | 556 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 557 | PXY_PID=$! | 
|  | 558 | # assume proxy starts faster than server | 
|  | 559 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 560 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 561 | check_osrv_dtls | 
|  | 562 | echo "$SRV_CMD" > $SRV_OUT | 
|  | 563 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 564 | SRV_PID=$! | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 565 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 566 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 567 | echo "$CLI_CMD" > $CLI_OUT | 
|  | 568 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 569 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 570 |  | 
| Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 571 | sleep 0.05 | 
|  | 572 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 573 | # terminate the server (and the proxy) | 
|  | 574 | kill $SRV_PID | 
|  | 575 | wait $SRV_PID | 
| Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 576 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 577 | if [ -n "$PXY_CMD" ]; then | 
|  | 578 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 579 | wait $PXY_PID | 
|  | 580 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 581 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 582 | # retry only on timeouts | 
|  | 583 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 584 | printf "RETRY " | 
|  | 585 | else | 
|  | 586 | TIMES_LEFT=0 | 
|  | 587 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 588 | done | 
|  | 589 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 590 | # 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] | 591 | # (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] | 592 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 593 | # failure) | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 594 | if is_polar "$SRV_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 595 | 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] | 596 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 597 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 598 | return | 
|  | 599 | fi | 
|  | 600 | fi | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 601 | if is_polar "$CLI_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 602 | 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] | 603 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 604 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 605 | return | 
|  | 606 | fi | 
|  | 607 | fi | 
|  | 608 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 609 | # check server exit code | 
|  | 610 | if [ $? != 0 ]; then | 
|  | 611 | fail "server fail" | 
|  | 612 | return | 
|  | 613 | fi | 
|  | 614 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 615 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 616 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 617 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 618 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 619 | 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] | 620 | return | 
|  | 621 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 622 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 623 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 624 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 625 | # 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] | 626 | while [ $# -gt 0 ] | 
|  | 627 | do | 
|  | 628 | case $1 in | 
|  | 629 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 630 | 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] | 631 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 632 | return | 
|  | 633 | fi | 
|  | 634 | ;; | 
|  | 635 |  | 
|  | 636 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 637 | 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] | 638 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 639 | return | 
|  | 640 | fi | 
|  | 641 | ;; | 
|  | 642 |  | 
|  | 643 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 644 | 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] | 645 | 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] | 646 | return | 
|  | 647 | fi | 
|  | 648 | ;; | 
|  | 649 |  | 
|  | 650 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 651 | 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] | 652 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 653 | return | 
|  | 654 | fi | 
|  | 655 | ;; | 
|  | 656 |  | 
|  | 657 | # The filtering in the following two options (-u and -U) do the following | 
|  | 658 | #   - ignore valgrind output | 
|  | 659 | #   - filter out everything but lines right after the pattern occurances | 
|  | 660 | #   - keep one of each non-unique line | 
|  | 661 | #   - count how many lines remain | 
|  | 662 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 663 | # if there were no duplicates. | 
|  | 664 | "-U") | 
|  | 665 | 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 | 
|  | 666 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 667 | return | 
|  | 668 | fi | 
|  | 669 | ;; | 
|  | 670 |  | 
|  | 671 | "-u") | 
|  | 672 | 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 | 
|  | 673 | 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] | 674 | return | 
|  | 675 | fi | 
|  | 676 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 677 | "-F") | 
|  | 678 | if ! $2 "$SRV_OUT"; then | 
|  | 679 | fail "function call to '$2' failed on Server output" | 
|  | 680 | return | 
|  | 681 | fi | 
|  | 682 | ;; | 
|  | 683 | "-f") | 
|  | 684 | if ! $2 "$CLI_OUT"; then | 
|  | 685 | fail "function call to '$2' failed on Client output" | 
|  | 686 | return | 
|  | 687 | fi | 
|  | 688 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 689 |  | 
|  | 690 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 691 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 692 | exit 1 | 
|  | 693 | esac | 
|  | 694 | shift 2 | 
|  | 695 | done | 
|  | 696 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 697 | # check valgrind's results | 
|  | 698 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 699 | 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] | 700 | fail "Server has memory errors" | 
|  | 701 | return | 
|  | 702 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 703 | 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] | 704 | fail "Client has memory errors" | 
|  | 705 | return | 
|  | 706 | fi | 
|  | 707 | fi | 
|  | 708 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 709 | # if we're here, everything is ok | 
|  | 710 | echo "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 711 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 712 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 713 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 714 | if [ -n "$PXY_CMD" ]; then | 
|  | 715 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 716 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 717 | fi | 
|  | 718 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 719 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 720 | } | 
|  | 721 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 722 | cleanup() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 723 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 724 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 725 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 726 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 727 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 728 | exit 1 | 
|  | 729 | } | 
|  | 730 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 731 | # | 
|  | 732 | # MAIN | 
|  | 733 | # | 
|  | 734 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 735 | get_options "$@" | 
|  | 736 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 737 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 738 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 739 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 740 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 741 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 742 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 743 | exit 1 | 
|  | 744 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 745 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 746 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 747 | exit 1 | 
|  | 748 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 749 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 750 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 751 | exit 1 | 
|  | 752 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 753 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 754 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 755 | echo "Memcheck not possible. Valgrind not found" | 
|  | 756 | exit 1 | 
|  | 757 | fi | 
|  | 758 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 759 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 760 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 761 | exit 1 | 
|  | 762 | fi | 
|  | 763 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 764 | # used by watchdog | 
|  | 765 | MAIN_PID="$$" | 
|  | 766 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 767 | # We use somewhat arbitrary delays for tests: | 
|  | 768 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 769 | # - how long do we allow for the client to finish? | 
|  | 770 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 771 | # Things are slower with valgrind, so give extra time here. | 
|  | 772 | # | 
|  | 773 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 774 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 775 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 776 | # the script, only the case where a client or server gets stuck. | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 777 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 778 | START_DELAY=6 | 
|  | 779 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 780 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 781 | START_DELAY=2 | 
|  | 782 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 783 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 784 |  | 
|  | 785 | # some particular tests need more time: | 
|  | 786 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 787 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 788 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 789 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 790 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 791 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 792 | # fix commands to use this port, force IPv4 while at it | 
| Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 793 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 794 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 795 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 796 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" | 
| Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 797 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 798 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" | 
|  | 799 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 800 | G_CLI="$G_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 801 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 802 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 803 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
|  | 804 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" | 
|  | 805 | fi | 
|  | 806 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 807 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 808 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
|  | 809 | fi | 
|  | 810 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 811 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 812 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 813 | fi | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 814 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 815 | # Allow SHA-1, because many of our test certificates use it | 
|  | 816 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 817 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 818 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 819 | # Also pick a unique name for intermediate files | 
|  | 820 | SRV_OUT="srv_out.$$" | 
|  | 821 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 822 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 823 | SESSION="session.$$" | 
|  | 824 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 825 | SKIP_NEXT="NO" | 
|  | 826 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 827 | trap cleanup INT TERM HUP | 
|  | 828 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 829 | # Basic test | 
|  | 830 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 831 | # Checks that: | 
|  | 832 | # - things work with all ciphersuites active (used with config-full in all.sh) | 
|  | 833 | # - the expected (highest security) parameters are selected | 
|  | 834 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 835 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 836 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 837 | "$P_CLI" \ | 
|  | 838 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 839 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 840 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 841 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 842 | -s "ECDHE curve: secp521r1" \ | 
|  | 843 | -S "error" \ | 
|  | 844 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 845 |  | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 846 | run_test    "Default, DTLS" \ | 
|  | 847 | "$P_SRV dtls=1" \ | 
|  | 848 | "$P_CLI dtls=1" \ | 
|  | 849 | 0 \ | 
|  | 850 | -s "Protocol is DTLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 851 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 852 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 853 | # Test current time in ServerHello | 
|  | 854 | requires_config_enabled MBEDTLS_HAVE_TIME | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 855 | run_test    "ServerHello contains gmt_unix_time" \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 856 | "$P_SRV debug_level=3" \ | 
|  | 857 | "$P_CLI debug_level=3" \ | 
|  | 858 | 0 \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 859 | -f "check_server_hello_time" \ | 
|  | 860 | -F "check_server_hello_time" | 
|  | 861 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 862 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 863 | run_test    "Unique IV in GCM" \ | 
|  | 864 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 865 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 866 | 0 \ | 
|  | 867 | -u "IV used" \ | 
|  | 868 | -U "IV used" | 
|  | 869 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 870 | # Tests for rc4 option | 
|  | 871 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 872 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 873 | run_test    "RC4: server disabled, client enabled" \ | 
|  | 874 | "$P_SRV" \ | 
|  | 875 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 876 | 1 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 877 | -s "SSL - The server has no ciphersuites in common" | 
|  | 878 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 879 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 880 | run_test    "RC4: server half, client enabled" \ | 
|  | 881 | "$P_SRV arc4=1" \ | 
|  | 882 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 883 | 1 \ | 
|  | 884 | -s "SSL - The server has no ciphersuites in common" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 885 |  | 
|  | 886 | run_test    "RC4: server enabled, client disabled" \ | 
|  | 887 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 888 | "$P_CLI" \ | 
|  | 889 | 1 \ | 
|  | 890 | -s "SSL - The server has no ciphersuites in common" | 
|  | 891 |  | 
|  | 892 | run_test    "RC4: both enabled" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 893 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 894 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 895 | 0 \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 896 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 897 | -S "SSL - The server has no ciphersuites in common" | 
|  | 898 |  | 
| Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 899 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier | 
|  | 900 |  | 
|  | 901 | requires_gnutls | 
|  | 902 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 903 | run_test    "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ | 
|  | 904 | "$G_SRV"\ | 
|  | 905 | "$P_CLI force_version=tls1_1" \ | 
|  | 906 | 0 | 
|  | 907 |  | 
|  | 908 | requires_gnutls | 
|  | 909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 | 
|  | 910 | run_test    "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ | 
|  | 911 | "$G_SRV"\ | 
|  | 912 | "$P_CLI force_version=tls1" \ | 
|  | 913 | 0 | 
|  | 914 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 915 | # Tests for SHA-1 support | 
|  | 916 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 917 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 918 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 919 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 920 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 921 | 1 \ | 
|  | 922 | -c "The certificate is signed with an unacceptable hash" | 
|  | 923 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 924 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 925 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 926 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 927 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 928 | 0 | 
|  | 929 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 930 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 931 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 932 | "$P_CLI allow_sha1=1" \ | 
|  | 933 | 0 | 
|  | 934 |  | 
|  | 935 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 936 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 937 | "$P_CLI allow_sha1=0" \ | 
|  | 938 | 0 | 
|  | 939 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 940 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 941 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 942 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 943 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 944 | 1 \ | 
|  | 945 | -s "The certificate is signed with an unacceptable hash" | 
|  | 946 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 947 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
|  | 948 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 949 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 950 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 951 | 0 | 
|  | 952 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 953 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 954 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 955 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 956 | 0 | 
|  | 957 |  | 
|  | 958 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 959 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 960 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 961 | 0 | 
|  | 962 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 963 | # Tests for datagram packing | 
|  | 964 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 965 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 966 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 967 | 0 \ | 
|  | 968 | -c "next record in same datagram" \ | 
|  | 969 | -s "next record in same datagram" | 
|  | 970 |  | 
|  | 971 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 972 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 973 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 974 | 0 \ | 
|  | 975 | -s "next record in same datagram" \ | 
|  | 976 | -C "next record in same datagram" | 
|  | 977 |  | 
|  | 978 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 979 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 980 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 981 | 0 \ | 
|  | 982 | -S "next record in same datagram" \ | 
|  | 983 | -c "next record in same datagram" | 
|  | 984 |  | 
|  | 985 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 986 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 987 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 988 | 0 \ | 
|  | 989 | -S "next record in same datagram" \ | 
|  | 990 | -C "next record in same datagram" | 
|  | 991 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 992 | # Tests for Truncated HMAC extension | 
|  | 993 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 994 | run_test    "Truncated HMAC: client default, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 995 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 996 | "$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] | 997 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 998 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 999 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1000 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1001 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1002 | run_test    "Truncated HMAC: client disabled, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1003 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1004 | "$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] | 1005 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1006 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1007 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1008 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1009 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1010 | run_test    "Truncated HMAC: client enabled, server default" \ | 
|  | 1011 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1012 | "$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] | 1013 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1014 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1015 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1016 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1017 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1018 | run_test    "Truncated HMAC: client enabled, server disabled" \ | 
|  | 1019 | "$P_SRV debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1020 | "$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] | 1021 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1022 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1023 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1024 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1025 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1026 | run_test    "Truncated HMAC: client disabled, server enabled" \ | 
|  | 1027 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1028 | "$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] | 1029 | 0 \ | 
|  | 1030 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1031 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1032 |  | 
|  | 1033 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1034 | run_test    "Truncated HMAC: client enabled, server enabled" \ | 
|  | 1035 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1036 | "$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] | 1037 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1038 | -S "dumping 'expected mac' (20 bytes)" \ | 
|  | 1039 | -s "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1040 |  | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1041 | run_test    "Truncated HMAC, DTLS: client default, server default" \ | 
|  | 1042 | "$P_SRV dtls=1 debug_level=4" \ | 
|  | 1043 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 1044 | 0 \ | 
|  | 1045 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1046 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1047 |  | 
|  | 1048 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1049 | run_test    "Truncated HMAC, DTLS: client disabled, server default" \ | 
|  | 1050 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1051 | "$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] | 1052 | 0 \ | 
|  | 1053 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1054 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1055 |  | 
|  | 1056 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1057 | run_test    "Truncated HMAC, DTLS: client enabled, server default" \ | 
|  | 1058 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1059 | "$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] | 1060 | 0 \ | 
|  | 1061 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1062 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1063 |  | 
|  | 1064 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1065 | run_test    "Truncated HMAC, DTLS: client enabled, server disabled" \ | 
|  | 1066 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1067 | "$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] | 1068 | 0 \ | 
|  | 1069 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1070 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1071 |  | 
|  | 1072 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1073 | run_test    "Truncated HMAC, DTLS: client disabled, server enabled" \ | 
|  | 1074 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1075 | "$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] | 1076 | 0 \ | 
|  | 1077 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1078 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1079 |  | 
|  | 1080 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1081 | run_test    "Truncated HMAC, DTLS: client enabled, server enabled" \ | 
|  | 1082 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1083 | "$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] | 1084 | 0 \ | 
|  | 1085 | -S "dumping 'expected mac' (20 bytes)" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1086 | -s "dumping 'expected mac' (10 bytes)" | 
|  | 1087 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1088 | # Tests for Encrypt-then-MAC extension | 
|  | 1089 |  | 
|  | 1090 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1091 | "$P_SRV debug_level=3 \ | 
|  | 1092 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1093 | "$P_CLI debug_level=3" \ | 
|  | 1094 | 0 \ | 
|  | 1095 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 1096 | -s "found encrypt then mac extension" \ | 
|  | 1097 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 1098 | -c "found encrypt_then_mac extension" \ | 
|  | 1099 | -c "using encrypt then mac" \ | 
|  | 1100 | -s "using encrypt then mac" | 
|  | 1101 |  | 
|  | 1102 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1103 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 1104 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1105 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 1106 | 0 \ | 
|  | 1107 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 1108 | -s "found encrypt then mac extension" \ | 
|  | 1109 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1110 | -C "found encrypt_then_mac extension" \ | 
|  | 1111 | -C "using encrypt then mac" \ | 
|  | 1112 | -S "using encrypt then mac" | 
|  | 1113 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1114 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 1115 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 1116 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 1117 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 1118 | 0 \ | 
|  | 1119 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 1120 | -s "found encrypt then mac extension" \ | 
|  | 1121 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1122 | -C "found encrypt_then_mac extension" \ | 
|  | 1123 | -C "using encrypt then mac" \ | 
|  | 1124 | -S "using encrypt then mac" | 
|  | 1125 |  | 
|  | 1126 | run_test    "Encrypt then MAC: client enabled, stream cipher" \ | 
|  | 1127 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 1128 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1129 | "$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] | 1130 | 0 \ | 
|  | 1131 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 1132 | -s "found encrypt then mac extension" \ | 
|  | 1133 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1134 | -C "found encrypt_then_mac extension" \ | 
|  | 1135 | -C "using encrypt then mac" \ | 
|  | 1136 | -S "using encrypt then mac" | 
|  | 1137 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1138 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1139 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 1140 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1141 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 1142 | 0 \ | 
|  | 1143 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 1144 | -S "found encrypt then mac extension" \ | 
|  | 1145 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1146 | -C "found encrypt_then_mac extension" \ | 
|  | 1147 | -C "using encrypt then mac" \ | 
|  | 1148 | -S "using encrypt then mac" | 
|  | 1149 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1150 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1151 | run_test    "Encrypt then MAC: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1152 | "$P_SRV debug_level=3 min_version=ssl3 \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1153 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1154 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 1155 | 0 \ | 
|  | 1156 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 1157 | -S "found encrypt then mac extension" \ | 
|  | 1158 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1159 | -C "found encrypt_then_mac extension" \ | 
|  | 1160 | -C "using encrypt then mac" \ | 
|  | 1161 | -S "using encrypt then mac" | 
|  | 1162 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1163 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1164 | run_test    "Encrypt then MAC: client enabled, server SSLv3" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1165 | "$P_SRV debug_level=3 force_version=ssl3 \ | 
|  | 1166 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1167 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1168 | 0 \ | 
|  | 1169 | -c "client hello, adding encrypt_then_mac extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1170 | -S "found encrypt then mac extension" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1171 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 1172 | -C "found encrypt_then_mac extension" \ | 
|  | 1173 | -C "using encrypt then mac" \ | 
|  | 1174 | -S "using encrypt then mac" | 
|  | 1175 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1176 | # Tests for Extended Master Secret extension | 
|  | 1177 |  | 
|  | 1178 | run_test    "Extended Master Secret: default" \ | 
|  | 1179 | "$P_SRV debug_level=3" \ | 
|  | 1180 | "$P_CLI debug_level=3" \ | 
|  | 1181 | 0 \ | 
|  | 1182 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 1183 | -s "found extended master secret extension" \ | 
|  | 1184 | -s "server hello, adding extended master secret extension" \ | 
|  | 1185 | -c "found extended_master_secret extension" \ | 
|  | 1186 | -c "using extended master secret" \ | 
|  | 1187 | -s "using extended master secret" | 
|  | 1188 |  | 
|  | 1189 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 1190 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 1191 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 1192 | 0 \ | 
|  | 1193 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 1194 | -s "found extended master secret extension" \ | 
|  | 1195 | -S "server hello, adding extended master secret extension" \ | 
|  | 1196 | -C "found extended_master_secret extension" \ | 
|  | 1197 | -C "using extended master secret" \ | 
|  | 1198 | -S "using extended master secret" | 
|  | 1199 |  | 
|  | 1200 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 1201 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 1202 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 1203 | 0 \ | 
|  | 1204 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 1205 | -S "found extended master secret extension" \ | 
|  | 1206 | -S "server hello, adding extended master secret extension" \ | 
|  | 1207 | -C "found extended_master_secret extension" \ | 
|  | 1208 | -C "using extended master secret" \ | 
|  | 1209 | -S "using extended master secret" | 
|  | 1210 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1211 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1212 | run_test    "Extended Master Secret: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1213 | "$P_SRV debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1214 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 1215 | 0 \ | 
|  | 1216 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 1217 | -S "found extended master secret extension" \ | 
|  | 1218 | -S "server hello, adding extended master secret extension" \ | 
|  | 1219 | -C "found extended_master_secret extension" \ | 
|  | 1220 | -C "using extended master secret" \ | 
|  | 1221 | -S "using extended master secret" | 
|  | 1222 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1223 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1224 | run_test    "Extended Master Secret: client enabled, server SSLv3" \ | 
|  | 1225 | "$P_SRV debug_level=3 force_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1226 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1227 | 0 \ | 
|  | 1228 | -c "client hello, adding extended_master_secret extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1229 | -S "found extended master secret extension" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1230 | -S "server hello, adding extended master secret extension" \ | 
|  | 1231 | -C "found extended_master_secret extension" \ | 
|  | 1232 | -C "using extended master secret" \ | 
|  | 1233 | -S "using extended master secret" | 
|  | 1234 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1235 | # Tests for FALLBACK_SCSV | 
|  | 1236 |  | 
|  | 1237 | run_test    "Fallback SCSV: default" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1238 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1239 | "$P_CLI debug_level=3 force_version=tls1_1" \ | 
|  | 1240 | 0 \ | 
|  | 1241 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1242 | -S "received FALLBACK_SCSV" \ | 
|  | 1243 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1244 | -C "is a fatal alert message (msg 86)" | 
|  | 1245 |  | 
|  | 1246 | run_test    "Fallback SCSV: explicitly disabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1247 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1248 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 1249 | 0 \ | 
|  | 1250 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1251 | -S "received FALLBACK_SCSV" \ | 
|  | 1252 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1253 | -C "is a fatal alert message (msg 86)" | 
|  | 1254 |  | 
|  | 1255 | run_test    "Fallback SCSV: enabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1256 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1257 | "$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] | 1258 | 1 \ | 
|  | 1259 | -c "adding FALLBACK_SCSV" \ | 
|  | 1260 | -s "received FALLBACK_SCSV" \ | 
|  | 1261 | -s "inapropriate fallback" \ | 
|  | 1262 | -c "is a fatal alert message (msg 86)" | 
|  | 1263 |  | 
|  | 1264 | run_test    "Fallback SCSV: enabled, max version" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1265 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1266 | "$P_CLI debug_level=3 fallback=1" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1267 | 0 \ | 
|  | 1268 | -c "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1269 | -s "received FALLBACK_SCSV" \ | 
|  | 1270 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1271 | -C "is a fatal alert message (msg 86)" | 
|  | 1272 |  | 
|  | 1273 | requires_openssl_with_fallback_scsv | 
|  | 1274 | run_test    "Fallback SCSV: default, openssl server" \ | 
|  | 1275 | "$O_SRV" \ | 
|  | 1276 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 1277 | 0 \ | 
|  | 1278 | -C "adding FALLBACK_SCSV" \ | 
|  | 1279 | -C "is a fatal alert message (msg 86)" | 
|  | 1280 |  | 
|  | 1281 | requires_openssl_with_fallback_scsv | 
|  | 1282 | run_test    "Fallback SCSV: enabled, openssl server" \ | 
|  | 1283 | "$O_SRV" \ | 
|  | 1284 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ | 
|  | 1285 | 1 \ | 
|  | 1286 | -c "adding FALLBACK_SCSV" \ | 
|  | 1287 | -c "is a fatal alert message (msg 86)" | 
|  | 1288 |  | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1289 | requires_openssl_with_fallback_scsv | 
|  | 1290 | run_test    "Fallback SCSV: disabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1291 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1292 | "$O_CLI -tls1_1" \ | 
|  | 1293 | 0 \ | 
|  | 1294 | -S "received FALLBACK_SCSV" \ | 
|  | 1295 | -S "inapropriate fallback" | 
|  | 1296 |  | 
|  | 1297 | requires_openssl_with_fallback_scsv | 
|  | 1298 | run_test    "Fallback SCSV: enabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1299 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1300 | "$O_CLI -tls1_1 -fallback_scsv" \ | 
|  | 1301 | 1 \ | 
|  | 1302 | -s "received FALLBACK_SCSV" \ | 
|  | 1303 | -s "inapropriate fallback" | 
|  | 1304 |  | 
|  | 1305 | requires_openssl_with_fallback_scsv | 
|  | 1306 | run_test    "Fallback SCSV: enabled, max version, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1307 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1308 | "$O_CLI -fallback_scsv" \ | 
|  | 1309 | 0 \ | 
|  | 1310 | -s "received FALLBACK_SCSV" \ | 
|  | 1311 | -S "inapropriate fallback" | 
|  | 1312 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1313 | # Test sending and receiving empty application data records | 
|  | 1314 |  | 
|  | 1315 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 1316 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 1317 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 1318 | 0 \ | 
|  | 1319 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 1320 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 1321 | -c "0 bytes written in 1 fragments" | 
|  | 1322 |  | 
|  | 1323 | run_test    "Default, no Encrypt then MAC: empty application data record" \ | 
|  | 1324 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 1325 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 1326 | 0 \ | 
|  | 1327 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 1328 | -c "0 bytes written in 1 fragments" | 
|  | 1329 |  | 
|  | 1330 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 1331 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 1332 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 1333 | 0 \ | 
|  | 1334 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 1335 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 1336 | -c "0 bytes written in 1 fragments" | 
|  | 1337 |  | 
|  | 1338 | run_test    "Default, no Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 1339 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 1340 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 1341 | 0 \ | 
|  | 1342 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 1343 | -c "0 bytes written in 1 fragments" | 
|  | 1344 |  | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1345 | ## ClientHello generated with | 
|  | 1346 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." | 
|  | 1347 | ## then manually twiddling the ciphersuite list. | 
|  | 1348 | ## The ClientHello content is spelled out below as a hex string as | 
|  | 1349 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". | 
|  | 1350 | ## The expected response is an inappropriate_fallback alert. | 
|  | 1351 | requires_openssl_with_fallback_scsv | 
|  | 1352 | run_test    "Fallback SCSV: beginning of list" \ | 
|  | 1353 | "$P_SRV debug_level=2" \ | 
|  | 1354 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1355 | 0 \ | 
|  | 1356 | -s "received FALLBACK_SCSV" \ | 
|  | 1357 | -s "inapropriate fallback" | 
|  | 1358 |  | 
|  | 1359 | requires_openssl_with_fallback_scsv | 
|  | 1360 | run_test    "Fallback SCSV: end of list" \ | 
|  | 1361 | "$P_SRV debug_level=2" \ | 
|  | 1362 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ | 
|  | 1363 | 0 \ | 
|  | 1364 | -s "received FALLBACK_SCSV" \ | 
|  | 1365 | -s "inapropriate fallback" | 
|  | 1366 |  | 
|  | 1367 | ## Here the expected response is a valid ServerHello prefix, up to the random. | 
|  | 1368 | requires_openssl_with_fallback_scsv | 
|  | 1369 | run_test    "Fallback SCSV: not in list" \ | 
|  | 1370 | "$P_SRV debug_level=2" \ | 
|  | 1371 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ | 
|  | 1372 | 0 \ | 
|  | 1373 | -S "received FALLBACK_SCSV" \ | 
|  | 1374 | -S "inapropriate fallback" | 
|  | 1375 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1376 | # Tests for CBC 1/n-1 record splitting | 
|  | 1377 |  | 
|  | 1378 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 1379 | "$P_SRV" \ | 
|  | 1380 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1381 | request_size=123 force_version=tls1_2" \ | 
|  | 1382 | 0 \ | 
|  | 1383 | -s "Read from client: 123 bytes read" \ | 
|  | 1384 | -S "Read from client: 1 bytes read" \ | 
|  | 1385 | -S "122 bytes read" | 
|  | 1386 |  | 
|  | 1387 | run_test    "CBC Record splitting: TLS 1.1, no splitting" \ | 
|  | 1388 | "$P_SRV" \ | 
|  | 1389 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1390 | request_size=123 force_version=tls1_1" \ | 
|  | 1391 | 0 \ | 
|  | 1392 | -s "Read from client: 123 bytes read" \ | 
|  | 1393 | -S "Read from client: 1 bytes read" \ | 
|  | 1394 | -S "122 bytes read" | 
|  | 1395 |  | 
|  | 1396 | run_test    "CBC Record splitting: TLS 1.0, splitting" \ | 
|  | 1397 | "$P_SRV" \ | 
|  | 1398 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1399 | request_size=123 force_version=tls1" \ | 
|  | 1400 | 0 \ | 
|  | 1401 | -S "Read from client: 123 bytes read" \ | 
|  | 1402 | -s "Read from client: 1 bytes read" \ | 
|  | 1403 | -s "122 bytes read" | 
|  | 1404 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1405 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1406 | run_test    "CBC Record splitting: SSLv3, splitting" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1407 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1408 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1409 | request_size=123 force_version=ssl3" \ | 
|  | 1410 | 0 \ | 
|  | 1411 | -S "Read from client: 123 bytes read" \ | 
|  | 1412 | -s "Read from client: 1 bytes read" \ | 
|  | 1413 | -s "122 bytes read" | 
|  | 1414 |  | 
|  | 1415 | 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] | 1416 | "$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] | 1417 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 1418 | request_size=123 force_version=tls1" \ | 
|  | 1419 | 0 \ | 
|  | 1420 | -s "Read from client: 123 bytes read" \ | 
|  | 1421 | -S "Read from client: 1 bytes read" \ | 
|  | 1422 | -S "122 bytes read" | 
|  | 1423 |  | 
|  | 1424 | run_test    "CBC Record splitting: TLS 1.0, splitting disabled" \ | 
|  | 1425 | "$P_SRV" \ | 
|  | 1426 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1427 | request_size=123 force_version=tls1 recsplit=0" \ | 
|  | 1428 | 0 \ | 
|  | 1429 | -s "Read from client: 123 bytes read" \ | 
|  | 1430 | -S "Read from client: 1 bytes read" \ | 
|  | 1431 | -S "122 bytes read" | 
|  | 1432 |  | 
| Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1433 | run_test    "CBC Record splitting: TLS 1.0, splitting, nbio" \ | 
|  | 1434 | "$P_SRV nbio=2" \ | 
|  | 1435 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 1436 | request_size=123 force_version=tls1" \ | 
|  | 1437 | 0 \ | 
|  | 1438 | -S "Read from client: 123 bytes read" \ | 
|  | 1439 | -s "Read from client: 1 bytes read" \ | 
|  | 1440 | -s "122 bytes read" | 
|  | 1441 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1442 | # Tests for Session Tickets | 
|  | 1443 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1444 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1445 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1446 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1447 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1448 | -c "client hello, adding session ticket extension" \ | 
|  | 1449 | -s "found session ticket extension" \ | 
|  | 1450 | -s "server hello, adding session ticket extension" \ | 
|  | 1451 | -c "found session_ticket extension" \ | 
|  | 1452 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1453 | -S "session successfully restored from cache" \ | 
|  | 1454 | -s "session successfully restored from ticket" \ | 
|  | 1455 | -s "a session has been resumed" \ | 
|  | 1456 | -c "a session has been resumed" | 
|  | 1457 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1458 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1459 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 1460 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1461 | 0 \ | 
|  | 1462 | -c "client hello, adding session ticket extension" \ | 
|  | 1463 | -s "found session ticket extension" \ | 
|  | 1464 | -s "server hello, adding session ticket extension" \ | 
|  | 1465 | -c "found session_ticket extension" \ | 
|  | 1466 | -c "parse new session ticket" \ | 
|  | 1467 | -S "session successfully restored from cache" \ | 
|  | 1468 | -s "session successfully restored from ticket" \ | 
|  | 1469 | -s "a session has been resumed" \ | 
|  | 1470 | -c "a session has been resumed" | 
|  | 1471 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1472 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1473 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 1474 | "$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] | 1475 | 0 \ | 
|  | 1476 | -c "client hello, adding session ticket extension" \ | 
|  | 1477 | -s "found session ticket extension" \ | 
|  | 1478 | -s "server hello, adding session ticket extension" \ | 
|  | 1479 | -c "found session_ticket extension" \ | 
|  | 1480 | -c "parse new session ticket" \ | 
|  | 1481 | -S "session successfully restored from cache" \ | 
|  | 1482 | -S "session successfully restored from ticket" \ | 
|  | 1483 | -S "a session has been resumed" \ | 
|  | 1484 | -C "a session has been resumed" | 
|  | 1485 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1486 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1487 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1488 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1489 | 0 \ | 
|  | 1490 | -c "client hello, adding session ticket extension" \ | 
|  | 1491 | -c "found session_ticket extension" \ | 
|  | 1492 | -c "parse new session ticket" \ | 
|  | 1493 | -c "a session has been resumed" | 
|  | 1494 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1495 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1496 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1497 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1498 | $O_CLI -sess_in $SESSION; \ | 
|  | 1499 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1500 | 0 \ | 
|  | 1501 | -s "found session ticket extension" \ | 
|  | 1502 | -s "server hello, adding session ticket extension" \ | 
|  | 1503 | -S "session successfully restored from cache" \ | 
|  | 1504 | -s "session successfully restored from ticket" \ | 
|  | 1505 | -s "a session has been resumed" | 
|  | 1506 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1507 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1508 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1509 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1510 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1511 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1512 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1513 | -c "client hello, adding session ticket extension" \ | 
|  | 1514 | -s "found session ticket extension" \ | 
|  | 1515 | -S "server hello, adding session ticket extension" \ | 
|  | 1516 | -C "found session_ticket extension" \ | 
|  | 1517 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1518 | -s "session successfully restored from cache" \ | 
|  | 1519 | -S "session successfully restored from ticket" \ | 
|  | 1520 | -s "a session has been resumed" \ | 
|  | 1521 | -c "a session has been resumed" | 
|  | 1522 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1523 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1524 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 1525 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1526 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1527 | -C "client hello, adding session ticket extension" \ | 
|  | 1528 | -S "found session ticket extension" \ | 
|  | 1529 | -S "server hello, adding session ticket extension" \ | 
|  | 1530 | -C "found session_ticket extension" \ | 
|  | 1531 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1532 | -s "session successfully restored from cache" \ | 
|  | 1533 | -S "session successfully restored from ticket" \ | 
|  | 1534 | -s "a session has been resumed" \ | 
|  | 1535 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1536 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1537 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1538 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 1539 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1540 | 0 \ | 
|  | 1541 | -S "session successfully restored from cache" \ | 
|  | 1542 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1543 | -S "a session has been resumed" \ | 
|  | 1544 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1545 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1546 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1547 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 1548 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1549 | 0 \ | 
|  | 1550 | -s "session successfully restored from cache" \ | 
|  | 1551 | -S "session successfully restored from ticket" \ | 
|  | 1552 | -s "a session has been resumed" \ | 
|  | 1553 | -c "a session has been resumed" | 
|  | 1554 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1555 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1556 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 1557 | "$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] | 1558 | 0 \ | 
|  | 1559 | -s "session successfully restored from cache" \ | 
|  | 1560 | -S "session successfully restored from ticket" \ | 
|  | 1561 | -s "a session has been resumed" \ | 
|  | 1562 | -c "a session has been resumed" | 
|  | 1563 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1564 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1565 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 1566 | "$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] | 1567 | 0 \ | 
|  | 1568 | -S "session successfully restored from cache" \ | 
|  | 1569 | -S "session successfully restored from ticket" \ | 
|  | 1570 | -S "a session has been resumed" \ | 
|  | 1571 | -C "a session has been resumed" | 
|  | 1572 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1573 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1574 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 1575 | "$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] | 1576 | 0 \ | 
|  | 1577 | -s "session successfully restored from cache" \ | 
|  | 1578 | -S "session successfully restored from ticket" \ | 
|  | 1579 | -s "a session has been resumed" \ | 
|  | 1580 | -c "a session has been resumed" | 
|  | 1581 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1582 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1583 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1584 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 1585 | $O_CLI -sess_in $SESSION; \ | 
|  | 1586 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1587 | 0 \ | 
|  | 1588 | -s "found session ticket extension" \ | 
|  | 1589 | -S "server hello, adding session ticket extension" \ | 
|  | 1590 | -s "session successfully restored from cache" \ | 
|  | 1591 | -S "session successfully restored from ticket" \ | 
|  | 1592 | -s "a session has been resumed" | 
|  | 1593 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1594 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1595 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1596 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1597 | 0 \ | 
|  | 1598 | -C "found session_ticket extension" \ | 
|  | 1599 | -C "parse new session ticket" \ | 
|  | 1600 | -c "a session has been resumed" | 
|  | 1601 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1602 | # Tests for Max Fragment Length extension | 
|  | 1603 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1604 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then | 
|  | 1605 | 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] | 1606 | exit 1 | 
|  | 1607 | fi | 
|  | 1608 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1609 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then | 
|  | 1610 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" | 
|  | 1611 | fi | 
|  | 1612 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1613 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1614 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1615 | "$P_SRV debug_level=3" \ | 
|  | 1616 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1617 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1618 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 1619 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1620 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1621 | -S "found max fragment length extension" \ | 
|  | 1622 | -S "server hello, max_fragment_length extension" \ | 
|  | 1623 | -C "found max_fragment_length extension" | 
|  | 1624 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1625 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1626 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 1627 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1628 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1629 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1630 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 1631 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1632 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1633 | -S "found max fragment length extension" \ | 
|  | 1634 | -S "server hello, max_fragment_length extension" \ | 
|  | 1635 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1636 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 1637 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1638 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1639 |  | 
|  | 1640 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1641 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 1642 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1643 | "$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] | 1644 | 1 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1645 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
|  | 1646 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1647 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1648 | -S "found max fragment length extension" \ | 
|  | 1649 | -S "server hello, max_fragment_length extension" \ | 
|  | 1650 | -C "found max_fragment_length extension" \ | 
|  | 1651 | -c "fragment larger than.*maximum " | 
|  | 1652 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1653 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 1654 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 1655 | # content length configuration.) | 
|  | 1656 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1657 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1658 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 1659 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1660 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1661 | 0 \ | 
|  | 1662 | -C "Maximum fragment length is 16384" \ | 
|  | 1663 | -S "Maximum fragment length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1664 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 1665 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1666 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1667 |  | 
|  | 1668 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 1669 | run_test    "Max fragment length DTLS: disabled, larger message" \ | 
|  | 1670 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1671 | "$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] | 1672 | 1 \ | 
|  | 1673 | -C "Maximum fragment length is 16384" \ | 
|  | 1674 | -S "Maximum fragment length is 16384" \ | 
|  | 1675 | -c "fragment larger than.*maximum " | 
|  | 1676 |  | 
|  | 1677 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1678 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1679 | "$P_SRV debug_level=3" \ | 
|  | 1680 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1681 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1682 | -c "Maximum fragment length is 4096" \ | 
|  | 1683 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1684 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1685 | -s "found max fragment length extension" \ | 
|  | 1686 | -s "server hello, max_fragment_length extension" \ | 
|  | 1687 | -c "found max_fragment_length extension" | 
|  | 1688 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1689 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1690 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1691 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 1692 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1693 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1694 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1695 | -s "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1696 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 1697 | -S "found max fragment length extension" \ | 
|  | 1698 | -S "server hello, max_fragment_length extension" \ | 
|  | 1699 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1700 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1701 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1702 | requires_gnutls | 
|  | 1703 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1704 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1705 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1706 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1707 | -c "Maximum fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1708 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1709 | -c "found max_fragment_length extension" | 
|  | 1710 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1711 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1712 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 1713 | "$P_SRV debug_level=3" \ | 
|  | 1714 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 1715 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1716 | -c "Maximum fragment length is 2048" \ | 
|  | 1717 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1718 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1719 | -s "found max fragment length extension" \ | 
|  | 1720 | -s "server hello, max_fragment_length extension" \ | 
|  | 1721 | -c "found max_fragment_length extension" \ | 
|  | 1722 | -c "2048 bytes written in 1 fragments" \ | 
|  | 1723 | -s "2048 bytes read" | 
|  | 1724 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1725 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1726 | run_test    "Max fragment length: client, larger message" \ | 
|  | 1727 | "$P_SRV debug_level=3" \ | 
|  | 1728 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 1729 | 0 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1730 | -c "Maximum fragment length is 2048" \ | 
|  | 1731 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1732 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1733 | -s "found max fragment length extension" \ | 
|  | 1734 | -s "server hello, max_fragment_length extension" \ | 
|  | 1735 | -c "found max_fragment_length extension" \ | 
|  | 1736 | -c "2345 bytes written in 2 fragments" \ | 
|  | 1737 | -s "2048 bytes read" \ | 
|  | 1738 | -s "297 bytes read" | 
|  | 1739 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 1741 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1742 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 1743 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 1744 | 1 \ | 
| Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1745 | -c "Maximum fragment length is 2048" \ | 
|  | 1746 | -s "Maximum fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1747 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 1748 | -s "found max fragment length extension" \ | 
|  | 1749 | -s "server hello, max_fragment_length extension" \ | 
|  | 1750 | -c "found max_fragment_length extension" \ | 
|  | 1751 | -c "fragment larger than.*maximum" | 
|  | 1752 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1753 | # Tests for renegotiation | 
|  | 1754 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1755 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1756 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1757 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1758 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1759 | 0 \ | 
|  | 1760 | -C "client hello, adding renegotiation extension" \ | 
|  | 1761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1762 | -S "found renegotiation extension" \ | 
|  | 1763 | -s "server hello, secure renegotiation extension" \ | 
|  | 1764 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1765 | -C "=> renegotiate" \ | 
|  | 1766 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1767 | -S "write hello request" | 
|  | 1768 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1770 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1771 | "$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] | 1772 | "$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] | 1773 | 0 \ | 
|  | 1774 | -c "client hello, adding renegotiation extension" \ | 
|  | 1775 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1776 | -s "found renegotiation extension" \ | 
|  | 1777 | -s "server hello, secure renegotiation extension" \ | 
|  | 1778 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1779 | -c "=> renegotiate" \ | 
|  | 1780 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1781 | -S "write hello request" | 
|  | 1782 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1783 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1784 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1785 | "$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] | 1786 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1787 | 0 \ | 
|  | 1788 | -c "client hello, adding renegotiation extension" \ | 
|  | 1789 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1790 | -s "found renegotiation extension" \ | 
|  | 1791 | -s "server hello, secure renegotiation extension" \ | 
|  | 1792 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1793 | -c "=> renegotiate" \ | 
|  | 1794 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1795 | -s "write hello request" | 
|  | 1796 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1797 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 1798 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 1799 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1801 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 1802 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 1803 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 1804 | 0 \ | 
|  | 1805 | -c "client hello, adding renegotiation extension" \ | 
|  | 1806 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1807 | -s "found renegotiation extension" \ | 
|  | 1808 | -s "server hello, secure renegotiation extension" \ | 
|  | 1809 | -c "found renegotiation extension" \ | 
|  | 1810 | -c "=> renegotiate" \ | 
|  | 1811 | -s "=> renegotiate" \ | 
|  | 1812 | -S "write hello request" \ | 
|  | 1813 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 1814 |  | 
|  | 1815 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 1816 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 1817 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 1819 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 1820 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 1821 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 1822 | 0 \ | 
|  | 1823 | -c "client hello, adding renegotiation extension" \ | 
|  | 1824 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1825 | -s "found renegotiation extension" \ | 
|  | 1826 | -s "server hello, secure renegotiation extension" \ | 
|  | 1827 | -c "found renegotiation extension" \ | 
|  | 1828 | -c "=> renegotiate" \ | 
|  | 1829 | -s "=> renegotiate" \ | 
|  | 1830 | -s "write hello request" \ | 
|  | 1831 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 1832 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1833 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1834 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1835 | "$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] | 1836 | "$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] | 1837 | 0 \ | 
|  | 1838 | -c "client hello, adding renegotiation extension" \ | 
|  | 1839 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1840 | -s "found renegotiation extension" \ | 
|  | 1841 | -s "server hello, secure renegotiation extension" \ | 
|  | 1842 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1843 | -c "=> renegotiate" \ | 
|  | 1844 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1845 | -s "write hello request" | 
|  | 1846 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1848 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1849 | "$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] | 1850 | "$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] | 1851 | 1 \ | 
|  | 1852 | -c "client hello, adding renegotiation extension" \ | 
|  | 1853 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1854 | -S "found renegotiation extension" \ | 
|  | 1855 | -s "server hello, secure renegotiation extension" \ | 
|  | 1856 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1857 | -c "=> renegotiate" \ | 
|  | 1858 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1859 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 1860 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1861 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1862 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1863 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1864 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1865 | "$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] | 1866 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1867 | 0 \ | 
|  | 1868 | -C "client hello, adding renegotiation extension" \ | 
|  | 1869 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1870 | -S "found renegotiation extension" \ | 
|  | 1871 | -s "server hello, secure renegotiation extension" \ | 
|  | 1872 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1873 | -C "=> renegotiate" \ | 
|  | 1874 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1875 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 1876 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1877 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1878 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1880 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1881 | "$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] | 1882 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1883 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1884 | 0 \ | 
|  | 1885 | -C "client hello, adding renegotiation extension" \ | 
|  | 1886 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1887 | -S "found renegotiation extension" \ | 
|  | 1888 | -s "server hello, secure renegotiation extension" \ | 
|  | 1889 | -c "found renegotiation extension" \ | 
|  | 1890 | -C "=> renegotiate" \ | 
|  | 1891 | -S "=> renegotiate" \ | 
|  | 1892 | -s "write hello request" \ | 
|  | 1893 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1894 | -S "failed" | 
|  | 1895 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1896 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1897 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1898 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1899 | "$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] | 1900 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1901 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1902 | 0 \ | 
|  | 1903 | -C "client hello, adding renegotiation extension" \ | 
|  | 1904 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1905 | -S "found renegotiation extension" \ | 
|  | 1906 | -s "server hello, secure renegotiation extension" \ | 
|  | 1907 | -c "found renegotiation extension" \ | 
|  | 1908 | -C "=> renegotiate" \ | 
|  | 1909 | -S "=> renegotiate" \ | 
|  | 1910 | -s "write hello request" \ | 
|  | 1911 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1912 | -S "failed" | 
|  | 1913 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1914 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1915 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1916 | "$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] | 1917 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1918 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1919 | 0 \ | 
|  | 1920 | -C "client hello, adding renegotiation extension" \ | 
|  | 1921 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1922 | -S "found renegotiation extension" \ | 
|  | 1923 | -s "server hello, secure renegotiation extension" \ | 
|  | 1924 | -c "found renegotiation extension" \ | 
|  | 1925 | -C "=> renegotiate" \ | 
|  | 1926 | -S "=> renegotiate" \ | 
|  | 1927 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 1928 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1929 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1931 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1932 | "$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] | 1933 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1934 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 1935 | 0 \ | 
|  | 1936 | -c "client hello, adding renegotiation extension" \ | 
|  | 1937 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1938 | -s "found renegotiation extension" \ | 
|  | 1939 | -s "server hello, secure renegotiation extension" \ | 
|  | 1940 | -c "found renegotiation extension" \ | 
|  | 1941 | -c "=> renegotiate" \ | 
|  | 1942 | -s "=> renegotiate" \ | 
|  | 1943 | -s "write hello request" \ | 
|  | 1944 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1945 | -S "failed" | 
|  | 1946 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1947 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1948 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1949 | "$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] | 1950 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 1951 | 0 \ | 
|  | 1952 | -C "client hello, adding renegotiation extension" \ | 
|  | 1953 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1954 | -S "found renegotiation extension" \ | 
|  | 1955 | -s "server hello, secure renegotiation extension" \ | 
|  | 1956 | -c "found renegotiation extension" \ | 
|  | 1957 | -S "record counter limit reached: renegotiate" \ | 
|  | 1958 | -C "=> renegotiate" \ | 
|  | 1959 | -S "=> renegotiate" \ | 
|  | 1960 | -S "write hello request" \ | 
|  | 1961 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1962 | -S "failed" | 
|  | 1963 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 1964 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1966 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1967 | "$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] | 1968 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1969 | 0 \ | 
|  | 1970 | -c "client hello, adding renegotiation extension" \ | 
|  | 1971 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1972 | -s "found renegotiation extension" \ | 
|  | 1973 | -s "server hello, secure renegotiation extension" \ | 
|  | 1974 | -c "found renegotiation extension" \ | 
|  | 1975 | -s "record counter limit reached: renegotiate" \ | 
|  | 1976 | -c "=> renegotiate" \ | 
|  | 1977 | -s "=> renegotiate" \ | 
|  | 1978 | -s "write hello request" \ | 
|  | 1979 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1980 | -S "failed" | 
|  | 1981 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1982 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1983 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 1984 | "$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] | 1985 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 1986 | 0 \ | 
|  | 1987 | -c "client hello, adding renegotiation extension" \ | 
|  | 1988 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 1989 | -s "found renegotiation extension" \ | 
|  | 1990 | -s "server hello, secure renegotiation extension" \ | 
|  | 1991 | -c "found renegotiation extension" \ | 
|  | 1992 | -s "record counter limit reached: renegotiate" \ | 
|  | 1993 | -c "=> renegotiate" \ | 
|  | 1994 | -s "=> renegotiate" \ | 
|  | 1995 | -s "write hello request" \ | 
|  | 1996 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 1997 | -S "failed" | 
|  | 1998 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 1999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2000 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2001 | "$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] | 2002 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 2003 | 0 \ | 
|  | 2004 | -C "client hello, adding renegotiation extension" \ | 
|  | 2005 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2006 | -S "found renegotiation extension" \ | 
|  | 2007 | -s "server hello, secure renegotiation extension" \ | 
|  | 2008 | -c "found renegotiation extension" \ | 
|  | 2009 | -S "record counter limit reached: renegotiate" \ | 
|  | 2010 | -C "=> renegotiate" \ | 
|  | 2011 | -S "=> renegotiate" \ | 
|  | 2012 | -S "write hello request" \ | 
|  | 2013 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 2014 | -S "failed" | 
|  | 2015 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2017 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2018 | "$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] | 2019 | "$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] | 2020 | 0 \ | 
|  | 2021 | -c "client hello, adding renegotiation extension" \ | 
|  | 2022 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2023 | -s "found renegotiation extension" \ | 
|  | 2024 | -s "server hello, secure renegotiation extension" \ | 
|  | 2025 | -c "found renegotiation extension" \ | 
|  | 2026 | -c "=> renegotiate" \ | 
|  | 2027 | -s "=> renegotiate" \ | 
|  | 2028 | -S "write hello request" | 
|  | 2029 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2031 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2032 | "$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] | 2033 | "$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] | 2034 | 0 \ | 
|  | 2035 | -c "client hello, adding renegotiation extension" \ | 
|  | 2036 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2037 | -s "found renegotiation extension" \ | 
|  | 2038 | -s "server hello, secure renegotiation extension" \ | 
|  | 2039 | -c "found renegotiation extension" \ | 
|  | 2040 | -c "=> renegotiate" \ | 
|  | 2041 | -s "=> renegotiate" \ | 
|  | 2042 | -s "write hello request" | 
|  | 2043 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2045 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2046 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2047 | "$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] | 2048 | 0 \ | 
|  | 2049 | -c "client hello, adding renegotiation extension" \ | 
|  | 2050 | -c "found renegotiation extension" \ | 
|  | 2051 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2052 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2053 | -C "error" \ | 
|  | 2054 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2055 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2056 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2057 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2058 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 2059 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2060 | "$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] | 2061 | 0 \ | 
|  | 2062 | -c "client hello, adding renegotiation extension" \ | 
|  | 2063 | -c "found renegotiation extension" \ | 
|  | 2064 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2065 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2066 | -C "error" \ | 
|  | 2067 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2068 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2069 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2070 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2071 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 2072 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2073 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 2074 | 1 \ | 
|  | 2075 | -c "client hello, adding renegotiation extension" \ | 
|  | 2076 | -C "found renegotiation extension" \ | 
|  | 2077 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2078 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2079 | -c "error" \ | 
|  | 2080 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2081 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2082 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2083 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2084 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 2085 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2086 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 2087 | allow_legacy=0" \ | 
|  | 2088 | 1 \ | 
|  | 2089 | -c "client hello, adding renegotiation extension" \ | 
|  | 2090 | -C "found renegotiation extension" \ | 
|  | 2091 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2092 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2093 | -c "error" \ | 
|  | 2094 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2095 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2096 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2097 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2098 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 2099 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2100 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 2101 | allow_legacy=1" \ | 
|  | 2102 | 0 \ | 
|  | 2103 | -c "client hello, adding renegotiation extension" \ | 
|  | 2104 | -C "found renegotiation extension" \ | 
|  | 2105 | -c "=> renegotiate" \ | 
|  | 2106 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2107 | -C "error" \ | 
|  | 2108 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2109 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2111 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 2112 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 2113 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 2114 | 0 \ | 
|  | 2115 | -c "client hello, adding renegotiation extension" \ | 
|  | 2116 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2117 | -s "found renegotiation extension" \ | 
|  | 2118 | -s "server hello, secure renegotiation extension" \ | 
|  | 2119 | -c "found renegotiation extension" \ | 
|  | 2120 | -c "=> renegotiate" \ | 
|  | 2121 | -s "=> renegotiate" \ | 
|  | 2122 | -S "write hello request" | 
|  | 2123 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2124 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2125 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 2126 | "$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] | 2127 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 2128 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2129 | 0 \ | 
|  | 2130 | -c "client hello, adding renegotiation extension" \ | 
|  | 2131 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2132 | -s "found renegotiation extension" \ | 
|  | 2133 | -s "server hello, secure renegotiation extension" \ | 
|  | 2134 | -c "found renegotiation extension" \ | 
|  | 2135 | -c "=> renegotiate" \ | 
|  | 2136 | -s "=> renegotiate" \ | 
|  | 2137 | -s "write hello request" | 
|  | 2138 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2140 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 2141 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 2142 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 2143 | 0 \ | 
|  | 2144 | -c "client hello, adding renegotiation extension" \ | 
|  | 2145 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 2146 | -s "found renegotiation extension" \ | 
|  | 2147 | -s "server hello, secure renegotiation extension" \ | 
|  | 2148 | -s "record counter limit reached: renegotiate" \ | 
|  | 2149 | -c "=> renegotiate" \ | 
|  | 2150 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2151 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2152 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2153 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2154 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2155 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 2156 | "$G_SRV -u --mtu 4096" \ | 
|  | 2157 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 2158 | 0 \ | 
|  | 2159 | -c "client hello, adding renegotiation extension" \ | 
|  | 2160 | -c "found renegotiation extension" \ | 
|  | 2161 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2162 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2163 | -C "error" \ | 
|  | 2164 | -s "Extra-header:" | 
|  | 2165 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2166 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 2167 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2168 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2169 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 2170 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 2171 | "$P_CLI debug_level=3" \ | 
|  | 2172 | 0 \ | 
|  | 2173 | -c "found renegotiation extension" \ | 
|  | 2174 | -C "error" \ | 
|  | 2175 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2176 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2177 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2178 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 2179 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2180 | "$P_CLI debug_level=3" \ | 
|  | 2181 | 0 \ | 
|  | 2182 | -C "found renegotiation extension" \ | 
|  | 2183 | -C "error" \ | 
|  | 2184 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2185 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2186 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2187 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 2188 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 2189 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 2190 | 1 \ | 
|  | 2191 | -C "found renegotiation extension" \ | 
|  | 2192 | -c "error" \ | 
|  | 2193 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 2194 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2195 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2196 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 2197 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2198 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2199 | 0 \ | 
|  | 2200 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2201 | -s "server hello, secure renegotiation extension" | 
|  | 2202 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2203 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2204 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 2205 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2206 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2207 | 0 \ | 
|  | 2208 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2209 | -S "server hello, secure renegotiation extension" | 
|  | 2210 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2211 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2212 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 2213 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2214 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2215 | 1 \ | 
|  | 2216 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 2217 | -S "server hello, secure renegotiation extension" | 
|  | 2218 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2219 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 2220 |  | 
|  | 2221 | requires_gnutls | 
|  | 2222 | run_test    "DER format: no trailing bytes" \ | 
|  | 2223 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 2224 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2225 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2226 | 0 \ | 
|  | 2227 | -c "Handshake was completed" \ | 
|  | 2228 |  | 
|  | 2229 | requires_gnutls | 
|  | 2230 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 2231 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 2232 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2233 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2234 | 0 \ | 
|  | 2235 | -c "Handshake was completed" \ | 
|  | 2236 |  | 
|  | 2237 | requires_gnutls | 
|  | 2238 | run_test    "DER format: with a trailing random byte" \ | 
|  | 2239 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 2240 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2241 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2242 | 0 \ | 
|  | 2243 | -c "Handshake was completed" \ | 
|  | 2244 |  | 
|  | 2245 | requires_gnutls | 
|  | 2246 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 2247 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 2248 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2249 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2250 | 0 \ | 
|  | 2251 | -c "Handshake was completed" \ | 
|  | 2252 |  | 
|  | 2253 | requires_gnutls | 
|  | 2254 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 2255 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 2256 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2257 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2258 | 0 \ | 
|  | 2259 | -c "Handshake was completed" \ | 
|  | 2260 |  | 
|  | 2261 | requires_gnutls | 
|  | 2262 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 2263 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 2264 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2265 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2266 | 0 \ | 
|  | 2267 | -c "Handshake was completed" \ | 
|  | 2268 |  | 
|  | 2269 | requires_gnutls | 
|  | 2270 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 2271 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 2272 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2273 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2274 | 0 \ | 
|  | 2275 | -c "Handshake was completed" \ | 
|  | 2276 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2277 | # Tests for auth_mode | 
|  | 2278 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2279 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2280 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 2281 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2282 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2283 | 1 \ | 
|  | 2284 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2285 | -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] | 2286 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2287 | -c "X509 - Certificate verification failed" | 
|  | 2288 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2289 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2290 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 2291 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2292 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2293 | 0 \ | 
|  | 2294 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2295 | -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] | 2296 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2297 | -C "X509 - Certificate verification failed" | 
|  | 2298 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2299 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 2300 | "$P_SRV" \ | 
|  | 2301 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 2302 | 0 \ | 
|  | 2303 | -c "x509_verify_cert() returned" \ | 
|  | 2304 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2305 | -c "! Certificate verification flags"\ | 
|  | 2306 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 2307 | -C "X509 - Certificate verification failed" \ | 
|  | 2308 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 2309 |  | 
|  | 2310 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 2311 | "$P_SRV" \ | 
|  | 2312 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 2313 | 1 \ | 
|  | 2314 | -c "x509_verify_cert() returned" \ | 
|  | 2315 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2316 | -c "! Certificate verification flags"\ | 
|  | 2317 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2318 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 2319 |  | 
|  | 2320 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 2321 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 2322 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 2323 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 2324 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 2325 | # different means to have the server ignoring the client's supported curve list. | 
|  | 2326 |  | 
|  | 2327 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 2328 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 2329 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 2330 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 2331 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 2332 | 1 \ | 
|  | 2333 | -c "bad certificate (EC key curve)"\ | 
|  | 2334 | -c "! Certificate verification flags"\ | 
|  | 2335 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 2336 |  | 
|  | 2337 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 2338 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 2339 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 2340 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 2341 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 2342 | 1 \ | 
|  | 2343 | -c "bad certificate (EC key curve)"\ | 
|  | 2344 | -c "! Certificate verification flags"\ | 
|  | 2345 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 2346 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2347 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2348 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2349 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2350 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2351 | 0 \ | 
|  | 2352 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2353 | -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] | 2354 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2355 | -C "X509 - Certificate verification failed" | 
|  | 2356 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2357 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 2358 | "$P_SRV auth_mode=required" \ | 
|  | 2359 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 2360 | key_file=data_files/server6.key \ | 
|  | 2361 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 2362 | 0 \ | 
|  | 2363 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 2364 | -c "Supported Signature Algorithm found: 5," | 
|  | 2365 |  | 
|  | 2366 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 2367 | "$P_SRV auth_mode=required" \ | 
|  | 2368 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 2369 | key_file=data_files/server6.key \ | 
|  | 2370 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2371 | 0 \ | 
|  | 2372 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 2373 | -c "Supported Signature Algorithm found: 5," | 
|  | 2374 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 2376 | run_test    "Authentication: client has no cert, server required (SSLv3)" \ | 
|  | 2377 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ | 
|  | 2378 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ | 
|  | 2379 | key_file=data_files/server5.key" \ | 
|  | 2380 | 1 \ | 
|  | 2381 | -S "skip write certificate request" \ | 
|  | 2382 | -C "skip parse certificate request" \ | 
|  | 2383 | -c "got a certificate request" \ | 
|  | 2384 | -c "got no certificate to send" \ | 
|  | 2385 | -S "x509_verify_cert() returned" \ | 
|  | 2386 | -s "client has no certificate" \ | 
|  | 2387 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2388 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2389 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 2390 |  | 
|  | 2391 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 2392 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2393 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 2394 | key_file=data_files/server5.key" \ | 
|  | 2395 | 1 \ | 
|  | 2396 | -S "skip write certificate request" \ | 
|  | 2397 | -C "skip parse certificate request" \ | 
|  | 2398 | -c "got a certificate request" \ | 
|  | 2399 | -c "= write certificate$" \ | 
|  | 2400 | -C "skip write certificate$" \ | 
|  | 2401 | -S "x509_verify_cert() returned" \ | 
|  | 2402 | -s "client has no certificate" \ | 
|  | 2403 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2404 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2405 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 2406 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2407 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2408 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2409 | "$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] | 2410 | key_file=data_files/server5.key" \ | 
|  | 2411 | 1 \ | 
|  | 2412 | -S "skip write certificate request" \ | 
|  | 2413 | -C "skip parse certificate request" \ | 
|  | 2414 | -c "got a certificate request" \ | 
|  | 2415 | -C "skip write certificate" \ | 
|  | 2416 | -C "skip write certificate verify" \ | 
|  | 2417 | -S "skip parse certificate verify" \ | 
|  | 2418 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2419 | -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] | 2420 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2421 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2422 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2423 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2424 | # We don't check that the client receives the alert because it might | 
|  | 2425 | # detect that its write end of the connection is closed and abort | 
|  | 2426 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2427 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2428 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 2429 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2430 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 2431 | key_file=data_files/server5.key" \ | 
|  | 2432 | 1 \ | 
|  | 2433 | -S "skip write certificate request" \ | 
|  | 2434 | -C "skip parse certificate request" \ | 
|  | 2435 | -c "got a certificate request" \ | 
|  | 2436 | -C "skip write certificate" \ | 
|  | 2437 | -C "skip write certificate verify" \ | 
|  | 2438 | -S "skip parse certificate verify" \ | 
|  | 2439 | -s "x509_verify_cert() returned" \ | 
|  | 2440 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2441 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2442 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2443 | -s "X509 - Certificate verification failed" | 
|  | 2444 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2445 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2446 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2447 | "$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] | 2448 | key_file=data_files/server5.key" \ | 
|  | 2449 | 0 \ | 
|  | 2450 | -S "skip write certificate request" \ | 
|  | 2451 | -C "skip parse certificate request" \ | 
|  | 2452 | -c "got a certificate request" \ | 
|  | 2453 | -C "skip write certificate" \ | 
|  | 2454 | -C "skip write certificate verify" \ | 
|  | 2455 | -S "skip parse certificate verify" \ | 
|  | 2456 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2457 | -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] | 2458 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2459 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2460 | -S "X509 - Certificate verification failed" | 
|  | 2461 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2462 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2463 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 2464 | "$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] | 2465 | key_file=data_files/server5.key" \ | 
|  | 2466 | 0 \ | 
|  | 2467 | -s "skip write certificate request" \ | 
|  | 2468 | -C "skip parse certificate request" \ | 
|  | 2469 | -c "got no certificate request" \ | 
|  | 2470 | -c "skip write certificate" \ | 
|  | 2471 | -c "skip write certificate verify" \ | 
|  | 2472 | -s "skip parse certificate verify" \ | 
|  | 2473 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2474 | -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] | 2475 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2476 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2477 | -S "X509 - Certificate verification failed" | 
|  | 2478 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2479 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2480 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 2481 | "$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] | 2482 | 0 \ | 
|  | 2483 | -S "skip write certificate request" \ | 
|  | 2484 | -C "skip parse certificate request" \ | 
|  | 2485 | -c "got a certificate request" \ | 
|  | 2486 | -C "skip write certificate$" \ | 
|  | 2487 | -C "got no certificate to send" \ | 
|  | 2488 | -S "SSLv3 client has no certificate" \ | 
|  | 2489 | -c "skip write certificate verify" \ | 
|  | 2490 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2491 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2492 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2493 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2494 | -S "X509 - Certificate verification failed" | 
|  | 2495 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2496 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2497 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2498 | "$O_CLI" \ | 
|  | 2499 | 0 \ | 
|  | 2500 | -S "skip write certificate request" \ | 
|  | 2501 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2502 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2503 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2504 | -S "X509 - Certificate verification failed" | 
|  | 2505 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2506 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2507 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2508 | "$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] | 2509 | 0 \ | 
|  | 2510 | -C "skip parse certificate request" \ | 
|  | 2511 | -c "got a certificate request" \ | 
|  | 2512 | -C "skip write certificate$" \ | 
|  | 2513 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2514 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2515 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2516 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 2517 | "$O_SRV -Verify 10" \ | 
|  | 2518 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 2519 | 1 \ | 
|  | 2520 | -C "skip parse certificate request" \ | 
|  | 2521 | -c "got a certificate request" \ | 
|  | 2522 | -C "skip write certificate$" \ | 
|  | 2523 | -c "skip write certificate verify" \ | 
|  | 2524 | -c "! mbedtls_ssl_handshake returned" | 
|  | 2525 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2527 | run_test    "Authentication: client no cert, ssl3" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2528 | "$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] | 2529 | "$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] | 2530 | 0 \ | 
|  | 2531 | -S "skip write certificate request" \ | 
|  | 2532 | -C "skip parse certificate request" \ | 
|  | 2533 | -c "got a certificate request" \ | 
|  | 2534 | -C "skip write certificate$" \ | 
|  | 2535 | -c "skip write certificate verify" \ | 
|  | 2536 | -c "got no certificate to send" \ | 
|  | 2537 | -s "SSLv3 client has no certificate" \ | 
|  | 2538 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2539 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2540 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 2541 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2542 | -S "X509 - Certificate verification failed" | 
|  | 2543 |  | 
| Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2544 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its | 
|  | 2545 | # default value (8) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2546 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2547 | MAX_IM_CA='8' | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2548 | MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2549 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2550 | 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] | 2551 | 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] | 2552 | 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] | 2553 | printf "test value of ${MAX_IM_CA}. \n" | 
|  | 2554 | printf "\n" | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2555 | printf "The tests assume this value and if it changes, the tests in this\n" | 
|  | 2556 | printf "script should also be adjusted.\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2557 | printf "\n" | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2558 |  | 
|  | 2559 | exit 1 | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2560 | fi | 
|  | 2561 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2562 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2563 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 2564 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2565 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2566 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2567 | 0 \ | 
|  | 2568 | -C "X509 - A fatal error occured" | 
|  | 2569 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2570 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2571 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 2572 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2573 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2574 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2575 | 1 \ | 
|  | 2576 | -c "X509 - A fatal error occured" | 
|  | 2577 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2578 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2579 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 2580 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2581 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2582 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2583 | auth_mode=optional" \ | 
|  | 2584 | 1 \ | 
|  | 2585 | -c "X509 - A fatal error occured" | 
|  | 2586 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2587 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2588 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 2589 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2590 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2591 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 2592 | auth_mode=none" \ | 
|  | 2593 | 0 \ | 
|  | 2594 | -C "X509 - A fatal error occured" | 
|  | 2595 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2596 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2597 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 2598 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 2599 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2600 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2601 | 0 \ | 
|  | 2602 | -S "X509 - A fatal error occured" | 
|  | 2603 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2604 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2605 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 2606 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 2607 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2608 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2609 | 1 \ | 
|  | 2610 | -s "X509 - A fatal error occured" | 
|  | 2611 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2612 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2613 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 2614 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2615 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 2616 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 2617 | 1 \ | 
|  | 2618 | -s "X509 - A fatal error occured" | 
|  | 2619 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2620 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2621 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 2622 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 2623 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 2624 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 2625 | 0 \ | 
|  | 2626 | -S "X509 - A fatal error occured" | 
|  | 2627 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2628 | # Tests for CA list in CertificateRequest messages | 
|  | 2629 |  | 
|  | 2630 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 2631 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 2632 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2633 | key_file=data_files/server6.key" \ | 
|  | 2634 | 0 \ | 
|  | 2635 | -s "requested DN" | 
|  | 2636 |  | 
|  | 2637 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 2638 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2639 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 2640 | key_file=data_files/server6.key" \ | 
|  | 2641 | 0 \ | 
|  | 2642 | -S "requested DN" | 
|  | 2643 |  | 
|  | 2644 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 2645 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 2646 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 2647 | key_file=data_files/server5.key" \ | 
|  | 2648 | 1 \ | 
|  | 2649 | -S "requested DN" \ | 
|  | 2650 | -s "x509_verify_cert() returned" \ | 
|  | 2651 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2652 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 2653 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 2654 | -s "X509 - Certificate verification failed" | 
|  | 2655 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2656 | # Tests for certificate selection based on SHA verson | 
|  | 2657 |  | 
|  | 2658 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 2659 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2660 | key_file=data_files/server5.key \ | 
|  | 2661 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2662 | key_file2=data_files/server5.key" \ | 
|  | 2663 | "$P_CLI force_version=tls1_2" \ | 
|  | 2664 | 0 \ | 
|  | 2665 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2666 | -C "signed using.*ECDSA with SHA1" | 
|  | 2667 |  | 
|  | 2668 | run_test    "Certificate hash: client TLS 1.1 -> SHA-1" \ | 
|  | 2669 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2670 | key_file=data_files/server5.key \ | 
|  | 2671 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2672 | key_file2=data_files/server5.key" \ | 
|  | 2673 | "$P_CLI force_version=tls1_1" \ | 
|  | 2674 | 0 \ | 
|  | 2675 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2676 | -c "signed using.*ECDSA with SHA1" | 
|  | 2677 |  | 
|  | 2678 | run_test    "Certificate hash: client TLS 1.0 -> SHA-1" \ | 
|  | 2679 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2680 | key_file=data_files/server5.key \ | 
|  | 2681 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 2682 | key_file2=data_files/server5.key" \ | 
|  | 2683 | "$P_CLI force_version=tls1" \ | 
|  | 2684 | 0 \ | 
|  | 2685 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 2686 | -c "signed using.*ECDSA with SHA1" | 
|  | 2687 |  | 
|  | 2688 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ | 
|  | 2689 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 2690 | key_file=data_files/server5.key \ | 
|  | 2691 | crt_file2=data_files/server6.crt \ | 
|  | 2692 | key_file2=data_files/server6.key" \ | 
|  | 2693 | "$P_CLI force_version=tls1_1" \ | 
|  | 2694 | 0 \ | 
|  | 2695 | -c "serial number.*09" \ | 
|  | 2696 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2697 | -C "signed using.*ECDSA with SHA1" | 
|  | 2698 |  | 
|  | 2699 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ | 
|  | 2700 | "$P_SRV crt_file=data_files/server6.crt \ | 
|  | 2701 | key_file=data_files/server6.key \ | 
|  | 2702 | crt_file2=data_files/server5.crt \ | 
|  | 2703 | key_file2=data_files/server5.key" \ | 
|  | 2704 | "$P_CLI force_version=tls1_1" \ | 
|  | 2705 | 0 \ | 
|  | 2706 | -c "serial number.*0A" \ | 
|  | 2707 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 2708 | -C "signed using.*ECDSA with SHA1" | 
|  | 2709 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2710 | # tests for SNI | 
|  | 2711 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2712 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2713 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2714 | 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] | 2715 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2716 | 0 \ | 
|  | 2717 | -S "parse ServerName extension" \ | 
|  | 2718 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 2719 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2720 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2721 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2722 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2723 | 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] | 2724 | 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] | 2725 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2726 | 0 \ | 
|  | 2727 | -s "parse ServerName extension" \ | 
|  | 2728 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2729 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2730 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2731 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2732 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2733 | 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] | 2734 | 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] | 2735 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2736 | 0 \ | 
|  | 2737 | -s "parse ServerName extension" \ | 
|  | 2738 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2739 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2740 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2741 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2742 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2743 | 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] | 2744 | 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] | 2745 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2746 | 1 \ | 
|  | 2747 | -s "parse ServerName extension" \ | 
|  | 2748 | -s "ssl_sni_wrapper() returned" \ | 
|  | 2749 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2750 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 2751 | -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] | 2752 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2753 | run_test    "SNI: client auth no override: optional" \ | 
|  | 2754 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2755 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2756 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 2757 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2758 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2759 | -S "skip write certificate request" \ | 
|  | 2760 | -C "skip parse certificate request" \ | 
|  | 2761 | -c "got a certificate request" \ | 
|  | 2762 | -C "skip write certificate" \ | 
|  | 2763 | -C "skip write certificate verify" \ | 
|  | 2764 | -S "skip parse certificate verify" | 
|  | 2765 |  | 
|  | 2766 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 2767 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 2768 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2769 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 2770 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2771 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2772 | -S "skip write certificate request" \ | 
|  | 2773 | -C "skip parse certificate request" \ | 
|  | 2774 | -c "got a certificate request" \ | 
|  | 2775 | -C "skip write certificate" \ | 
|  | 2776 | -C "skip write certificate verify" \ | 
|  | 2777 | -S "skip parse certificate verify" | 
|  | 2778 |  | 
|  | 2779 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 2780 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2781 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2782 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 2783 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2784 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 2785 | -s "skip write certificate request" \ | 
|  | 2786 | -C "skip parse certificate request" \ | 
|  | 2787 | -c "got no certificate request" \ | 
|  | 2788 | -c "skip write certificate" \ | 
|  | 2789 | -c "skip write certificate verify" \ | 
|  | 2790 | -s "skip parse certificate verify" | 
|  | 2791 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2792 | run_test    "SNI: CA no override" \ | 
|  | 2793 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2794 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2795 | ca_file=data_files/test-ca.crt \ | 
|  | 2796 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 2797 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2798 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2799 | 1 \ | 
|  | 2800 | -S "skip write certificate request" \ | 
|  | 2801 | -C "skip parse certificate request" \ | 
|  | 2802 | -c "got a certificate request" \ | 
|  | 2803 | -C "skip write certificate" \ | 
|  | 2804 | -C "skip write certificate verify" \ | 
|  | 2805 | -S "skip parse certificate verify" \ | 
|  | 2806 | -s "x509_verify_cert() returned" \ | 
|  | 2807 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2808 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2809 |  | 
|  | 2810 | run_test    "SNI: CA override" \ | 
|  | 2811 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2812 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2813 | ca_file=data_files/test-ca.crt \ | 
|  | 2814 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 2815 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2816 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2817 | 0 \ | 
|  | 2818 | -S "skip write certificate request" \ | 
|  | 2819 | -C "skip parse certificate request" \ | 
|  | 2820 | -c "got a certificate request" \ | 
|  | 2821 | -C "skip write certificate" \ | 
|  | 2822 | -C "skip write certificate verify" \ | 
|  | 2823 | -S "skip parse certificate verify" \ | 
|  | 2824 | -S "x509_verify_cert() returned" \ | 
|  | 2825 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2826 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2827 |  | 
|  | 2828 | run_test    "SNI: CA override with CRL" \ | 
|  | 2829 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2830 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2831 | ca_file=data_files/test-ca.crt \ | 
|  | 2832 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 2833 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 2834 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2835 | 1 \ | 
|  | 2836 | -S "skip write certificate request" \ | 
|  | 2837 | -C "skip parse certificate request" \ | 
|  | 2838 | -c "got a certificate request" \ | 
|  | 2839 | -C "skip write certificate" \ | 
|  | 2840 | -C "skip write certificate verify" \ | 
|  | 2841 | -S "skip parse certificate verify" \ | 
|  | 2842 | -s "x509_verify_cert() returned" \ | 
|  | 2843 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2844 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 2845 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2846 | # Tests for SNI and DTLS | 
|  | 2847 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2848 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 2849 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 2850 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 2851 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 2852 | 0 \ | 
|  | 2853 | -S "parse ServerName extension" \ | 
|  | 2854 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 2855 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 2856 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2857 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2858 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 2859 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2860 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 2861 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 2862 | 0 \ | 
|  | 2863 | -s "parse ServerName extension" \ | 
|  | 2864 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2865 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 2866 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 2867 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 2868 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 2869 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2870 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 2871 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 2872 | 0 \ | 
|  | 2873 | -s "parse ServerName extension" \ | 
|  | 2874 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 2875 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 2876 |  | 
|  | 2877 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 2878 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 2879 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2880 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 2881 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 2882 | 1 \ | 
|  | 2883 | -s "parse ServerName extension" \ | 
|  | 2884 | -s "ssl_sni_wrapper() returned" \ | 
|  | 2885 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 2886 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 2887 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 2888 |  | 
|  | 2889 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 2890 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 2891 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2892 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 2893 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 2894 | 0 \ | 
|  | 2895 | -S "skip write certificate request" \ | 
|  | 2896 | -C "skip parse certificate request" \ | 
|  | 2897 | -c "got a certificate request" \ | 
|  | 2898 | -C "skip write certificate" \ | 
|  | 2899 | -C "skip write certificate verify" \ | 
|  | 2900 | -S "skip parse certificate verify" | 
|  | 2901 |  | 
|  | 2902 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 2903 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 2904 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2905 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 2906 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 2907 | 0 \ | 
|  | 2908 | -S "skip write certificate request" \ | 
|  | 2909 | -C "skip parse certificate request" \ | 
|  | 2910 | -c "got a certificate request" \ | 
|  | 2911 | -C "skip write certificate" \ | 
|  | 2912 | -C "skip write certificate verify" \ | 
|  | 2913 | -S "skip parse certificate verify" | 
|  | 2914 |  | 
|  | 2915 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 2916 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 2917 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2918 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 2919 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 2920 | 0 \ | 
|  | 2921 | -s "skip write certificate request" \ | 
|  | 2922 | -C "skip parse certificate request" \ | 
|  | 2923 | -c "got no certificate request" \ | 
|  | 2924 | -c "skip write certificate" \ | 
|  | 2925 | -c "skip write certificate verify" \ | 
|  | 2926 | -s "skip parse certificate verify" | 
|  | 2927 |  | 
|  | 2928 | run_test    "SNI: DTLS, CA no override" \ | 
|  | 2929 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 2930 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2931 | ca_file=data_files/test-ca.crt \ | 
|  | 2932 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 2933 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 2934 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2935 | 1 \ | 
|  | 2936 | -S "skip write certificate request" \ | 
|  | 2937 | -C "skip parse certificate request" \ | 
|  | 2938 | -c "got a certificate request" \ | 
|  | 2939 | -C "skip write certificate" \ | 
|  | 2940 | -C "skip write certificate verify" \ | 
|  | 2941 | -S "skip parse certificate verify" \ | 
|  | 2942 | -s "x509_verify_cert() returned" \ | 
|  | 2943 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2944 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2945 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2946 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2947 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 2948 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 2949 | ca_file=data_files/test-ca.crt \ | 
|  | 2950 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 2951 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 2952 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2953 | 0 \ | 
|  | 2954 | -S "skip write certificate request" \ | 
|  | 2955 | -C "skip parse certificate request" \ | 
|  | 2956 | -c "got a certificate request" \ | 
|  | 2957 | -C "skip write certificate" \ | 
|  | 2958 | -C "skip write certificate verify" \ | 
|  | 2959 | -S "skip parse certificate verify" \ | 
|  | 2960 | -S "x509_verify_cert() returned" \ | 
|  | 2961 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2962 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 2963 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 2964 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 2965 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 2966 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 2967 | ca_file=data_files/test-ca.crt \ | 
|  | 2968 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 2969 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 2970 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 2971 | 1 \ | 
|  | 2972 | -S "skip write certificate request" \ | 
|  | 2973 | -C "skip parse certificate request" \ | 
|  | 2974 | -c "got a certificate request" \ | 
|  | 2975 | -C "skip write certificate" \ | 
|  | 2976 | -C "skip write certificate verify" \ | 
|  | 2977 | -S "skip parse certificate verify" \ | 
|  | 2978 | -s "x509_verify_cert() returned" \ | 
|  | 2979 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 2980 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 2981 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2982 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 2983 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2984 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2985 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 2986 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2987 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2988 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2989 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2990 | -c "Read from server: .* bytes read" | 
|  | 2991 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2992 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2993 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 2994 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 2995 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2996 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 2997 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 2998 | -c "Read from server: .* bytes read" | 
|  | 2999 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3000 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3001 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 3002 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 3003 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3004 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3005 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3006 | -c "Read from server: .* bytes read" | 
|  | 3007 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3008 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3009 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 3010 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 3011 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3012 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3013 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3014 | -c "Read from server: .* bytes read" | 
|  | 3015 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3016 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3017 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 3018 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 3019 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3020 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3021 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3022 | -c "Read from server: .* bytes read" | 
|  | 3023 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3024 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3025 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 3026 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 3027 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3028 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3029 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3030 | -c "Read from server: .* bytes read" | 
|  | 3031 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3032 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3033 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 3034 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 3035 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3036 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3037 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3038 | -c "Read from server: .* bytes read" | 
|  | 3039 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3040 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 3041 |  | 
|  | 3042 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 3043 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 3044 | "$P_CLI event=1 tickets=0" \ | 
|  | 3045 | 0 \ | 
|  | 3046 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3047 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3048 | -c "Read from server: .* bytes read" | 
|  | 3049 |  | 
|  | 3050 | run_test    "Event-driven I/O: client auth" \ | 
|  | 3051 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 3052 | "$P_CLI event=1 tickets=0" \ | 
|  | 3053 | 0 \ | 
|  | 3054 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3055 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3056 | -c "Read from server: .* bytes read" | 
|  | 3057 |  | 
|  | 3058 | run_test    "Event-driven I/O: ticket" \ | 
|  | 3059 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 3060 | "$P_CLI event=1 tickets=1" \ | 
|  | 3061 | 0 \ | 
|  | 3062 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3063 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3064 | -c "Read from server: .* bytes read" | 
|  | 3065 |  | 
|  | 3066 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 3067 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 3068 | "$P_CLI event=1 tickets=1" \ | 
|  | 3069 | 0 \ | 
|  | 3070 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3071 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3072 | -c "Read from server: .* bytes read" | 
|  | 3073 |  | 
|  | 3074 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 3075 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 3076 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 3077 | 0 \ | 
|  | 3078 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3079 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3080 | -c "Read from server: .* bytes read" | 
|  | 3081 |  | 
|  | 3082 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 3083 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 3084 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 3085 | 0 \ | 
|  | 3086 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3087 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3088 | -c "Read from server: .* bytes read" | 
|  | 3089 |  | 
|  | 3090 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 3091 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 3092 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 3093 | 0 \ | 
|  | 3094 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3095 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 3096 | -c "Read from server: .* bytes read" | 
|  | 3097 |  | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3098 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 3099 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 3100 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 3101 | 0 \ | 
|  | 3102 | -c "Read from server: .* bytes read" | 
|  | 3103 |  | 
|  | 3104 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 3105 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 3106 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 3107 | 0 \ | 
|  | 3108 | -c "Read from server: .* bytes read" | 
|  | 3109 |  | 
|  | 3110 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 3111 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 3112 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 3113 | 0 \ | 
|  | 3114 | -c "Read from server: .* bytes read" | 
|  | 3115 |  | 
|  | 3116 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 3117 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 3118 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 3119 | 0 \ | 
|  | 3120 | -c "Read from server: .* bytes read" | 
|  | 3121 |  | 
|  | 3122 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 3123 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 3124 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 3125 | 0 \ | 
|  | 3126 | -c "Read from server: .* bytes read" | 
|  | 3127 |  | 
|  | 3128 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 3129 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 3130 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ | 
|  | 3131 | 0 \ | 
|  | 3132 | -c "Read from server: .* bytes read" | 
|  | 3133 |  | 
|  | 3134 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 3135 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 3136 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 3137 | 0 \ | 
|  | 3138 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3139 |  | 
|  | 3140 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 3141 | # During session resumption, the client will send its ApplicationData record | 
|  | 3142 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 3143 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 3144 | # because the ApplicationData request has already been queued internally. | 
|  | 3145 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3146 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3147 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 3148 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ | 
|  | 3149 | 0 \ | 
|  | 3150 | -c "Read from server: .* bytes read" | 
|  | 3151 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3152 | # Tests for version negotiation | 
|  | 3153 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3154 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3155 | "$P_SRV" \ | 
|  | 3156 | "$P_CLI" \ | 
|  | 3157 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3158 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3159 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3160 | -s "Protocol is TLSv1.2" \ | 
|  | 3161 | -c "Protocol is TLSv1.2" | 
|  | 3162 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3163 | run_test    "Version check: cli max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3164 | "$P_SRV" \ | 
|  | 3165 | "$P_CLI max_version=tls1_1" \ | 
|  | 3166 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3167 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3168 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3169 | -s "Protocol is TLSv1.1" \ | 
|  | 3170 | -c "Protocol is TLSv1.1" | 
|  | 3171 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3172 | run_test    "Version check: srv max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3173 | "$P_SRV max_version=tls1_1" \ | 
|  | 3174 | "$P_CLI" \ | 
|  | 3175 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3176 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3177 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3178 | -s "Protocol is TLSv1.1" \ | 
|  | 3179 | -c "Protocol is TLSv1.1" | 
|  | 3180 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3181 | 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] | 3182 | "$P_SRV max_version=tls1_1" \ | 
|  | 3183 | "$P_CLI max_version=tls1_1" \ | 
|  | 3184 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3185 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3186 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3187 | -s "Protocol is TLSv1.1" \ | 
|  | 3188 | -c "Protocol is TLSv1.1" | 
|  | 3189 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3190 | 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] | 3191 | "$P_SRV min_version=tls1_1" \ | 
|  | 3192 | "$P_CLI max_version=tls1_1" \ | 
|  | 3193 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3194 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3195 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3196 | -s "Protocol is TLSv1.1" \ | 
|  | 3197 | -c "Protocol is TLSv1.1" | 
|  | 3198 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3199 | 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] | 3200 | "$P_SRV max_version=tls1_1" \ | 
|  | 3201 | "$P_CLI min_version=tls1_1" \ | 
|  | 3202 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3203 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 3204 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3205 | -s "Protocol is TLSv1.1" \ | 
|  | 3206 | -c "Protocol is TLSv1.1" | 
|  | 3207 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3208 | 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] | 3209 | "$P_SRV max_version=tls1_1" \ | 
|  | 3210 | "$P_CLI min_version=tls1_2" \ | 
|  | 3211 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3212 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 3213 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3214 | -c "SSL - Handshake protocol not within min/max boundaries" | 
|  | 3215 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3216 | 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] | 3217 | "$P_SRV min_version=tls1_2" \ | 
|  | 3218 | "$P_CLI max_version=tls1_1" \ | 
|  | 3219 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3220 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 3221 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3222 | -s "SSL - Handshake protocol not within min/max boundaries" | 
|  | 3223 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3224 | # Tests for ALPN extension | 
|  | 3225 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3226 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3227 | "$P_SRV debug_level=3" \ | 
|  | 3228 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3229 | 0 \ | 
|  | 3230 | -C "client hello, adding alpn extension" \ | 
|  | 3231 | -S "found alpn extension" \ | 
|  | 3232 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3233 | -S "server hello, adding alpn extension" \ | 
|  | 3234 | -C "found alpn extension " \ | 
|  | 3235 | -C "Application Layer Protocol is" \ | 
|  | 3236 | -S "Application Layer Protocol is" | 
|  | 3237 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3238 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3239 | "$P_SRV debug_level=3" \ | 
|  | 3240 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3241 | 0 \ | 
|  | 3242 | -c "client hello, adding alpn extension" \ | 
|  | 3243 | -s "found alpn extension" \ | 
|  | 3244 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3245 | -S "server hello, adding alpn extension" \ | 
|  | 3246 | -C "found alpn extension " \ | 
|  | 3247 | -c "Application Layer Protocol is (none)" \ | 
|  | 3248 | -S "Application Layer Protocol is" | 
|  | 3249 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3250 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3251 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 3252 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3253 | 0 \ | 
|  | 3254 | -C "client hello, adding alpn extension" \ | 
|  | 3255 | -S "found alpn extension" \ | 
|  | 3256 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3257 | -S "server hello, adding alpn extension" \ | 
|  | 3258 | -C "found alpn extension " \ | 
|  | 3259 | -C "Application Layer Protocol is" \ | 
|  | 3260 | -s "Application Layer Protocol is (none)" | 
|  | 3261 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3262 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3263 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 3264 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3265 | 0 \ | 
|  | 3266 | -c "client hello, adding alpn extension" \ | 
|  | 3267 | -s "found alpn extension" \ | 
|  | 3268 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3269 | -s "server hello, adding alpn extension" \ | 
|  | 3270 | -c "found alpn extension" \ | 
|  | 3271 | -c "Application Layer Protocol is abc" \ | 
|  | 3272 | -s "Application Layer Protocol is abc" | 
|  | 3273 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3274 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3275 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 3276 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3277 | 0 \ | 
|  | 3278 | -c "client hello, adding alpn extension" \ | 
|  | 3279 | -s "found alpn extension" \ | 
|  | 3280 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3281 | -s "server hello, adding alpn extension" \ | 
|  | 3282 | -c "found alpn extension" \ | 
|  | 3283 | -c "Application Layer Protocol is abc" \ | 
|  | 3284 | -s "Application Layer Protocol is abc" | 
|  | 3285 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3286 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3287 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 3288 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3289 | 0 \ | 
|  | 3290 | -c "client hello, adding alpn extension" \ | 
|  | 3291 | -s "found alpn extension" \ | 
|  | 3292 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 3293 | -s "server hello, adding alpn extension" \ | 
|  | 3294 | -c "found alpn extension" \ | 
|  | 3295 | -c "Application Layer Protocol is 1234" \ | 
|  | 3296 | -s "Application Layer Protocol is 1234" | 
|  | 3297 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3298 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3299 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 3300 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3301 | 1 \ | 
|  | 3302 | -c "client hello, adding alpn extension" \ | 
|  | 3303 | -s "found alpn extension" \ | 
|  | 3304 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 3305 | -S "server hello, adding alpn extension" \ | 
|  | 3306 | -C "found alpn extension" \ | 
|  | 3307 | -C "Application Layer Protocol is 1234" \ | 
|  | 3308 | -S "Application Layer Protocol is 1234" | 
|  | 3309 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3310 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3311 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 3312 | # server-side certificate/suite selection | 
|  | 3313 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3314 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3315 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 3316 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 3317 | "$P_CLI" \ | 
|  | 3318 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3319 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3320 |  | 
|  | 3321 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3322 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3323 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 3324 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 3325 | "$P_CLI" \ | 
|  | 3326 | 0 \ | 
|  | 3327 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 3328 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3329 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3330 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3331 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3332 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3333 | 1 \ | 
|  | 3334 | -C "Ciphersuite is " | 
|  | 3335 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3336 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3337 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3338 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 3339 | "$P_CLI" \ | 
|  | 3340 | 0 \ | 
|  | 3341 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 3342 |  | 
|  | 3343 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3344 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3345 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3346 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 3347 | "$P_CLI" \ | 
|  | 3348 | 0 \ | 
|  | 3349 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 3350 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3351 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3352 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3353 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3354 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3355 | 1 \ | 
|  | 3356 | -C "Ciphersuite is " | 
|  | 3357 |  | 
|  | 3358 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3359 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3360 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3361 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3362 | "$O_SRV -key data_files/server2.key \ | 
|  | 3363 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3364 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3365 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3366 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3367 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3368 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3369 | -c "Ciphersuite is TLS-" | 
|  | 3370 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3371 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3372 | "$O_SRV -key data_files/server2.key \ | 
|  | 3373 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3374 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3375 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3376 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3377 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3378 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3379 | -c "Ciphersuite is TLS-" | 
|  | 3380 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3381 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3382 | "$O_SRV -key data_files/server2.key \ | 
|  | 3383 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3384 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3385 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3386 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3387 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3388 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3389 | -c "Ciphersuite is TLS-" | 
|  | 3390 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3391 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3392 | "$O_SRV -key data_files/server2.key \ | 
|  | 3393 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3394 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3395 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3396 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3397 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3398 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3399 | -C "Ciphersuite is TLS-" | 
|  | 3400 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3401 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 3402 | "$O_SRV -key data_files/server2.key \ | 
|  | 3403 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3404 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 3405 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3406 | 0 \ | 
|  | 3407 | -c "bad certificate (usage extensions)" \ | 
|  | 3408 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3409 | -c "Ciphersuite is TLS-" \ | 
|  | 3410 | -c "! Usage does not match the keyUsage extension" | 
|  | 3411 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3412 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3413 | "$O_SRV -key data_files/server2.key \ | 
|  | 3414 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3415 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3416 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3417 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3418 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3419 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3420 | -c "Ciphersuite is TLS-" | 
|  | 3421 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3422 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3423 | "$O_SRV -key data_files/server2.key \ | 
|  | 3424 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3425 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3426 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3427 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3428 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3429 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3430 | -C "Ciphersuite is TLS-" | 
|  | 3431 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3432 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 3433 | "$O_SRV -key data_files/server2.key \ | 
|  | 3434 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 3435 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 3436 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 3437 | 0 \ | 
|  | 3438 | -c "bad certificate (usage extensions)" \ | 
|  | 3439 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3440 | -c "Ciphersuite is TLS-" \ | 
|  | 3441 | -c "! Usage does not match the keyUsage extension" | 
|  | 3442 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3443 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 3444 | # server-side checking of client cert | 
|  | 3445 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3446 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3447 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3448 | "$O_CLI -key data_files/server2.key \ | 
|  | 3449 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 3450 | 0 \ | 
|  | 3451 | -S "bad certificate (usage extensions)" \ | 
|  | 3452 | -S "Processing of the Certificate handshake message failed" | 
|  | 3453 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3454 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3455 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3456 | "$O_CLI -key data_files/server2.key \ | 
|  | 3457 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3458 | 0 \ | 
|  | 3459 | -s "bad certificate (usage extensions)" \ | 
|  | 3460 | -S "Processing of the Certificate handshake message failed" | 
|  | 3461 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3462 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3463 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3464 | "$O_CLI -key data_files/server2.key \ | 
|  | 3465 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 3466 | 1 \ | 
|  | 3467 | -s "bad certificate (usage extensions)" \ | 
|  | 3468 | -s "Processing of the Certificate handshake message failed" | 
|  | 3469 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3470 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3471 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3472 | "$O_CLI -key data_files/server5.key \ | 
|  | 3473 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 3474 | 0 \ | 
|  | 3475 | -S "bad certificate (usage extensions)" \ | 
|  | 3476 | -S "Processing of the Certificate handshake message failed" | 
|  | 3477 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3478 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3479 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3480 | "$O_CLI -key data_files/server5.key \ | 
|  | 3481 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 3482 | 0 \ | 
|  | 3483 | -s "bad certificate (usage extensions)" \ | 
|  | 3484 | -S "Processing of the Certificate handshake message failed" | 
|  | 3485 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3486 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 3487 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3488 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3489 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3490 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 3491 | "$P_CLI" \ | 
|  | 3492 | 0 | 
|  | 3493 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3494 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3495 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3496 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 3497 | "$P_CLI" \ | 
|  | 3498 | 0 | 
|  | 3499 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3500 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3501 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 3502 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 3503 | "$P_CLI" \ | 
|  | 3504 | 0 | 
|  | 3505 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3506 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3507 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3508 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3509 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3510 | 1 | 
|  | 3511 |  | 
|  | 3512 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 3513 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3514 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3515 | "$O_SRV -key data_files/server5.key \ | 
|  | 3516 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3517 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3518 | 0 \ | 
|  | 3519 | -C "bad certificate (usage extensions)" \ | 
|  | 3520 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3521 | -c "Ciphersuite is TLS-" | 
|  | 3522 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3523 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3524 | "$O_SRV -key data_files/server5.key \ | 
|  | 3525 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3526 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3527 | 0 \ | 
|  | 3528 | -C "bad certificate (usage extensions)" \ | 
|  | 3529 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3530 | -c "Ciphersuite is TLS-" | 
|  | 3531 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3532 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3533 | "$O_SRV -key data_files/server5.key \ | 
|  | 3534 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3535 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3536 | 0 \ | 
|  | 3537 | -C "bad certificate (usage extensions)" \ | 
|  | 3538 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 3539 | -c "Ciphersuite is TLS-" | 
|  | 3540 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3541 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3542 | "$O_SRV -key data_files/server5.key \ | 
|  | 3543 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3544 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3545 | 1 \ | 
|  | 3546 | -c "bad certificate (usage extensions)" \ | 
|  | 3547 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 3548 | -C "Ciphersuite is TLS-" | 
|  | 3549 |  | 
|  | 3550 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 3551 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3553 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3554 | "$O_CLI -key data_files/server5.key \ | 
|  | 3555 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 3556 | 0 \ | 
|  | 3557 | -S "bad certificate (usage extensions)" \ | 
|  | 3558 | -S "Processing of the Certificate handshake message failed" | 
|  | 3559 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3560 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3561 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3562 | "$O_CLI -key data_files/server5.key \ | 
|  | 3563 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 3564 | 0 \ | 
|  | 3565 | -S "bad certificate (usage extensions)" \ | 
|  | 3566 | -S "Processing of the Certificate handshake message failed" | 
|  | 3567 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3568 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3569 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3570 | "$O_CLI -key data_files/server5.key \ | 
|  | 3571 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 3572 | 0 \ | 
|  | 3573 | -S "bad certificate (usage extensions)" \ | 
|  | 3574 | -S "Processing of the Certificate handshake message failed" | 
|  | 3575 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3576 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3577 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3578 | "$O_CLI -key data_files/server5.key \ | 
|  | 3579 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 3580 | 0 \ | 
|  | 3581 | -s "bad certificate (usage extensions)" \ | 
|  | 3582 | -S "Processing of the Certificate handshake message failed" | 
|  | 3583 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3584 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3585 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3586 | "$O_CLI -key data_files/server5.key \ | 
|  | 3587 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 3588 | 1 \ | 
|  | 3589 | -s "bad certificate (usage extensions)" \ | 
|  | 3590 | -s "Processing of the Certificate handshake message failed" | 
|  | 3591 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3592 | # Tests for DHM parameters loading | 
|  | 3593 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3594 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3595 | "$P_SRV" \ | 
|  | 3596 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3597 | debug_level=3" \ | 
|  | 3598 | 0 \ | 
|  | 3599 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3600 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3601 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3602 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3603 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 3604 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3605 | debug_level=3" \ | 
|  | 3606 | 0 \ | 
|  | 3607 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 3608 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 3609 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3610 | # Tests for DHM client-side size checking | 
|  | 3611 |  | 
|  | 3612 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 3613 | "$P_SRV" \ | 
|  | 3614 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3615 | debug_level=1" \ | 
|  | 3616 | 0 \ | 
|  | 3617 | -C "DHM prime too short:" | 
|  | 3618 |  | 
|  | 3619 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 3620 | "$P_SRV" \ | 
|  | 3621 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3622 | debug_level=1 dhmlen=2048" \ | 
|  | 3623 | 0 \ | 
|  | 3624 | -C "DHM prime too short:" | 
|  | 3625 |  | 
|  | 3626 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 3627 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 3628 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3629 | debug_level=1" \ | 
|  | 3630 | 0 \ | 
|  | 3631 | -C "DHM prime too short:" | 
|  | 3632 |  | 
|  | 3633 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 3634 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 3635 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3636 | debug_level=1" \ | 
|  | 3637 | 1 \ | 
|  | 3638 | -c "DHM prime too short:" | 
|  | 3639 |  | 
|  | 3640 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 3641 | "$P_SRV" \ | 
|  | 3642 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 3643 | debug_level=1 dhmlen=2049" \ | 
|  | 3644 | 1 \ | 
|  | 3645 | -c "DHM prime too short:" | 
|  | 3646 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3647 | # Tests for PSK callback | 
|  | 3648 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3649 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3650 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 3651 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3652 | psk_identity=foo psk=abc123" \ | 
|  | 3653 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3654 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3655 | -S "SSL - Unknown identity received" \ | 
|  | 3656 | -S "SSL - Verification of the message MAC failed" | 
|  | 3657 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3658 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3659 | "$P_SRV" \ | 
|  | 3660 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3661 | psk_identity=foo psk=abc123" \ | 
|  | 3662 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3663 | -s "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3664 | -S "SSL - Unknown identity received" \ | 
|  | 3665 | -S "SSL - Verification of the message MAC failed" | 
|  | 3666 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3667 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3668 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 3669 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3670 | psk_identity=foo psk=abc123" \ | 
|  | 3671 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3672 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3673 | -s "SSL - Unknown identity received" \ | 
|  | 3674 | -S "SSL - Verification of the message MAC failed" | 
|  | 3675 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3676 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3677 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3678 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3679 | psk_identity=abc psk=dead" \ | 
|  | 3680 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3681 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3682 | -S "SSL - Unknown identity received" \ | 
|  | 3683 | -S "SSL - Verification of the message MAC failed" | 
|  | 3684 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3685 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3686 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3687 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3688 | psk_identity=def psk=beef" \ | 
|  | 3689 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3690 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3691 | -S "SSL - Unknown identity received" \ | 
|  | 3692 | -S "SSL - Verification of the message MAC failed" | 
|  | 3693 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3694 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3695 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3696 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3697 | psk_identity=ghi psk=beef" \ | 
|  | 3698 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3699 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3700 | -s "SSL - Unknown identity received" \ | 
|  | 3701 | -S "SSL - Verification of the message MAC failed" | 
|  | 3702 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3703 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3704 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 3705 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 3706 | psk_identity=abc psk=beef" \ | 
|  | 3707 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3708 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3709 | -S "SSL - Unknown identity received" \ | 
|  | 3710 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3711 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3712 | # Tests for EC J-PAKE | 
|  | 3713 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3714 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3715 | run_test    "ECJPAKE: client not configured" \ | 
|  | 3716 | "$P_SRV debug_level=3" \ | 
|  | 3717 | "$P_CLI debug_level=3" \ | 
|  | 3718 | 0 \ | 
|  | 3719 | -C "add ciphersuite: c0ff" \ | 
|  | 3720 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3721 | -S "found ecjpake kkpp extension" \ | 
|  | 3722 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3723 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3724 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3725 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3726 | -S "None of the common ciphersuites is usable" | 
|  | 3727 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3729 | run_test    "ECJPAKE: server not configured" \ | 
|  | 3730 | "$P_SRV debug_level=3" \ | 
|  | 3731 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3732 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3733 | 1 \ | 
|  | 3734 | -c "add ciphersuite: c0ff" \ | 
|  | 3735 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3736 | -s "found ecjpake kkpp extension" \ | 
|  | 3737 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3738 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3739 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3740 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3741 | -s "None of the common ciphersuites is usable" | 
|  | 3742 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3744 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 3745 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3746 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 3747 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 3748 | 0 \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3749 | -c "add ciphersuite: c0ff" \ | 
|  | 3750 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3751 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3752 | -s "found ecjpake kkpp extension" \ | 
|  | 3753 | -S "skip ecjpake kkpp extension" \ | 
|  | 3754 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3755 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3756 | -c "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3757 | -S "None of the common ciphersuites is usable" \ | 
|  | 3758 | -S "SSL - Verification of the message MAC failed" | 
|  | 3759 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3760 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3761 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3762 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 3763 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 3764 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 3765 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3766 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3767 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3768 | -s "SSL - Verification of the message MAC failed" | 
|  | 3769 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3770 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3771 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 3772 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3773 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3774 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3775 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3776 | -c "re-using cached ecjpake parameters" \ | 
|  | 3777 | -S "SSL - Verification of the message MAC failed" | 
|  | 3778 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3779 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3780 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 3781 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 3782 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 3783 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3784 | 0 \ | 
|  | 3785 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3786 | -S "SSL - Verification of the message MAC failed" | 
|  | 3787 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 3788 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3789 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3790 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 3791 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 3792 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 3793 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3794 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 3795 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 3796 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3797 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3798 | # for tests with configs/config-thread.h | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3799 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 3800 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 3801 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 3802 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 3803 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 3804 | 0 | 
|  | 3805 |  | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3806 | # Tests for ciphersuites per version | 
|  | 3807 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3808 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3809 | run_test    "Per-version suites: SSL3" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3810 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-3DES-EDE-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] | 3811 | "$P_CLI force_version=ssl3" \ | 
|  | 3812 | 0 \ | 
|  | 3813 | -c "Ciphersuite is TLS-RSA-WITH-3DES-EDE-CBC-SHA" | 
|  | 3814 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3815 | run_test    "Per-version suites: TLS 1.0" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3816 | "$P_SRV arc4=1 version_suites=TLS-RSA-WITH-3DES-EDE-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] | 3817 | "$P_CLI force_version=tls1 arc4=1" \ | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3818 | 0 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3819 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3820 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3821 | run_test    "Per-version suites: TLS 1.1" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3822 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-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] | 3823 | "$P_CLI force_version=tls1_1" \ | 
|  | 3824 | 0 \ | 
|  | 3825 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" | 
|  | 3826 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3827 | run_test    "Per-version suites: TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3828 | "$P_SRV version_suites=TLS-RSA-WITH-3DES-EDE-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] | 3829 | "$P_CLI force_version=tls1_2" \ | 
|  | 3830 | 0 \ | 
|  | 3831 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" | 
|  | 3832 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3833 | # Test for ClientHello without extensions | 
|  | 3834 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 3835 | requires_gnutls | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3836 | run_test    "ClientHello without extensions, SHA-1 allowed" \ | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3837 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3838 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 3839 | 0 \ | 
|  | 3840 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3841 |  | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3842 | requires_gnutls | 
|  | 3843 | run_test    "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ | 
|  | 3844 | "$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] | 3845 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 3846 | 0 \ | 
|  | 3847 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 3848 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3849 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3850 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3851 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3852 | "$P_SRV" \ | 
|  | 3853 | "$P_CLI request_size=100" \ | 
|  | 3854 | 0 \ | 
|  | 3855 | -s "Read from client: 100 bytes read$" | 
|  | 3856 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3857 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 3858 | "$P_SRV" \ | 
|  | 3859 | "$P_CLI request_size=500" \ | 
|  | 3860 | 0 \ | 
|  | 3861 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 3862 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3863 | # Tests for small packets | 
|  | 3864 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3865 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3866 | run_test    "Small packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 3867 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3868 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3869 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3870 | 0 \ | 
|  | 3871 | -s "Read from client: 1 bytes read" | 
|  | 3872 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3874 | run_test    "Small packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3875 | "$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] | 3876 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 3877 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3878 | 0 \ | 
|  | 3879 | -s "Read from client: 1 bytes read" | 
|  | 3880 |  | 
|  | 3881 | run_test    "Small packet TLS 1.0 BlockCipher" \ | 
|  | 3882 | "$P_SRV" \ | 
|  | 3883 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 3884 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3885 | 0 \ | 
|  | 3886 | -s "Read from client: 1 bytes read" | 
|  | 3887 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3888 | run_test    "Small packet TLS 1.0 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3889 | "$P_SRV" \ | 
|  | 3890 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ | 
|  | 3891 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3892 | 0 \ | 
|  | 3893 | -s "Read from client: 1 bytes read" | 
|  | 3894 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3895 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3896 | run_test    "Small packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3897 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3898 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3899 | 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] | 3900 | 0 \ | 
|  | 3901 | -s "Read from client: 1 bytes read" | 
|  | 3902 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3903 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3904 | run_test    "Small packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3905 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3906 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3907 | 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] | 3908 | 0 \ | 
|  | 3909 | -s "Read from client: 1 bytes read" | 
|  | 3910 |  | 
|  | 3911 | run_test    "Small packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3912 | "$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] | 3913 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3914 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3915 | 0 \ | 
|  | 3916 | -s "Read from client: 1 bytes read" | 
|  | 3917 |  | 
|  | 3918 | run_test    "Small packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 3919 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3920 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3921 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3922 | 0 \ | 
|  | 3923 | -s "Read from client: 1 bytes read" | 
|  | 3924 |  | 
|  | 3925 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3926 | run_test    "Small packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3927 | "$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] | 3928 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3929 | 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] | 3930 | 0 \ | 
|  | 3931 | -s "Read from client: 1 bytes read" | 
|  | 3932 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3933 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3934 | run_test    "Small packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3935 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 3936 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 3937 | trunc_hmac=1 etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3938 | 0 \ | 
|  | 3939 | -s "Read from client: 1 bytes read" | 
|  | 3940 |  | 
|  | 3941 | run_test    "Small packet TLS 1.1 BlockCipher" \ | 
|  | 3942 | "$P_SRV" \ | 
|  | 3943 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3944 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 3945 | 0 \ | 
|  | 3946 | -s "Read from client: 1 bytes read" | 
|  | 3947 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3948 | run_test    "Small packet TLS 1.1 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 3949 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3950 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3951 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3952 | 0 \ | 
|  | 3953 | -s "Read from client: 1 bytes read" | 
|  | 3954 |  | 
|  | 3955 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3956 | run_test    "Small packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3957 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3958 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3959 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3960 | 0 \ | 
|  | 3961 | -s "Read from client: 1 bytes read" | 
|  | 3962 |  | 
|  | 3963 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3964 | run_test    "Small packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3965 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3966 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3967 | 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] | 3968 | 0 \ | 
|  | 3969 | -s "Read from client: 1 bytes read" | 
|  | 3970 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3971 | run_test    "Small packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 3972 | "$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] | 3973 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 3974 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 3975 | 0 \ | 
|  | 3976 | -s "Read from client: 1 bytes read" | 
|  | 3977 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3978 | run_test    "Small packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 3979 | "$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] | 3980 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3981 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 3982 | 0 \ | 
|  | 3983 | -s "Read from client: 1 bytes read" | 
|  | 3984 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3985 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 3986 | run_test    "Small packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3987 | "$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] | 3988 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3989 | 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] | 3990 | 0 \ | 
|  | 3991 | -s "Read from client: 1 bytes read" | 
|  | 3992 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 3993 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 3994 | run_test    "Small packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3995 | "$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] | 3996 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 3997 | 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] | 3998 | 0 \ | 
|  | 3999 | -s "Read from client: 1 bytes read" | 
|  | 4000 |  | 
|  | 4001 | run_test    "Small packet TLS 1.2 BlockCipher" \ | 
|  | 4002 | "$P_SRV" \ | 
|  | 4003 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 4004 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4005 | 0 \ | 
|  | 4006 | -s "Read from client: 1 bytes read" | 
|  | 4007 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4008 | run_test    "Small packet TLS 1.2 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4009 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4010 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4011 | 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] | 4012 | 0 \ | 
|  | 4013 | -s "Read from client: 1 bytes read" | 
|  | 4014 |  | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4015 | run_test    "Small packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 4016 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4017 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 4018 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4019 | 0 \ | 
|  | 4020 | -s "Read from client: 1 bytes read" | 
|  | 4021 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4022 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4023 | run_test    "Small packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4024 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4025 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4026 | 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] | 4027 | 0 \ | 
|  | 4028 | -s "Read from client: 1 bytes read" | 
|  | 4029 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4030 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4031 | run_test    "Small packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4032 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4033 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4034 | 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] | 4035 | 0 \ | 
|  | 4036 | -s "Read from client: 1 bytes read" | 
|  | 4037 |  | 
|  | 4038 | run_test    "Small packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4039 | "$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] | 4040 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 4041 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4042 | 0 \ | 
|  | 4043 | -s "Read from client: 1 bytes read" | 
|  | 4044 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4045 | run_test    "Small packet TLS 1.2 StreamCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4046 | "$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] | 4047 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4048 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4049 | 0 \ | 
|  | 4050 | -s "Read from client: 1 bytes read" | 
|  | 4051 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4052 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4053 | run_test    "Small packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4054 | "$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] | 4055 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4056 | 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] | 4057 | 0 \ | 
|  | 4058 | -s "Read from client: 1 bytes read" | 
|  | 4059 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4060 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4061 | run_test    "Small packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4062 | "$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] | 4063 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4064 | 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] | 4065 | 0 \ | 
|  | 4066 | -s "Read from client: 1 bytes read" | 
|  | 4067 |  | 
|  | 4068 | run_test    "Small packet TLS 1.2 AEAD" \ | 
|  | 4069 | "$P_SRV" \ | 
|  | 4070 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 4071 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 4072 | 0 \ | 
|  | 4073 | -s "Read from client: 1 bytes read" | 
|  | 4074 |  | 
|  | 4075 | run_test    "Small packet TLS 1.2 AEAD shorter tag" \ | 
|  | 4076 | "$P_SRV" \ | 
|  | 4077 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 4078 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 4079 | 0 \ | 
|  | 4080 | -s "Read from client: 1 bytes read" | 
|  | 4081 |  | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4082 | # Tests for small packets in DTLS | 
|  | 4083 |  | 
|  | 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4085 | run_test    "Small packet DTLS 1.0" \ | 
|  | 4086 | "$P_SRV dtls=1 force_version=dtls1" \ | 
|  | 4087 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 4088 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4089 | 0 \ | 
|  | 4090 | -s "Read from client: 1 bytes read" | 
|  | 4091 |  | 
|  | 4092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4093 | run_test    "Small packet DTLS 1.0, without EtM" \ | 
|  | 4094 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ | 
|  | 4095 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 4096 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4097 | 0 \ | 
|  | 4098 | -s "Read from client: 1 bytes read" | 
|  | 4099 |  | 
|  | 4100 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4101 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4102 | run_test    "Small packet DTLS 1.0, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4103 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 4104 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4105 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4106 | 0 \ | 
|  | 4107 | -s "Read from client: 1 bytes read" | 
|  | 4108 |  | 
|  | 4109 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4110 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4111 | run_test    "Small packet DTLS 1.0, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4112 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4113 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4114 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4115 | 0 \ | 
|  | 4116 | -s "Read from client: 1 bytes read" | 
|  | 4117 |  | 
|  | 4118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4119 | run_test    "Small packet DTLS 1.2" \ | 
|  | 4120 | "$P_SRV dtls=1 force_version=dtls1_2" \ | 
|  | 4121 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 4122 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4123 | 0 \ | 
|  | 4124 | -s "Read from client: 1 bytes read" | 
|  | 4125 |  | 
|  | 4126 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4127 | run_test    "Small packet DTLS 1.2, without EtM" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4128 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4129 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 4130 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4131 | 0 \ | 
|  | 4132 | -s "Read from client: 1 bytes read" | 
|  | 4133 |  | 
|  | 4134 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4135 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4136 | run_test    "Small packet DTLS 1.2, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4137 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4138 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4139 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4140 | 0 \ | 
|  | 4141 | -s "Read from client: 1 bytes read" | 
|  | 4142 |  | 
|  | 4143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 4144 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4145 | run_test    "Small packet DTLS 1.2, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4146 | "$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] | 4147 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4148 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4149 | 0 \ | 
|  | 4150 | -s "Read from client: 1 bytes read" | 
|  | 4151 |  | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4152 | # A test for extensions in SSLv3 | 
|  | 4153 |  | 
|  | 4154 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 4155 | run_test    "SSLv3 with extensions, server side" \ | 
|  | 4156 | "$P_SRV min_version=ssl3 debug_level=3" \ | 
|  | 4157 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ | 
|  | 4158 | 0 \ | 
|  | 4159 | -S "dumping 'client hello extensions'" \ | 
|  | 4160 | -S "server hello, total extension length:" | 
|  | 4161 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4162 | # Test for large packets | 
|  | 4163 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4164 | # How many fragments do we expect to write $1 bytes? | 
|  | 4165 | fragments_for_write() { | 
|  | 4166 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 4167 | } | 
|  | 4168 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4169 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4170 | run_test    "Large packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4171 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4172 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4173 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4174 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4175 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4176 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4177 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4179 | run_test    "Large packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4180 | "$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] | 4181 | "$P_CLI request_size=16384 force_version=ssl3 \ | 
|  | 4182 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4183 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4184 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4185 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4186 |  | 
|  | 4187 | run_test    "Large packet TLS 1.0 BlockCipher" \ | 
|  | 4188 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4189 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4191 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4192 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4193 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4194 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4195 | run_test    "Large packet TLS 1.0 BlockCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4196 | "$P_SRV" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4197 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
|  | 4198 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4199 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4200 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4201 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4203 | run_test    "Large packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4204 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4205 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4206 | 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] | 4207 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4208 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4209 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4210 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4211 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4212 | run_test    "Large packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4213 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4214 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4216 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4217 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4218 |  | 
|  | 4219 | run_test    "Large packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4220 | "$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] | 4221 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4222 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4223 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4224 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4225 |  | 
|  | 4226 | run_test    "Large packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 4227 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4228 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4229 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4230 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4231 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4232 |  | 
|  | 4233 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4234 | run_test    "Large packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4235 | "$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] | 4236 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4237 | 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] | 4238 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4239 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4240 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4242 | run_test    "Large packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4243 | "$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] | 4244 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4245 | 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] | 4246 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4247 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4248 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4249 |  | 
|  | 4250 | run_test    "Large packet TLS 1.1 BlockCipher" \ | 
|  | 4251 | "$P_SRV" \ | 
|  | 4252 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 4253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4254 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4255 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4256 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4257 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4258 | run_test    "Large packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 4259 | "$P_SRV" \ | 
|  | 4260 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ | 
|  | 4261 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4262 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4263 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4264 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4266 | run_test    "Large packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4267 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4268 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4269 | 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] | 4270 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4271 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4272 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4273 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4274 | run_test    "Large packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4275 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4276 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4277 | 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] | 4278 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4279 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4280 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4281 | run_test    "Large packet TLS 1.1 StreamCipher" \ | 
|  | 4282 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4283 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 4284 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4285 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4286 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4287 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4288 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4289 | run_test    "Large packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 4290 | "$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] | 4291 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4292 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4293 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4294 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4295 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4296 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4297 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4298 | run_test    "Large packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4299 | "$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] | 4300 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4301 | 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] | 4302 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4303 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4304 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4305 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4306 | run_test    "Large packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4307 | "$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] | 4308 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4309 | 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] | 4310 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4311 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4312 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4313 |  | 
|  | 4314 | run_test    "Large packet TLS 1.2 BlockCipher" \ | 
|  | 4315 | "$P_SRV" \ | 
|  | 4316 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4317 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4318 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4319 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4320 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4321 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4322 | run_test    "Large packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 4323 | "$P_SRV" \ | 
|  | 4324 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ | 
|  | 4325 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 4326 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4327 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4328 |  | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4329 | run_test    "Large packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 4330 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4331 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4332 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4333 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4334 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4335 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4336 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4338 | run_test    "Large packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4339 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4340 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4341 | 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] | 4342 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4343 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4344 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4346 | run_test    "Large packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4347 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4348 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4349 | 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] | 4350 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4351 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4352 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4353 |  | 
|  | 4354 | run_test    "Large packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4355 | "$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] | 4356 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4357 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 4358 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4359 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4360 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4361 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4362 | run_test    "Large packet TLS 1.2 StreamCipher, without EtM" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4363 | "$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] | 4364 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4365 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 4366 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4367 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4368 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4370 | run_test    "Large packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4371 | "$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] | 4372 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4373 | 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] | 4374 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4375 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4376 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 4378 | run_test    "Large packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4379 | "$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] | 4380 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4381 | 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] | 4382 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4383 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4384 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4385 |  | 
|  | 4386 | run_test    "Large packet TLS 1.2 AEAD" \ | 
|  | 4387 | "$P_SRV" \ | 
|  | 4388 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4389 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 4390 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4391 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4392 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4393 |  | 
|  | 4394 | run_test    "Large packet TLS 1.2 AEAD shorter tag" \ | 
|  | 4395 | "$P_SRV" \ | 
|  | 4396 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 4397 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 4398 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4399 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 4400 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4401 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4402 | # Tests of asynchronous private key support in SSL | 
|  | 4403 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4404 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4405 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 4406 | "$P_SRV \ | 
|  | 4407 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4408 | "$P_CLI" \ | 
|  | 4409 | 0 \ | 
|  | 4410 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4411 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4412 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4413 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4414 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 4415 | "$P_SRV \ | 
|  | 4416 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4417 | "$P_CLI" \ | 
|  | 4418 | 0 \ | 
|  | 4419 | -s "Async sign callback: using key slot " \ | 
|  | 4420 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4421 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4422 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 4423 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4424 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 4425 | "$P_SRV \ | 
|  | 4426 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 4427 | "$P_CLI" \ | 
|  | 4428 | 0 \ | 
|  | 4429 | -s "Async sign callback: using key slot " \ | 
|  | 4430 | -U "Async sign callback: using key slot " \ | 
|  | 4431 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 4432 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4433 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4434 |  | 
| Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 4435 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 | 
|  | 4436 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. | 
|  | 4437 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 4439 | run_test    "SSL async private: sign, RSA, TLS 1.1" \ | 
|  | 4440 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ | 
|  | 4441 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4442 | "$P_CLI force_version=tls1_1" \ | 
|  | 4443 | 0 \ | 
|  | 4444 | -s "Async sign callback: using key slot " \ | 
|  | 4445 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4446 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4447 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 4448 | run_test    "SSL async private: sign, SNI" \ | 
|  | 4449 | "$P_SRV debug_level=3 \ | 
|  | 4450 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 4451 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4452 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4453 | "$P_CLI server_name=polarssl.example" \ | 
|  | 4454 | 0 \ | 
|  | 4455 | -s "Async sign callback: using key slot " \ | 
|  | 4456 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 4457 | -s "parse ServerName extension" \ | 
|  | 4458 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4459 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 4460 |  | 
|  | 4461 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4462 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 4463 | "$P_SRV \ | 
|  | 4464 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4465 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4466 | 0 \ | 
|  | 4467 | -s "Async decrypt callback: using key slot " \ | 
|  | 4468 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4469 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4470 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4471 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 4472 | "$P_SRV \ | 
|  | 4473 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4474 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4475 | 0 \ | 
|  | 4476 | -s "Async decrypt callback: using key slot " \ | 
|  | 4477 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4478 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4479 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4481 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 4482 | "$P_SRV psk=abc123 \ | 
|  | 4483 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 4484 | "$P_CLI psk=abc123 \ | 
|  | 4485 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 4486 | 0 \ | 
|  | 4487 | -s "Async decrypt callback: using key slot " \ | 
|  | 4488 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4489 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4490 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4491 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 4492 | "$P_SRV psk=abc123 \ | 
|  | 4493 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4494 | "$P_CLI psk=abc123 \ | 
|  | 4495 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 4496 | 0 \ | 
|  | 4497 | -s "Async decrypt callback: using key slot " \ | 
|  | 4498 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 4499 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4500 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4501 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4502 | run_test    "SSL async private: sign callback not present" \ | 
|  | 4503 | "$P_SRV \ | 
|  | 4504 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4505 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 4506 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4507 | 0 \ | 
|  | 4508 | -S "Async sign callback" \ | 
|  | 4509 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4510 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 4511 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 4512 | -s "Successful connection" | 
|  | 4513 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4514 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4515 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 4516 | "$P_SRV debug_level=1 \ | 
|  | 4517 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 4518 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 4519 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4520 | 0 \ | 
|  | 4521 | -S "Async decrypt callback" \ | 
|  | 4522 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4523 | -s "got no RSA private key" \ | 
|  | 4524 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 4525 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4526 |  | 
|  | 4527 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4528 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4529 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4530 | "$P_SRV \ | 
|  | 4531 | async_operations=s async_private_delay1=1 \ | 
|  | 4532 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4533 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4534 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4535 | 0 \ | 
|  | 4536 | -s "Async sign callback: using key slot 0," \ | 
|  | 4537 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4538 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4539 |  | 
|  | 4540 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4541 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4542 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4543 | "$P_SRV \ | 
|  | 4544 | async_operations=s async_private_delay2=1 \ | 
|  | 4545 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4546 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4547 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4548 | 0 \ | 
|  | 4549 | -s "Async sign callback: using key slot 0," \ | 
|  | 4550 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4551 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4552 |  | 
|  | 4553 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 4555 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4556 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 4557 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4558 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4559 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4560 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4561 | 0 \ | 
|  | 4562 | -s "Async sign callback: using key slot 1," \ | 
|  | 4563 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4564 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4565 |  | 
|  | 4566 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4568 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4569 | "$P_SRV \ | 
|  | 4570 | async_operations=s async_private_delay1=1 \ | 
|  | 4571 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4572 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4573 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4574 | 0 \ | 
|  | 4575 | -s "Async sign callback: no key matches this certificate." | 
|  | 4576 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4577 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4578 | run_test    "SSL async private: sign, error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4579 | "$P_SRV \ | 
|  | 4580 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4581 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4582 | "$P_CLI" \ | 
|  | 4583 | 1 \ | 
|  | 4584 | -s "Async sign callback: injected error" \ | 
|  | 4585 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4586 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4587 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4588 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4589 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4590 | run_test    "SSL async private: sign, cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4591 | "$P_SRV \ | 
|  | 4592 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4593 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4594 | "$P_CLI" \ | 
|  | 4595 | 1 \ | 
|  | 4596 | -s "Async sign callback: using key slot " \ | 
|  | 4597 | -S "Async resume" \ | 
|  | 4598 | -s "Async cancel" | 
|  | 4599 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4600 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4601 | run_test    "SSL async private: sign, error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4602 | "$P_SRV \ | 
|  | 4603 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4604 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4605 | "$P_CLI" \ | 
|  | 4606 | 1 \ | 
|  | 4607 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4608 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 4609 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4610 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4611 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4612 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4613 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 4614 | "$P_SRV \ | 
|  | 4615 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4616 | async_private_error=1" \ | 
|  | 4617 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4618 | 1 \ | 
|  | 4619 | -s "Async decrypt callback: injected error" \ | 
|  | 4620 | -S "Async resume" \ | 
|  | 4621 | -S "Async cancel" \ | 
|  | 4622 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4623 |  | 
|  | 4624 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4625 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 4626 | "$P_SRV \ | 
|  | 4627 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4628 | async_private_error=2" \ | 
|  | 4629 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4630 | 1 \ | 
|  | 4631 | -s "Async decrypt callback: using key slot " \ | 
|  | 4632 | -S "Async resume" \ | 
|  | 4633 | -s "Async cancel" | 
|  | 4634 |  | 
|  | 4635 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 4636 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 4637 | "$P_SRV \ | 
|  | 4638 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4639 | async_private_error=3" \ | 
|  | 4640 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4641 | 1 \ | 
|  | 4642 | -s "Async decrypt callback: using key slot " \ | 
|  | 4643 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 4644 | -S "Async cancel" \ | 
|  | 4645 | -s "! mbedtls_ssl_handshake returned" | 
|  | 4646 |  | 
|  | 4647 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4648 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4649 | "$P_SRV \ | 
|  | 4650 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4651 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4652 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4653 | 0 \ | 
|  | 4654 | -s "Async cancel" \ | 
|  | 4655 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4656 | -s "Async resume" \ | 
|  | 4657 | -s "Successful connection" | 
|  | 4658 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4659 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4660 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4661 | "$P_SRV \ | 
|  | 4662 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4663 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4664 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 4665 | 0 \ | 
|  | 4666 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4667 | -s "Async resume" \ | 
|  | 4668 | -s "Successful connection" | 
|  | 4669 |  | 
|  | 4670 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4671 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4672 | 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] | 4673 | "$P_SRV \ | 
|  | 4674 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 4675 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4676 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4677 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 4678 | [ \$? -eq 1 ] && | 
|  | 4679 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4680 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 4681 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4682 | -S "Async resume" \ | 
|  | 4683 | -s "Async cancel" \ | 
|  | 4684 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4685 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 4686 | -s "Successful connection" | 
|  | 4687 |  | 
|  | 4688 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4689 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 4690 | 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] | 4691 | "$P_SRV \ | 
|  | 4692 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 4693 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 4694 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 4695 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 4696 | [ \$? -eq 1 ] && | 
|  | 4697 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4698 | 0 \ | 
|  | 4699 | -s "Async resume" \ | 
|  | 4700 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4701 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 4702 | -s "Successful connection" | 
|  | 4703 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4704 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4705 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4706 | run_test    "SSL async private: renegotiation: client-initiated; sign" \ | 
|  | 4707 | "$P_SRV \ | 
|  | 4708 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4709 | exchanges=2 renegotiation=1" \ | 
|  | 4710 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4711 | 0 \ | 
|  | 4712 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4713 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4714 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4715 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4717 | run_test    "SSL async private: renegotiation: server-initiated; sign" \ | 
|  | 4718 | "$P_SRV \ | 
|  | 4719 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4720 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4721 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 4722 | 0 \ | 
|  | 4723 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4724 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 4725 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4726 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4727 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 4728 | run_test    "SSL async private: renegotiation: client-initiated; decrypt" \ | 
|  | 4729 | "$P_SRV \ | 
|  | 4730 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4731 | exchanges=2 renegotiation=1" \ | 
|  | 4732 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 4733 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4734 | 0 \ | 
|  | 4735 | -s "Async decrypt callback: using key slot " \ | 
|  | 4736 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 4737 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 4738 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 4739 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 4740 | run_test    "SSL async private: renegotiation: server-initiated; decrypt" \ | 
|  | 4741 | "$P_SRV \ | 
|  | 4742 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 4743 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 4744 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 4745 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 4746 | 0 \ | 
|  | 4747 | -s "Async decrypt callback: using key slot " \ | 
|  | 4748 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 4749 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4750 | # Tests for ECC extensions (rfc 4492) | 
|  | 4751 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4752 | requires_config_enabled MBEDTLS_AES_C | 
|  | 4753 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 4754 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 4755 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4756 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 4757 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4758 | "$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] | 4759 | 0 \ | 
|  | 4760 | -C "client hello, adding supported_elliptic_curves extension" \ | 
|  | 4761 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 4762 | -S "found supported elliptic curves extension" \ | 
|  | 4763 | -S "found supported point formats extension" | 
|  | 4764 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4765 | requires_config_enabled MBEDTLS_AES_C | 
|  | 4766 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 4767 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 4768 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4769 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4770 | "$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] | 4771 | "$P_CLI debug_level=3" \ | 
|  | 4772 | 0 \ | 
|  | 4773 | -C "found supported_point_formats extension" \ | 
|  | 4774 | -S "server hello, supported_point_formats extension" | 
|  | 4775 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4776 | requires_config_enabled MBEDTLS_AES_C | 
|  | 4777 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 4778 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 4779 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4780 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 4781 | "$P_SRV debug_level=3" \ | 
|  | 4782 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4783 | 0 \ | 
|  | 4784 | -c "client hello, adding supported_elliptic_curves extension" \ | 
|  | 4785 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 4786 | -s "found supported elliptic curves extension" \ | 
|  | 4787 | -s "found supported point formats extension" | 
|  | 4788 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 4789 | requires_config_enabled MBEDTLS_AES_C | 
|  | 4790 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 4791 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 4792 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 4793 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 4794 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 4795 | "$P_CLI debug_level=3" \ | 
|  | 4796 | 0 \ | 
|  | 4797 | -c "found supported_point_formats extension" \ | 
|  | 4798 | -s "server hello, supported_point_formats extension" | 
|  | 4799 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4800 | # Tests for DTLS HelloVerifyRequest | 
|  | 4801 |  | 
|  | 4802 | run_test    "DTLS cookie: enabled" \ | 
|  | 4803 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 4804 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4805 | 0 \ | 
|  | 4806 | -s "cookie verification failed" \ | 
|  | 4807 | -s "cookie verification passed" \ | 
|  | 4808 | -S "cookie verification skipped" \ | 
|  | 4809 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4810 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4811 | -S "SSL - The requested feature is not available" | 
|  | 4812 |  | 
|  | 4813 | run_test    "DTLS cookie: disabled" \ | 
|  | 4814 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 4815 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4816 | 0 \ | 
|  | 4817 | -S "cookie verification failed" \ | 
|  | 4818 | -S "cookie verification passed" \ | 
|  | 4819 | -s "cookie verification skipped" \ | 
|  | 4820 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4821 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4822 | -S "SSL - The requested feature is not available" | 
|  | 4823 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4824 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 4825 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 4826 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 4827 | 1 \ | 
|  | 4828 | -s "cookie verification failed" \ | 
|  | 4829 | -S "cookie verification passed" \ | 
|  | 4830 | -S "cookie verification skipped" \ | 
|  | 4831 | -C "received hello verify request" \ | 
|  | 4832 | -S "hello verification requested" \ | 
|  | 4833 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4834 |  | 
|  | 4835 | requires_ipv6 | 
|  | 4836 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 4837 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 4838 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 4839 | 0 \ | 
|  | 4840 | -s "cookie verification failed" \ | 
|  | 4841 | -s "cookie verification passed" \ | 
|  | 4842 | -S "cookie verification skipped" \ | 
|  | 4843 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4844 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4845 | -S "SSL - The requested feature is not available" | 
|  | 4846 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4847 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 4848 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 4849 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 4850 | 0 \ | 
|  | 4851 | -s "cookie verification failed" \ | 
|  | 4852 | -s "cookie verification passed" \ | 
|  | 4853 | -S "cookie verification skipped" \ | 
|  | 4854 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 4855 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 4856 | -S "SSL - The requested feature is not available" | 
|  | 4857 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4858 | # Tests for client reconnecting from the same port with DTLS | 
|  | 4859 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4860 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4861 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4862 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 4863 | "$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] | 4864 | 0 \ | 
|  | 4865 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4866 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4867 | -S "Client initiated reconnection from same port" | 
|  | 4868 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4869 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4870 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4871 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ | 
|  | 4872 | "$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] | 4873 | 0 \ | 
|  | 4874 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4875 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4876 | -s "Client initiated reconnection from same port" | 
|  | 4877 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4878 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 4879 | 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] | 4880 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 4881 | "$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] | 4882 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4883 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 4884 | -s "Client initiated reconnection from same port" | 
|  | 4885 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 4886 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 4887 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 4888 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 4889 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 4890 | 0 \ | 
|  | 4891 | -S "The operation timed out" \ | 
|  | 4892 | -s "Client initiated reconnection from same port" | 
|  | 4893 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4894 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 4895 | "$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] | 4896 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 4897 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 4898 | -s "The operation timed out" \ | 
|  | 4899 | -S "Client initiated reconnection from same port" | 
|  | 4900 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4901 | # Tests for various cases of client authentication with DTLS | 
|  | 4902 | # (focused on handshake flows and message parsing) | 
|  | 4903 |  | 
|  | 4904 | run_test    "DTLS client auth: required" \ | 
|  | 4905 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 4906 | "$P_CLI dtls=1" \ | 
|  | 4907 | 0 \ | 
|  | 4908 | -s "Verifying peer X.509 certificate... ok" | 
|  | 4909 |  | 
|  | 4910 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 4911 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 4912 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 4913 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4914 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4915 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4916 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4917 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 4918 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 4919 | 0 \ | 
|  | 4920 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4921 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 4922 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 4923 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 4924 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 4925 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 4926 | 1 \ | 
|  | 4927 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 4928 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 4929 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 4930 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 4931 |  | 
|  | 4932 | requires_gnutls | 
|  | 4933 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 4934 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 4935 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4936 | 0 \ | 
|  | 4937 | -C "found fragmented DTLS handshake message" \ | 
|  | 4938 | -C "error" | 
|  | 4939 |  | 
|  | 4940 | requires_gnutls | 
|  | 4941 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 4942 | "$G_SRV -u --mtu 512" \ | 
|  | 4943 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4944 | 0 \ | 
|  | 4945 | -c "found fragmented DTLS handshake message" \ | 
|  | 4946 | -C "error" | 
|  | 4947 |  | 
|  | 4948 | requires_gnutls | 
|  | 4949 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 4950 | "$G_SRV -u --mtu 128" \ | 
|  | 4951 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4952 | 0 \ | 
|  | 4953 | -c "found fragmented DTLS handshake message" \ | 
|  | 4954 | -C "error" | 
|  | 4955 |  | 
|  | 4956 | requires_gnutls | 
|  | 4957 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 4958 | "$G_SRV -u --mtu 128" \ | 
|  | 4959 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 4960 | 0 \ | 
|  | 4961 | -c "found fragmented DTLS handshake message" \ | 
|  | 4962 | -C "error" | 
|  | 4963 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4964 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4965 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4966 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 4967 | "$G_SRV -u --mtu 256" \ | 
|  | 4968 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 4969 | 0 \ | 
|  | 4970 | -c "found fragmented DTLS handshake message" \ | 
|  | 4971 | -c "client hello, adding renegotiation extension" \ | 
|  | 4972 | -c "found renegotiation extension" \ | 
|  | 4973 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4974 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4975 | -C "error" \ | 
|  | 4976 | -s "Extra-header:" | 
|  | 4977 |  | 
|  | 4978 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4979 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4980 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 4981 | "$G_SRV -u --mtu 256" \ | 
|  | 4982 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 4983 | 0 \ | 
|  | 4984 | -c "found fragmented DTLS handshake message" \ | 
|  | 4985 | -c "client hello, adding renegotiation extension" \ | 
|  | 4986 | -c "found renegotiation extension" \ | 
|  | 4987 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4988 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 4989 | -C "error" \ | 
|  | 4990 | -s "Extra-header:" | 
|  | 4991 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4992 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 4993 | "$O_SRV -dtls1 -mtu 2048" \ | 
|  | 4994 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 4995 | 0 \ | 
|  | 4996 | -C "found fragmented DTLS handshake message" \ | 
|  | 4997 | -C "error" | 
|  | 4998 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 4999 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 5000 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5001 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 5002 | 0 \ | 
|  | 5003 | -c "found fragmented DTLS handshake message" \ | 
|  | 5004 | -C "error" | 
|  | 5005 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5006 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5007 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 5008 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 5009 | 0 \ | 
|  | 5010 | -c "found fragmented DTLS handshake message" \ | 
|  | 5011 | -C "error" | 
|  | 5012 |  | 
|  | 5013 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 5014 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 5015 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 5016 | 0 \ | 
|  | 5017 | -c "found fragmented DTLS handshake message" \ | 
|  | 5018 | -C "error" | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5019 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5020 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 5021 | # | 
|  | 5022 | # Use client auth when we need the client to send large messages, | 
|  | 5023 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 5024 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 5025 | # Sizes reached (UDP payload): | 
|  | 5026 | # - 2037B for server certificate | 
|  | 5027 | # - 1542B for client certificate | 
|  | 5028 | # - 1013B for newsessionticket | 
|  | 5029 | # - all others below 512B | 
|  | 5030 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 5031 |  | 
|  | 5032 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5033 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5034 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5035 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 5036 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 5037 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5038 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5039 | key_file=data_files/server7.key \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5040 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5041 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5042 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5043 | key_file=data_files/server8.key \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5044 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5045 | 0 \ | 
|  | 5046 | -S "found fragmented DTLS handshake message" \ | 
|  | 5047 | -C "found fragmented DTLS handshake message" \ | 
|  | 5048 | -C "error" | 
|  | 5049 |  | 
|  | 5050 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5051 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5052 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5053 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5054 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5055 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5056 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5057 | key_file=data_files/server7.key \ | 
|  | 5058 | max_frag_len=1024" \ | 
|  | 5059 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5060 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5061 | key_file=data_files/server8.key \ | 
|  | 5062 | max_frag_len=2048" \ | 
|  | 5063 | 0 \ | 
|  | 5064 | -S "found fragmented DTLS handshake message" \ | 
|  | 5065 | -c "found fragmented DTLS handshake message" \ | 
|  | 5066 | -C "error" | 
|  | 5067 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5068 | # With the MFL extension, the server has no way of forcing | 
|  | 5069 | # the client to not exceed a certain MTU; hence, the following | 
|  | 5070 | # test can't be replicated with an MTU proxy such as the one | 
|  | 5071 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5072 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5073 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5074 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5075 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5076 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5077 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5078 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5079 | key_file=data_files/server7.key \ | 
|  | 5080 | max_frag_len=512" \ | 
|  | 5081 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5082 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5083 | key_file=data_files/server8.key \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 5084 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5085 | 0 \ | 
|  | 5086 | -S "found fragmented DTLS handshake message" \ | 
|  | 5087 | -c "found fragmented DTLS handshake message" \ | 
|  | 5088 | -C "error" | 
|  | 5089 |  | 
|  | 5090 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5091 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5092 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5093 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5094 | 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] | 5095 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 5096 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5097 | key_file=data_files/server7.key \ | 
|  | 5098 | max_frag_len=2048" \ | 
|  | 5099 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5100 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5101 | key_file=data_files/server8.key \ | 
|  | 5102 | max_frag_len=512" \ | 
|  | 5103 | 0 \ | 
|  | 5104 | -S "found fragmented DTLS handshake message" \ | 
|  | 5105 | -c "found fragmented DTLS handshake message" \ | 
|  | 5106 | -C "error" | 
|  | 5107 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5108 | # While not required by the standard defining the MFL extension | 
|  | 5109 | # (according to which it only applies to records, not to datagrams), | 
|  | 5110 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 5111 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 5112 | # to the peer. | 
|  | 5113 | # The next test checks that no datagrams significantly larger than the | 
|  | 5114 | # negotiated MFL are sent. | 
|  | 5115 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5116 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5117 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5118 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 5119 | run_test    "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ | 
|  | 5120 | -p "$P_PXY mtu=560" \ | 
|  | 5121 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 5122 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5123 | key_file=data_files/server7.key \ | 
|  | 5124 | max_frag_len=2048" \ | 
|  | 5125 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5126 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5127 | key_file=data_files/server8.key \ | 
|  | 5128 | max_frag_len=512" \ | 
|  | 5129 | 0 \ | 
|  | 5130 | -S "found fragmented DTLS handshake message" \ | 
|  | 5131 | -c "found fragmented DTLS handshake message" \ | 
|  | 5132 | -C "error" | 
|  | 5133 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5134 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5135 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5136 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5137 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5138 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5139 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5140 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5141 | key_file=data_files/server7.key \ | 
|  | 5142 | max_frag_len=2048" \ | 
|  | 5143 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5144 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5145 | key_file=data_files/server8.key \ | 
|  | 5146 | max_frag_len=512" \ | 
|  | 5147 | 0 \ | 
|  | 5148 | -s "found fragmented DTLS handshake message" \ | 
|  | 5149 | -c "found fragmented DTLS handshake message" \ | 
|  | 5150 | -C "error" | 
|  | 5151 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 5152 | # While not required by the standard defining the MFL extension | 
|  | 5153 | # (according to which it only applies to records, not to datagrams), | 
|  | 5154 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 5155 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 5156 | # to the peer. | 
|  | 5157 | # The next test checks that no datagrams significantly larger than the | 
|  | 5158 | # negotiated MFL are sent. | 
|  | 5159 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5160 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5161 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5162 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 5163 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
|  | 5164 | -p "$P_PXY mtu=560" \ | 
|  | 5165 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5166 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5167 | key_file=data_files/server7.key \ | 
|  | 5168 | max_frag_len=2048" \ | 
|  | 5169 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5170 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5171 | key_file=data_files/server8.key \ | 
|  | 5172 | max_frag_len=512" \ | 
|  | 5173 | 0 \ | 
|  | 5174 | -s "found fragmented DTLS handshake message" \ | 
|  | 5175 | -c "found fragmented DTLS handshake message" \ | 
|  | 5176 | -C "error" | 
|  | 5177 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5178 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5179 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5180 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5181 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 5182 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5183 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5184 | key_file=data_files/server7.key \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5185 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5186 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5187 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5188 | key_file=data_files/server8.key \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5189 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5190 | 0 \ | 
|  | 5191 | -S "found fragmented DTLS handshake message" \ | 
|  | 5192 | -C "found fragmented DTLS handshake message" \ | 
|  | 5193 | -C "error" | 
|  | 5194 |  | 
|  | 5195 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5196 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5197 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5198 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 5199 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5200 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5201 | key_file=data_files/server7.key \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5202 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5203 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5204 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5205 | key_file=data_files/server8.key \ | 
|  | 5206 | mtu=512" \ | 
|  | 5207 | 0 \ | 
|  | 5208 | -s "found fragmented DTLS handshake message" \ | 
|  | 5209 | -C "found fragmented DTLS handshake message" \ | 
|  | 5210 | -C "error" | 
|  | 5211 |  | 
|  | 5212 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5213 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5214 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5215 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 5216 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5217 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5218 | key_file=data_files/server7.key \ | 
|  | 5219 | mtu=512" \ | 
|  | 5220 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5221 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5222 | key_file=data_files/server8.key \ | 
|  | 5223 | mtu=2048" \ | 
|  | 5224 | 0 \ | 
|  | 5225 | -S "found fragmented DTLS handshake message" \ | 
|  | 5226 | -c "found fragmented DTLS handshake message" \ | 
|  | 5227 | -C "error" | 
|  | 5228 |  | 
|  | 5229 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5230 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5231 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5232 | run_test    "DTLS fragmenting: both (MTU)" \ | 
| Manuel Pégourié-Gonnard | 4532329 | 2018-08-20 11:52:24 +0200 | [diff] [blame] | 5233 | -p "$P_PXY mtu=512" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 5234 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5235 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5236 | key_file=data_files/server7.key \ | 
|  | 5237 | mtu=512" \ | 
|  | 5238 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5239 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5240 | key_file=data_files/server8.key \ | 
|  | 5241 | mtu=512" \ | 
|  | 5242 | 0 \ | 
|  | 5243 | -s "found fragmented DTLS handshake message" \ | 
|  | 5244 | -c "found fragmented DTLS handshake message" \ | 
|  | 5245 | -C "error" | 
|  | 5246 |  | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 5247 | # Test for automatic MTU reduction on repeated resend | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 5248 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 5249 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5250 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5251 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5252 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction" \ | 
|  | 5253 | -p "$P_PXY mtu=508" \ | 
|  | 5254 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5255 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5256 | key_file=data_files/server7.key\ | 
|  | 5257 | hs_timeout=100-400" \ | 
|  | 5258 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5259 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5260 | key_file=data_files/server8.key \ | 
|  | 5261 | hs_timeout=100-400" \ | 
|  | 5262 | 0 \ | 
|  | 5263 | -s "found fragmented DTLS handshake message" \ | 
|  | 5264 | -c "found fragmented DTLS handshake message" \ | 
|  | 5265 | -C "error" | 
|  | 5266 |  | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 5267 | only_with_valgrind | 
|  | 5268 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5269 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5270 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5271 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction" \ | 
|  | 5272 | -p "$P_PXY mtu=508" \ | 
|  | 5273 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5274 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5275 | key_file=data_files/server7.key\ | 
|  | 5276 | hs_timeout=250-10000" \ | 
|  | 5277 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5278 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5279 | key_file=data_files/server8.key \ | 
|  | 5280 | hs_timeout=250-10000" \ | 
|  | 5281 | 0 \ | 
|  | 5282 | -s "found fragmented DTLS handshake message" \ | 
|  | 5283 | -c "found fragmented DTLS handshake message" \ | 
|  | 5284 | -C "error" | 
|  | 5285 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5286 | # 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] | 5287 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 5288 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5289 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5290 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5291 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5292 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5293 | run_test    "DTLS fragmenting: proxy MTU, simple handshake" \ | 
|  | 5294 | -p "$P_PXY mtu=512" \ | 
|  | 5295 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5296 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5297 | key_file=data_files/server7.key \ | 
|  | 5298 | mtu=512" \ | 
|  | 5299 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5300 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5301 | key_file=data_files/server8.key \ | 
|  | 5302 | mtu=512" \ | 
|  | 5303 | 0 \ | 
|  | 5304 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5305 | -s "found fragmented DTLS handshake message" \ | 
|  | 5306 | -c "found fragmented DTLS handshake message" \ | 
|  | 5307 | -C "error" | 
|  | 5308 |  | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5309 | not_with_valgrind # spurious resend due to timeout | 
|  | 5310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5311 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5312 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5313 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio" \ | 
|  | 5314 | -p "$P_PXY mtu=512" \ | 
|  | 5315 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5316 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5317 | key_file=data_files/server7.key \ | 
|  | 5318 | mtu=512 nbio=2" \ | 
|  | 5319 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5320 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5321 | key_file=data_files/server8.key \ | 
|  | 5322 | mtu=512 nbio=2" \ | 
|  | 5323 | 0 \ | 
|  | 5324 | -S "resend" \ | 
|  | 5325 | -s "found fragmented DTLS handshake message" \ | 
|  | 5326 | -c "found fragmented DTLS handshake message" \ | 
|  | 5327 | -C "error" | 
|  | 5328 |  | 
| Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 5329 | # This ensures things still work after session_reset(). | 
|  | 5330 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5331 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 5332 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 5333 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Hanno Becker | 5bcf2b0 | 2018-08-21 14:25:40 +0100 | [diff] [blame] | 5334 | # A resend on the client-side might happen if the server is | 
|  | 5335 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5336 | # reco_delay avoids races where the client reconnects before the server has | 
|  | 5337 | # resumed listening, which would result in a spurious resend. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5338 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5340 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5341 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5342 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 5343 | -p "$P_PXY mtu=1450" \ | 
|  | 5344 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5345 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5346 | key_file=data_files/server7.key \ | 
|  | 5347 | mtu=1450" \ | 
|  | 5348 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5349 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5350 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 5351 | mtu=1450 reconnect=1 reco_delay=1" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5352 | 0 \ | 
|  | 5353 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 5354 | -s "found fragmented DTLS handshake message" \ | 
|  | 5355 | -c "found fragmented DTLS handshake message" \ | 
|  | 5356 | -C "error" | 
|  | 5357 |  | 
| Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5358 | # A resend on the client-side might happen if the server is | 
|  | 5359 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5360 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5361 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5362 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5363 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5364 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 5365 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 5366 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 5367 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
|  | 5368 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 5369 | -p "$P_PXY mtu=512" \ | 
|  | 5370 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5371 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5372 | key_file=data_files/server7.key \ | 
|  | 5373 | exchanges=2 renegotiation=1 \ | 
|  | 5374 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ | 
|  | 5375 | mtu=512" \ | 
|  | 5376 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5377 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5378 | key_file=data_files/server8.key \ | 
|  | 5379 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 5380 | mtu=512" \ | 
|  | 5381 | 0 \ | 
|  | 5382 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5383 | -s "found fragmented DTLS handshake message" \ | 
|  | 5384 | -c "found fragmented DTLS handshake message" \ | 
|  | 5385 | -C "error" | 
|  | 5386 |  | 
| Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5387 | # A resend on the client-side might happen if the server is | 
|  | 5388 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5389 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5390 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5391 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5392 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5393 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 5394 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 5395 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 5396 | requires_config_enabled MBEDTLS_AES_C | 
|  | 5397 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 5398 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 5399 | -p "$P_PXY mtu=512" \ | 
|  | 5400 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5401 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5402 | key_file=data_files/server7.key \ | 
|  | 5403 | exchanges=2 renegotiation=1 \ | 
|  | 5404 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 5405 | mtu=512" \ | 
|  | 5406 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5407 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5408 | key_file=data_files/server8.key \ | 
|  | 5409 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 5410 | mtu=512" \ | 
|  | 5411 | 0 \ | 
|  | 5412 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5413 | -s "found fragmented DTLS handshake message" \ | 
|  | 5414 | -c "found fragmented DTLS handshake message" \ | 
|  | 5415 | -C "error" | 
|  | 5416 |  | 
| Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5417 | # A resend on the client-side might happen if the server is | 
|  | 5418 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5419 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5420 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5421 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5422 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5423 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 5424 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 5425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 5426 | requires_config_enabled MBEDTLS_AES_C | 
|  | 5427 | requires_config_enabled MBEDTLS_CCM_C | 
|  | 5428 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
|  | 5429 | -p "$P_PXY mtu=512" \ | 
|  | 5430 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5431 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5432 | key_file=data_files/server7.key \ | 
|  | 5433 | exchanges=2 renegotiation=1 \ | 
|  | 5434 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
|  | 5435 | mtu=512" \ | 
|  | 5436 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5437 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5438 | key_file=data_files/server8.key \ | 
|  | 5439 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 5440 | mtu=512" \ | 
|  | 5441 | 0 \ | 
|  | 5442 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5443 | -s "found fragmented DTLS handshake message" \ | 
|  | 5444 | -c "found fragmented DTLS handshake message" \ | 
|  | 5445 | -C "error" | 
|  | 5446 |  | 
| Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5447 | # A resend on the client-side might happen if the server is | 
|  | 5448 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5449 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5450 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5451 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5452 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5453 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 5454 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 5455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 5456 | requires_config_enabled MBEDTLS_AES_C | 
|  | 5457 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 5458 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
|  | 5459 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
|  | 5460 | -p "$P_PXY mtu=512" \ | 
|  | 5461 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5462 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5463 | key_file=data_files/server7.key \ | 
|  | 5464 | exchanges=2 renegotiation=1 \ | 
|  | 5465 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
|  | 5466 | mtu=512" \ | 
|  | 5467 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5468 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5469 | key_file=data_files/server8.key \ | 
|  | 5470 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 5471 | mtu=512" \ | 
|  | 5472 | 0 \ | 
|  | 5473 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5474 | -s "found fragmented DTLS handshake message" \ | 
|  | 5475 | -c "found fragmented DTLS handshake message" \ | 
|  | 5476 | -C "error" | 
|  | 5477 |  | 
| Hanno Becker | 175cb8f | 2018-08-21 17:00:10 +0100 | [diff] [blame] | 5478 | # A resend on the client-side might happen if the server is | 
|  | 5479 | # slow to reset, therefore omitting '-C "resend"' below. | 
| Manuel Pégourié-Gonnard | 0794d49 | 2018-08-17 10:54:24 +0200 | [diff] [blame] | 5480 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5482 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5483 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5484 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 5485 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 5486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 5487 | requires_config_enabled MBEDTLS_AES_C | 
|  | 5488 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 5489 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
|  | 5490 | -p "$P_PXY mtu=512" \ | 
|  | 5491 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5492 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5493 | key_file=data_files/server7.key \ | 
|  | 5494 | exchanges=2 renegotiation=1 \ | 
|  | 5495 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
|  | 5496 | mtu=512" \ | 
|  | 5497 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5498 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5499 | key_file=data_files/server8.key \ | 
|  | 5500 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 5501 | mtu=512" \ | 
|  | 5502 | 0 \ | 
|  | 5503 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 5504 | -s "found fragmented DTLS handshake message" \ | 
|  | 5505 | -c "found fragmented DTLS handshake message" \ | 
|  | 5506 | -C "error" | 
|  | 5507 |  | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5508 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5509 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5510 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5511 | client_needs_more_time 2 | 
|  | 5512 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 5513 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5514 | "$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] | 5515 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5516 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5517 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5518 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5519 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5520 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5521 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 5522 | 0 \ | 
|  | 5523 | -s "found fragmented DTLS handshake message" \ | 
|  | 5524 | -c "found fragmented DTLS handshake message" \ | 
|  | 5525 | -C "error" | 
|  | 5526 |  | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 5527 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5528 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5529 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5530 | client_needs_more_time 2 | 
|  | 5531 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 5532 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 5533 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 5534 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5535 | key_file=data_files/server7.key \ | 
|  | 5536 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 5537 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5538 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5539 | key_file=data_files/server8.key \ | 
|  | 5540 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 5541 | 0 \ | 
|  | 5542 | -s "found fragmented DTLS handshake message" \ | 
|  | 5543 | -c "found fragmented DTLS handshake message" \ | 
|  | 5544 | -C "error" | 
|  | 5545 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5546 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 5547 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5548 | # here and below we just want to test that the we fragment in a way that | 
|  | 5549 | # pleases other implementations, so we don't need the peer to fragment | 
| Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5550 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5551 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5552 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5553 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5555 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5556 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 5557 | "$G_SRV -u" \ | 
|  | 5558 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5559 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5560 | key_file=data_files/server8.key \ | 
|  | 5561 | mtu=512 force_version=dtls1_2" \ | 
|  | 5562 | 0 \ | 
|  | 5563 | -c "fragmenting handshake message" \ | 
|  | 5564 | -C "error" | 
|  | 5565 |  | 
| Hanno Becker | f362c29 | 2018-08-20 12:40:23 +0100 | [diff] [blame] | 5566 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5567 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5568 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5569 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5570 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5571 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5572 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.0" \ | 
|  | 5573 | "$G_SRV -u" \ | 
|  | 5574 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5575 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5576 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5577 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5578 | 0 \ | 
|  | 5579 | -c "fragmenting handshake message" \ | 
|  | 5580 | -C "error" | 
|  | 5581 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 5582 | # We use --insecure for the GnuTLS client because it expects | 
|  | 5583 | # the hostname / IP it connects to to be the name used in the | 
|  | 5584 | # certificate obtained from the server. Here, however, it | 
|  | 5585 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 5586 | # as the server name in the certificate. This will make the | 
|  | 5587 | # certifiate validation fail, but passing --insecure makes | 
|  | 5588 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5589 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5590 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5591 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5593 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5594 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5595 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5596 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5597 | key_file=data_files/server7.key \ | 
|  | 5598 | mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5599 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5600 | 0 \ | 
|  | 5601 | -s "fragmenting handshake message" | 
|  | 5602 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 5603 | # See previous test for the reason to use --insecure | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5604 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5605 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5606 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 5608 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5609 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.0" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5610 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5611 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5612 | key_file=data_files/server7.key \ | 
|  | 5613 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5614 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 5615 | 0 \ | 
|  | 5616 | -s "fragmenting handshake message" | 
|  | 5617 |  | 
|  | 5618 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5619 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5620 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5621 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5622 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 5623 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 5624 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5625 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5626 | key_file=data_files/server8.key \ | 
|  | 5627 | mtu=512 force_version=dtls1_2" \ | 
|  | 5628 | 0 \ | 
|  | 5629 | -c "fragmenting handshake message" \ | 
|  | 5630 | -C "error" | 
|  | 5631 |  | 
|  | 5632 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5633 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5634 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 5636 | run_test    "DTLS fragmenting: openssl server, DTLS 1.0" \ | 
|  | 5637 | "$O_SRV -dtls1 -verify 10" \ | 
|  | 5638 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5639 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5640 | key_file=data_files/server8.key \ | 
|  | 5641 | mtu=512 force_version=dtls1" \ | 
|  | 5642 | 0 \ | 
|  | 5643 | -c "fragmenting handshake message" \ | 
|  | 5644 | -C "error" | 
|  | 5645 |  | 
|  | 5646 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5647 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5648 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5650 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 5651 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 5652 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5653 | key_file=data_files/server7.key \ | 
|  | 5654 | mtu=512 force_version=dtls1_2" \ | 
|  | 5655 | "$O_CLI -dtls1_2" \ | 
|  | 5656 | 0 \ | 
|  | 5657 | -s "fragmenting handshake message" | 
|  | 5658 |  | 
|  | 5659 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5660 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5661 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5662 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 5663 | run_test    "DTLS fragmenting: openssl client, DTLS 1.0" \ | 
|  | 5664 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 5665 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5666 | key_file=data_files/server7.key \ | 
|  | 5667 | mtu=512 force_version=dtls1" \ | 
|  | 5668 | "$O_CLI -dtls1" \ | 
|  | 5669 | 0 \ | 
|  | 5670 | -s "fragmenting handshake message" | 
|  | 5671 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5672 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 5673 | # | 
|  | 5674 | # again we just want to test that the we fragment in a way that | 
|  | 5675 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 5676 | requires_gnutls_next | 
|  | 5677 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5678 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5679 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5680 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5681 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5682 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 5683 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5684 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5685 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5686 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5687 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5688 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5689 | 0 \ | 
|  | 5690 | -c "fragmenting handshake message" \ | 
|  | 5691 | -C "error" | 
|  | 5692 |  | 
|  | 5693 | requires_gnutls_next | 
|  | 5694 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5695 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5696 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5698 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5699 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ | 
|  | 5700 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5701 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5702 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5703 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5704 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5705 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5706 | 0 \ | 
|  | 5707 | -c "fragmenting handshake message" \ | 
|  | 5708 | -C "error" | 
|  | 5709 |  | 
|  | 5710 | ## The two tests below are disabled due to a bug in GnuTLS client that causes | 
|  | 5711 | ## handshake failures when the NewSessionTicket message is lost, see | 
|  | 5712 | ## https://gitlab.com/gnutls/gnutls/issues/543 | 
|  | 5713 | ## We can re-enable them when a fixed version fo GnuTLS is available | 
|  | 5714 | ## and installed in our CI system. | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 5715 | skip_next_test | 
|  | 5716 | requires_gnutls | 
|  | 5717 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5718 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5719 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5721 | client_needs_more_time 4 | 
|  | 5722 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 5723 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5724 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 5725 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5726 | key_file=data_files/server7.key \ | 
|  | 5727 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 5728 | "$G_CLI -u --insecure 127.0.0.1" \ | 
|  | 5729 | 0 \ | 
|  | 5730 | -s "fragmenting handshake message" | 
|  | 5731 |  | 
|  | 5732 | skip_next_test | 
|  | 5733 | requires_gnutls | 
|  | 5734 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5735 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5736 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 5738 | client_needs_more_time 4 | 
|  | 5739 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ | 
|  | 5740 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5741 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 5742 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5743 | key_file=data_files/server7.key \ | 
|  | 5744 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
|  | 5745 | "$G_CLI -u --insecure 127.0.0.1" \ | 
|  | 5746 | 0 \ | 
|  | 5747 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5748 |  | 
|  | 5749 | ## Interop test with OpenSSL might triger a bug in recent versions (that | 
|  | 5750 | ## probably won't be fixed before 1.1.1X), so we use an old version that | 
|  | 5751 | ## doesn't have this bug, but unfortunately it doesn't have support for DTLS | 
|  | 5752 | ## 1.2 either, so the DTLS 1.2 tests are commented for now. | 
|  | 5753 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
|  | 5754 | ## They should be re-enabled (and the DTLS 1.0 switched back to a non-legacy | 
|  | 5755 | ## version of OpenSSL once a fixed version of OpenSSL is available) | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 5756 | skip_next_test | 
|  | 5757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5758 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5759 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5761 | client_needs_more_time 4 | 
|  | 5762 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 5763 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5764 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 5765 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 5766 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5767 | key_file=data_files/server8.key \ | 
|  | 5768 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 5769 | 0 \ | 
|  | 5770 | -c "fragmenting handshake message" \ | 
|  | 5771 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5772 |  | 
|  | 5773 | requires_openssl_legacy | 
|  | 5774 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5775 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5776 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5778 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5779 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ | 
|  | 5780 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5781 | "$O_LEGACY_SRV -dtls1 -verify 10" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5782 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5783 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 5784 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5785 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5786 | 0 \ | 
|  | 5787 | -c "fragmenting handshake message" \ | 
|  | 5788 | -C "error" | 
|  | 5789 |  | 
|  | 5790 | ## see comment on the previous-previous test | 
|  | 5791 | ## requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5792 | ## requires_config_enabled MBEDTLS_RSA_C | 
|  | 5793 | ## requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5794 | ## requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5795 | ## client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5796 | ## run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 5797 | ##             -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 5798 | ##             "$P_SRV dtls=1 debug_level=2 \ | 
|  | 5799 | ##              crt_file=data_files/server7_int-ca.crt \ | 
|  | 5800 | ##              key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5801 | ##              hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5802 | ##             "$O_CLI -dtls1_2" \ | 
|  | 5803 | ##             0 \ | 
|  | 5804 | ##             -s "fragmenting handshake message" | 
|  | 5805 |  | 
|  | 5806 | # -nbio is added to prevent s_client from blocking in case of duplicated | 
|  | 5807 | # messages at the end of the handshake | 
| Hanno Becker | 9829315 | 2018-08-17 16:10:47 +0100 | [diff] [blame] | 5808 | requires_openssl_legacy | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 5810 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 5811 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 5812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5813 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5814 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ | 
|  | 5815 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5816 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5817 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 5818 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 5819 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 5820 | "$O_LEGACY_CLI -nbio -dtls1" \ | 
|  | 5821 | 0 \ | 
|  | 5822 | -s "fragmenting handshake message" | 
|  | 5823 |  | 
| Manuel Pégourié-Gonnard | 7a66cbc | 2014-09-26 16:31:46 +0200 | [diff] [blame] | 5824 | # Tests for specific things with "unreliable" UDP connection | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5825 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5826 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5827 | run_test    "DTLS proxy: reference" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 5828 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5829 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 5830 | "$P_CLI dtls=1 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5831 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 5832 | -C "replayed record" \ | 
|  | 5833 | -S "replayed record" \ | 
|  | 5834 | -C "record from another epoch" \ | 
|  | 5835 | -S "record from another epoch" \ | 
|  | 5836 | -C "discarding invalid record" \ | 
|  | 5837 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5838 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5839 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5840 | -c "HTTP/1.0 200 OK" | 
|  | 5841 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5842 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5843 | run_test    "DTLS proxy: duplicate every packet" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5844 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5845 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 5846 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 5847 | 0 \ | 
| Manuel Pégourié-Gonnard | b47368a | 2014-09-24 13:29:58 +0200 | [diff] [blame] | 5848 | -c "replayed record" \ | 
|  | 5849 | -s "replayed record" \ | 
| Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5850 | -c "record from another epoch" \ | 
|  | 5851 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5852 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5853 | -s "Extra-header:" \ | 
|  | 5854 | -c "HTTP/1.0 200 OK" | 
|  | 5855 |  | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5856 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 5857 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5858 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 5859 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5860 | 0 \ | 
|  | 5861 | -c "replayed record" \ | 
|  | 5862 | -S "replayed record" \ | 
| Hanno Becker | 52c6dc6 | 2017-05-26 16:07:36 +0100 | [diff] [blame] | 5863 | -c "record from another epoch" \ | 
|  | 5864 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 5865 | -c "resend" \ | 
|  | 5866 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 2739313 | 2014-09-24 14:41:11 +0200 | [diff] [blame] | 5867 | -s "Extra-header:" \ | 
|  | 5868 | -c "HTTP/1.0 200 OK" | 
|  | 5869 |  | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5870 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5871 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5872 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 5873 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5874 | 0 \ | 
|  | 5875 | -c "next record in same datagram" \ | 
|  | 5876 | -s "next record in same datagram" | 
|  | 5877 |  | 
|  | 5878 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5879 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5880 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 5881 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 5882 | 0 \ | 
|  | 5883 | -c "next record in same datagram" \ | 
|  | 5884 | -s "next record in same datagram" | 
|  | 5885 |  | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5886 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 5887 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5888 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 5889 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5890 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5891 | -c "discarding invalid record (mac)" \ | 
|  | 5892 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5893 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5894 | -c "HTTP/1.0 200 OK" \ | 
|  | 5895 | -S "too many records with bad MAC" \ | 
|  | 5896 | -S "Verification of the message MAC failed" | 
|  | 5897 |  | 
|  | 5898 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 5899 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5900 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 5901 | "$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] | 5902 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5903 | -C "discarding invalid record (mac)" \ | 
|  | 5904 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5905 | -S "Extra-header:" \ | 
|  | 5906 | -C "HTTP/1.0 200 OK" \ | 
|  | 5907 | -s "too many records with bad MAC" \ | 
|  | 5908 | -s "Verification of the message MAC failed" | 
|  | 5909 |  | 
|  | 5910 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 5911 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5912 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 5913 | "$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] | 5914 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5915 | -c "discarding invalid record (mac)" \ | 
|  | 5916 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5917 | -s "Extra-header:" \ | 
|  | 5918 | -c "HTTP/1.0 200 OK" \ | 
|  | 5919 | -S "too many records with bad MAC" \ | 
|  | 5920 | -S "Verification of the message MAC failed" | 
|  | 5921 |  | 
|  | 5922 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 5923 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 5924 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 5925 | "$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] | 5926 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 5927 | -c "discarding invalid record (mac)" \ | 
|  | 5928 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 5929 | -s "Extra-header:" \ | 
|  | 5930 | -c "HTTP/1.0 200 OK" \ | 
|  | 5931 | -s "too many records with bad MAC" \ | 
|  | 5932 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5933 |  | 
|  | 5934 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 5935 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 5936 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 5937 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5938 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 5939 | -c "record from another epoch" \ | 
|  | 5940 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5941 | -s "Extra-header:" \ | 
|  | 5942 | -c "HTTP/1.0 200 OK" | 
|  | 5943 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 5944 | # Tests for reordering support with DTLS | 
|  | 5945 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5946 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 5947 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 5948 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 5949 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5950 | 0 \ | 
|  | 5951 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5952 | -c "Next handshake message has been buffered - load"\ | 
|  | 5953 | -S "Buffering HS message" \ | 
|  | 5954 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5955 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5956 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5957 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 5958 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 5959 |  | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 5960 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 5961 | -p "$P_PXY delay_srv=ServerHello" \ | 
|  | 5962 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 5963 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 5964 | 0 \ | 
|  | 5965 | -c "Buffering HS message" \ | 
|  | 5966 | -c "found fragmented DTLS handshake message"\ | 
|  | 5967 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 5968 | -c "Next handshake message has been buffered - load"\ | 
|  | 5969 | -S "Buffering HS message" \ | 
|  | 5970 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5971 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 5972 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5973 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 5974 | -S "Remember CCS message" | 
|  | 5975 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5976 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 5977 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 5978 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 5979 | # while keeping the ServerKeyExchange. | 
|  | 5980 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
|  | 5981 | 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] | 5982 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
|  | 5983 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 5984 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 5985 | 0 \ | 
|  | 5986 | -c "Buffering HS message" \ | 
|  | 5987 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5988 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 5989 | -S "Buffering HS message" \ | 
|  | 5990 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5991 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5992 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 5993 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 5994 | -S "Remember CCS message" | 
|  | 5995 |  | 
|  | 5996 | # The size constraints ensure that the delayed certificate message can't | 
|  | 5997 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 5998 | # when dropping it first. | 
|  | 5999 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 6000 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
|  | 6001 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 6002 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
|  | 6003 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 6004 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 6005 | 0 \ | 
|  | 6006 | -c "Buffering HS message" \ | 
|  | 6007 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 6008 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 6009 | -S "Buffering HS message" \ | 
|  | 6010 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6011 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 6012 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6013 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 6014 | -S "Remember CCS message" | 
|  | 6015 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6016 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 6017 | -p "$P_PXY delay_cli=Certificate" \ | 
|  | 6018 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2" \ | 
|  | 6019 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 6020 | 0 \ | 
|  | 6021 | -C "Buffering HS message" \ | 
|  | 6022 | -C "Next handshake message has been buffered - load"\ | 
|  | 6023 | -s "Buffering HS message" \ | 
|  | 6024 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6025 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6026 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6027 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6028 | -S "Remember CCS message" | 
|  | 6029 |  | 
|  | 6030 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 6031 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
|  | 6032 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 6033 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 6034 | 0 \ | 
|  | 6035 | -C "Buffering HS message" \ | 
|  | 6036 | -C "Next handshake message has been buffered - load"\ | 
|  | 6037 | -S "Buffering HS message" \ | 
|  | 6038 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6039 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6040 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6041 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6042 | -S "Remember CCS message" | 
|  | 6043 |  | 
|  | 6044 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 6045 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
|  | 6046 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 6047 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
|  | 6048 | 0 \ | 
|  | 6049 | -C "Buffering HS message" \ | 
|  | 6050 | -C "Next handshake message has been buffered - load"\ | 
|  | 6051 | -S "Buffering HS message" \ | 
|  | 6052 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6053 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6054 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 6055 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6056 | -s "Remember CCS message" | 
|  | 6057 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 6058 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6059 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | 8727304 | 2018-08-16 16:53:13 +0100 | [diff] [blame] | 6060 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2" \ | 
|  | 6061 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 6062 | 0 \ | 
|  | 6063 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 6064 | -s "Found buffered record from current epoch - load" \ | 
|  | 6065 | -c "Buffer record from epoch 1" \ | 
|  | 6066 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6067 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 6068 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 6069 | # from the server are delayed, so that the encrypted Finished message | 
|  | 6070 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 6071 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 6072 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 6073 | # This works only in very particular circumstances: | 
|  | 6074 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 6075 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 6076 | #   the encrypted Finished message. | 
|  | 6077 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 6078 | #   needs to be fragmented. | 
|  | 6079 | # - All messages sent by the server must be small enough to be either sent | 
|  | 6080 | #   without fragmentation or be reassembled within the bounds of | 
|  | 6081 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 6082 | #   handshake, omitting CRTs. | 
|  | 6083 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 | 
|  | 6084 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 | 
|  | 6085 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 6086 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ | 
|  | 6087 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ | 
|  | 6088 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 6089 | 0 \ | 
|  | 6090 | -s "Buffer record from epoch 1" \ | 
|  | 6091 | -s "Found buffered record from current epoch - load" \ | 
|  | 6092 | -c "Buffer record from epoch 1" \ | 
|  | 6093 | -C "Found buffered record from current epoch - load" \ | 
|  | 6094 | -c "Enough space available after freeing future epoch record" | 
|  | 6095 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 6096 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 6097 |  | 
|  | 6098 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6099 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 6100 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 6101 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6102 | psk=abc123" \ | 
|  | 6103 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
|  | 6104 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6105 | 0 \ | 
|  | 6106 | -s "Extra-header:" \ | 
|  | 6107 | -c "HTTP/1.0 200 OK" | 
|  | 6108 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6109 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6110 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 6111 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6112 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 6113 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6114 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 6115 | 0 \ | 
|  | 6116 | -s "Extra-header:" \ | 
|  | 6117 | -c "HTTP/1.0 200 OK" | 
|  | 6118 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6119 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6120 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 6121 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6122 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none" \ | 
|  | 6123 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6124 | 0 \ | 
|  | 6125 | -s "Extra-header:" \ | 
|  | 6126 | -c "HTTP/1.0 200 OK" | 
|  | 6127 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6128 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6129 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 6130 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6131 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=required" \ | 
|  | 6132 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6133 | 0 \ | 
|  | 6134 | -s "Extra-header:" \ | 
|  | 6135 | -c "HTTP/1.0 200 OK" | 
|  | 6136 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6137 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6138 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 6139 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6140 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1 auth_mode=none" \ | 
|  | 6141 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6142 | 0 \ | 
|  | 6143 | -s "Extra-header:" \ | 
|  | 6144 | -c "HTTP/1.0 200 OK" | 
|  | 6145 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6146 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 6147 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 6148 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6149 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1 auth_mode=required" \ | 
|  | 6150 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6151 | 0 \ | 
|  | 6152 | -s "Extra-header:" \ | 
|  | 6153 | -c "HTTP/1.0 200 OK" | 
|  | 6154 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6155 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6156 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 6157 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6158 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 nbio=2 tickets=1 \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6159 | auth_mode=required" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6160 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 nbio=2 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6161 | 0 \ | 
|  | 6162 | -s "Extra-header:" \ | 
|  | 6163 | -c "HTTP/1.0 200 OK" | 
|  | 6164 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6165 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6166 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 6167 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6168 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6169 | psk=abc123 debug_level=3" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6170 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 6171 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 6172 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6173 | 0 \ | 
|  | 6174 | -s "a session has been resumed" \ | 
|  | 6175 | -c "a session has been resumed" \ | 
|  | 6176 | -s "Extra-header:" \ | 
|  | 6177 | -c "HTTP/1.0 200 OK" | 
|  | 6178 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6179 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6180 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 6181 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6182 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6183 | psk=abc123 debug_level=3 nbio=2" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6184 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 6185 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ | 
|  | 6186 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 6187 | 0 \ | 
|  | 6188 | -s "a session has been resumed" \ | 
|  | 6189 | -c "a session has been resumed" \ | 
|  | 6190 | -s "Extra-header:" \ | 
|  | 6191 | -c "HTTP/1.0 200 OK" | 
|  | 6192 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6193 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6194 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6195 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6196 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6197 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6198 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6199 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6200 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 6201 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6202 | 0 \ | 
|  | 6203 | -c "=> renegotiate" \ | 
|  | 6204 | -s "=> renegotiate" \ | 
|  | 6205 | -s "Extra-header:" \ | 
|  | 6206 | -c "HTTP/1.0 200 OK" | 
|  | 6207 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6208 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6210 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 6211 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6212 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6213 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6214 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 6215 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6216 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6217 | 0 \ | 
|  | 6218 | -c "=> renegotiate" \ | 
|  | 6219 | -s "=> renegotiate" \ | 
|  | 6220 | -s "Extra-header:" \ | 
|  | 6221 | -c "HTTP/1.0 200 OK" | 
|  | 6222 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6223 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6224 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6225 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6227 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6228 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6229 | debug_level=2" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6230 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6231 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6232 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6233 | 0 \ | 
|  | 6234 | -c "=> renegotiate" \ | 
|  | 6235 | -s "=> renegotiate" \ | 
|  | 6236 | -s "Extra-header:" \ | 
|  | 6237 | -c "HTTP/1.0 200 OK" | 
|  | 6238 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6239 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6241 | 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] | 6242 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6243 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 auth_mode=none \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6244 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6245 | debug_level=2 nbio=2" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6246 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=250-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 6247 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 6248 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 6249 | 0 \ | 
|  | 6250 | -c "=> renegotiate" \ | 
|  | 6251 | -s "=> renegotiate" \ | 
|  | 6252 | -s "Extra-header:" \ | 
|  | 6253 | -c "HTTP/1.0 200 OK" | 
|  | 6254 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6255 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6256 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6257 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6258 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 6259 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6260 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6261 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 6262 | -c "HTTP/1.0 200 OK" | 
|  | 6263 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6264 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6265 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6266 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 6267 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 6268 | "$O_SRV -dtls1 -mtu 768" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6269 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6270 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6271 | -c "HTTP/1.0 200 OK" | 
|  | 6272 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6273 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6274 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6275 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 6276 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 6277 | "$O_SRV -dtls1 -mtu 768" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6278 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 nbio=2 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6279 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6280 | -c "HTTP/1.0 200 OK" | 
|  | 6281 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6282 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6283 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6284 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6285 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 6286 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 6287 | "$G_SRV -u --mtu 2048 -a" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6288 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6289 | 0 \ | 
|  | 6290 | -s "Extra-header:" \ | 
|  | 6291 | -c "Extra-header:" | 
|  | 6292 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6293 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6294 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6295 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6296 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 6297 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 6298 | "$G_SRV -u --mtu 512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6299 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000" \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 6300 | 0 \ | 
|  | 6301 | -s "Extra-header:" \ | 
|  | 6302 | -c "Extra-header:" | 
|  | 6303 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 6304 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6305 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 6306 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6307 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 6308 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 6309 | "$G_SRV -u --mtu 512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6310 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=250-60000 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 6311 | 0 \ | 
|  | 6312 | -s "Extra-header:" \ | 
|  | 6313 | -c "Extra-header:" | 
|  | 6314 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6315 | # Final report | 
|  | 6316 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6317 | echo "------------------------------------------------------------------------" | 
|  | 6318 |  | 
|  | 6319 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6320 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6321 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 6322 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6323 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 6324 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 6325 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 6326 |  | 
|  | 6327 | exit $FAILS |