Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 24 | if cd $( dirname $0 ); then :; else |
| 25 | echo "cd $( dirname $0 ) failed" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 29 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 30 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 31 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 32 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 33 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 34 | : ${GNUTLS_CLI:=gnutls-cli} |
| 35 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 36 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 37 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 38 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 39 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 41 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 44 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 45 | |
| 46 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 47 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 48 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 49 | else |
| 50 | O_LEGACY_SRV=false |
| 51 | O_LEGACY_CLI=false |
| 52 | fi |
| 53 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 54 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 55 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 56 | else |
| 57 | G_NEXT_SRV=false |
| 58 | fi |
| 59 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 60 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 61 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 62 | else |
| 63 | G_NEXT_CLI=false |
| 64 | fi |
| 65 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 66 | TESTS=0 |
| 67 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 68 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 69 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 70 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 72 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 73 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 74 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 75 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 76 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 77 | RUN_TEST_NUMBER='' |
| 78 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 79 | PRESERVE_LOGS=0 |
| 80 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 81 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 82 | # port which is this plus 10000. Each port number may be independently |
| 83 | # overridden by a command line option. |
| 84 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 85 | PXY_PORT=$((SRV_PORT + 10000)) |
| 86 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 87 | print_usage() { |
| 88 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 89 | printf " -h|--help\tPrint this help.\n" |
| 90 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 91 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 92 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 93 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 94 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 95 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 96 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 97 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 98 | printf " --seed\tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | get_options() { |
| 102 | while [ $# -gt 0 ]; do |
| 103 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 104 | -f|--filter) |
| 105 | shift; FILTER=$1 |
| 106 | ;; |
| 107 | -e|--exclude) |
| 108 | shift; EXCLUDE=$1 |
| 109 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | -m|--memcheck) |
| 111 | MEMCHECK=1 |
| 112 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 113 | -n|--number) |
| 114 | shift; RUN_TEST_NUMBER=$1 |
| 115 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 116 | -s|--show-numbers) |
| 117 | SHOW_TEST_NUMBER=1 |
| 118 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 119 | -p|--preserve-logs) |
| 120 | PRESERVE_LOGS=1 |
| 121 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 122 | --port) |
| 123 | shift; SRV_PORT=$1 |
| 124 | ;; |
| 125 | --proxy-port) |
| 126 | shift; PXY_PORT=$1 |
| 127 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 128 | --seed) |
| 129 | shift; SEED="$1" |
| 130 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | -h|--help) |
| 132 | print_usage |
| 133 | exit 0 |
| 134 | ;; |
| 135 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 136 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage |
| 138 | exit 1 |
| 139 | ;; |
| 140 | esac |
| 141 | shift |
| 142 | done |
| 143 | } |
| 144 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 145 | # Skip next test; use this macro to skip tests which are legitimate |
| 146 | # in theory and expected to be re-introduced at some point, but |
| 147 | # aren't expected to succeed at the moment due to problems outside |
| 148 | # our control (such as bugs in other TLS implementations). |
| 149 | skip_next_test() { |
| 150 | SKIP_NEXT="YES" |
| 151 | } |
| 152 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 153 | # skip next test if the flag is not enabled in config.h |
| 154 | requires_config_enabled() { |
| 155 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 156 | SKIP_NEXT="YES" |
| 157 | fi |
| 158 | } |
| 159 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 160 | # skip next test if the flag is enabled in config.h |
| 161 | requires_config_disabled() { |
| 162 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 163 | SKIP_NEXT="YES" |
| 164 | fi |
| 165 | } |
| 166 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 167 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 168 | # This function uses the query_config command line option to query the |
| 169 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 170 | # program. The command will always return a success value if the |
| 171 | # configuration is defined and the value will be printed to stdout. |
| 172 | # |
| 173 | # Note that if the configuration is not defined or is defined to nothing, |
| 174 | # the output of this function will be an empty string. |
| 175 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 179 | VAL="$( get_config_value_or_default "$1" )" |
| 180 | if [ -z "$VAL" ]; then |
| 181 | # Should never happen |
| 182 | echo "Mbed TLS configuration $1 is not defined" |
| 183 | exit 1 |
| 184 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 185 | SKIP_NEXT="YES" |
| 186 | fi |
| 187 | } |
| 188 | |
| 189 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 190 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 191 | if [ -z "$VAL" ]; then |
| 192 | # Should never happen |
| 193 | echo "Mbed TLS configuration $1 is not defined" |
| 194 | exit 1 |
| 195 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 196 | SKIP_NEXT="YES" |
| 197 | fi |
| 198 | } |
| 199 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 200 | requires_ciphersuite_enabled() { |
Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 201 | if [ -z "$($P_CLI --help | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 202 | SKIP_NEXT="YES" |
| 203 | fi |
| 204 | } |
| 205 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 206 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 207 | requires_openssl_with_fallback_scsv() { |
| 208 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 209 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 210 | then |
| 211 | OPENSSL_HAS_FBSCSV="YES" |
| 212 | else |
| 213 | OPENSSL_HAS_FBSCSV="NO" |
| 214 | fi |
| 215 | fi |
| 216 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 217 | SKIP_NEXT="YES" |
| 218 | fi |
| 219 | } |
| 220 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 221 | # skip next test if GnuTLS isn't available |
| 222 | requires_gnutls() { |
| 223 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 224 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 225 | GNUTLS_AVAILABLE="YES" |
| 226 | else |
| 227 | GNUTLS_AVAILABLE="NO" |
| 228 | fi |
| 229 | fi |
| 230 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 231 | SKIP_NEXT="YES" |
| 232 | fi |
| 233 | } |
| 234 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 235 | # skip next test if GnuTLS-next isn't available |
| 236 | requires_gnutls_next() { |
| 237 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 238 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 239 | GNUTLS_NEXT_AVAILABLE="YES" |
| 240 | else |
| 241 | GNUTLS_NEXT_AVAILABLE="NO" |
| 242 | fi |
| 243 | fi |
| 244 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 245 | SKIP_NEXT="YES" |
| 246 | fi |
| 247 | } |
| 248 | |
| 249 | # skip next test if OpenSSL-legacy isn't available |
| 250 | requires_openssl_legacy() { |
| 251 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 252 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 253 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 254 | else |
| 255 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 256 | fi |
| 257 | fi |
| 258 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 259 | SKIP_NEXT="YES" |
| 260 | fi |
| 261 | } |
| 262 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 263 | # skip next test if IPv6 isn't available on this host |
| 264 | requires_ipv6() { |
| 265 | if [ -z "${HAS_IPV6:-}" ]; then |
| 266 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 267 | SRV_PID=$! |
| 268 | sleep 1 |
| 269 | kill $SRV_PID >/dev/null 2>&1 |
| 270 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 271 | HAS_IPV6="NO" |
| 272 | else |
| 273 | HAS_IPV6="YES" |
| 274 | fi |
| 275 | rm -r $SRV_OUT |
| 276 | fi |
| 277 | |
| 278 | if [ "$HAS_IPV6" = "NO" ]; then |
| 279 | SKIP_NEXT="YES" |
| 280 | fi |
| 281 | } |
| 282 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 283 | # skip next test if it's i686 or uname is not available |
| 284 | requires_not_i686() { |
| 285 | if [ -z "${IS_I686:-}" ]; then |
| 286 | IS_I686="YES" |
| 287 | if which "uname" >/dev/null 2>&1; then |
| 288 | if [ -z "$(uname -a | grep i686)" ]; then |
| 289 | IS_I686="NO" |
| 290 | fi |
| 291 | fi |
| 292 | fi |
| 293 | if [ "$IS_I686" = "YES" ]; then |
| 294 | SKIP_NEXT="YES" |
| 295 | fi |
| 296 | } |
| 297 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 298 | # Calculate the input & output maximum content lengths set in the config |
| 299 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 300 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 301 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 302 | |
| 303 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 304 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 305 | fi |
| 306 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 307 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 308 | fi |
| 309 | |
| 310 | # skip the next test if the SSL output buffer is less than 16KB |
| 311 | requires_full_size_output_buffer() { |
| 312 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 313 | SKIP_NEXT="YES" |
| 314 | fi |
| 315 | } |
| 316 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 317 | # skip the next test if valgrind is in use |
| 318 | not_with_valgrind() { |
| 319 | if [ "$MEMCHECK" -gt 0 ]; then |
| 320 | SKIP_NEXT="YES" |
| 321 | fi |
| 322 | } |
| 323 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 324 | # skip the next test if valgrind is NOT in use |
| 325 | only_with_valgrind() { |
| 326 | if [ "$MEMCHECK" -eq 0 ]; then |
| 327 | SKIP_NEXT="YES" |
| 328 | fi |
| 329 | } |
| 330 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 331 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 332 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 333 | CLI_DELAY_FACTOR=$1 |
| 334 | } |
| 335 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 336 | # wait for the given seconds after the client finished in the next test |
| 337 | server_needs_more_time() { |
| 338 | SRV_DELAY_SECONDS=$1 |
| 339 | } |
| 340 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 341 | # print_name <name> |
| 342 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 343 | TESTS=$(( $TESTS + 1 )) |
| 344 | LINE="" |
| 345 | |
| 346 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 347 | LINE="$TESTS " |
| 348 | fi |
| 349 | |
| 350 | LINE="$LINE$1" |
| 351 | printf "$LINE " |
| 352 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 353 | for i in `seq 1 $LEN`; do printf '.'; done |
| 354 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 355 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | # fail <message> |
| 359 | fail() { |
| 360 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 361 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 362 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 363 | mv $SRV_OUT o-srv-${TESTS}.log |
| 364 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 365 | if [ -n "$PXY_CMD" ]; then |
| 366 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 367 | fi |
| 368 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 369 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 370 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 371 | echo " ! server output:" |
| 372 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 373 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 374 | echo " ! client output:" |
| 375 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 376 | if [ -n "$PXY_CMD" ]; then |
| 377 | echo " ! ========================================================" |
| 378 | echo " ! proxy output:" |
| 379 | cat o-pxy-${TESTS}.log |
| 380 | fi |
| 381 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 382 | fi |
| 383 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 384 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 385 | } |
| 386 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 387 | # is_polar <cmd_line> |
| 388 | is_polar() { |
| 389 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 390 | } |
| 391 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 392 | # openssl s_server doesn't have -www with DTLS |
| 393 | check_osrv_dtls() { |
| 394 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 395 | NEEDS_INPUT=1 |
| 396 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 397 | else |
| 398 | NEEDS_INPUT=0 |
| 399 | fi |
| 400 | } |
| 401 | |
| 402 | # provide input to commands that need it |
| 403 | provide_input() { |
| 404 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 405 | return |
| 406 | fi |
| 407 | |
| 408 | while true; do |
| 409 | echo "HTTP/1.0 200 OK" |
| 410 | sleep 1 |
| 411 | done |
| 412 | } |
| 413 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 414 | # has_mem_err <log_file_name> |
| 415 | has_mem_err() { |
| 416 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 417 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 418 | then |
| 419 | return 1 # false: does not have errors |
| 420 | else |
| 421 | return 0 # true: has errors |
| 422 | fi |
| 423 | } |
| 424 | |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 425 | # Wait for process $2 to be listening on port $1 |
| 426 | if type lsof >/dev/null 2>/dev/null; then |
| 427 | wait_server_start() { |
| 428 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 429 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 430 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 431 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 432 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 433 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 434 | # Make a tight loop, server normally takes less than 1s to start. |
| 435 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 436 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
| 437 | echo "SERVERSTART TIMEOUT" |
| 438 | echo "SERVERSTART TIMEOUT" >> $SRV_OUT |
| 439 | break |
| 440 | fi |
| 441 | # Linux and *BSD support decimal arguments to sleep. On other |
| 442 | # OSes this may be a tight loop. |
| 443 | sleep 0.1 2>/dev/null || true |
| 444 | done |
| 445 | } |
| 446 | else |
Gilles Peskine | a931265 | 2018-06-29 15:48:13 +0200 | [diff] [blame] | 447 | echo "Warning: lsof not available, wait_server_start = sleep" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 448 | wait_server_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 449 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 450 | } |
| 451 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 452 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 453 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 454 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 455 | # acceptable bounds |
| 456 | check_server_hello_time() { |
| 457 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 458 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 459 | # Get the Unix timestamp for now |
| 460 | CUR_TIME=$(date +'%s') |
| 461 | THRESHOLD_IN_SECS=300 |
| 462 | |
| 463 | # Check if the ServerHello time was printed |
| 464 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 465 | return 1 |
| 466 | fi |
| 467 | |
| 468 | # Check the time in ServerHello is within acceptable bounds |
| 469 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 470 | # The time in ServerHello is at least 5 minutes before now |
| 471 | return 1 |
| 472 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 473 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 474 | return 1 |
| 475 | else |
| 476 | return 0 |
| 477 | fi |
| 478 | } |
| 479 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 480 | # wait for client to terminate and set CLI_EXIT |
| 481 | # must be called right after starting the client |
| 482 | wait_client_done() { |
| 483 | CLI_PID=$! |
| 484 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 485 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 486 | CLI_DELAY_FACTOR=1 |
| 487 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 488 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 489 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 490 | |
| 491 | wait $CLI_PID |
| 492 | CLI_EXIT=$? |
| 493 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 494 | kill $DOG_PID >/dev/null 2>&1 |
| 495 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 496 | |
| 497 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 498 | |
| 499 | sleep $SRV_DELAY_SECONDS |
| 500 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 501 | } |
| 502 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 503 | # check if the given command uses dtls and sets global variable DTLS |
| 504 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 505 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 506 | DTLS=1 |
| 507 | else |
| 508 | DTLS=0 |
| 509 | fi |
| 510 | } |
| 511 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 512 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 513 | # Options: -s pattern pattern that must be present in server output |
| 514 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 515 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 516 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 517 | # -S pattern pattern that must be absent in server output |
| 518 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 519 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 520 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 521 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 522 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 523 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 524 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 525 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 526 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 527 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 528 | return |
| 529 | fi |
| 530 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 531 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 532 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 533 | # Do we only run numbered tests? |
| 534 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 535 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 536 | else |
| 537 | SKIP_NEXT="YES" |
| 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 540 | # does this test use a proxy? |
| 541 | if [ "X$1" = "X-p" ]; then |
| 542 | PXY_CMD="$2" |
| 543 | shift 2 |
| 544 | else |
| 545 | PXY_CMD="" |
| 546 | fi |
| 547 | |
| 548 | # get commands and client output |
| 549 | SRV_CMD="$1" |
| 550 | CLI_CMD="$2" |
| 551 | CLI_EXPECT="$3" |
| 552 | shift 3 |
| 553 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 554 | # Check if server forces ciphersuite |
| 555 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 556 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 557 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 558 | fi |
| 559 | |
| 560 | # Check if client forces ciphersuite |
| 561 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 562 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 563 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 564 | fi |
| 565 | |
| 566 | # should we skip? |
| 567 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 568 | SKIP_NEXT="NO" |
| 569 | echo "SKIP" |
| 570 | SKIPS=$(( $SKIPS + 1 )) |
| 571 | return |
| 572 | fi |
| 573 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 574 | # fix client port |
| 575 | if [ -n "$PXY_CMD" ]; then |
| 576 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 577 | else |
| 578 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 579 | fi |
| 580 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 581 | # update DTLS variable |
| 582 | detect_dtls "$SRV_CMD" |
| 583 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 584 | # prepend valgrind to our commands if active |
| 585 | if [ "$MEMCHECK" -gt 0 ]; then |
| 586 | if is_polar "$SRV_CMD"; then |
| 587 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 588 | fi |
| 589 | if is_polar "$CLI_CMD"; then |
| 590 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 591 | fi |
| 592 | fi |
| 593 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 594 | TIMES_LEFT=2 |
| 595 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 596 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 597 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 598 | # run the commands |
| 599 | if [ -n "$PXY_CMD" ]; then |
| 600 | echo "$PXY_CMD" > $PXY_OUT |
| 601 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 602 | PXY_PID=$! |
| 603 | # assume proxy starts faster than server |
| 604 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 605 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 606 | check_osrv_dtls |
| 607 | echo "$SRV_CMD" > $SRV_OUT |
| 608 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 609 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 610 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 611 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 612 | echo "$CLI_CMD" > $CLI_OUT |
| 613 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 614 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 615 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 616 | sleep 0.05 |
| 617 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 618 | # terminate the server (and the proxy) |
| 619 | kill $SRV_PID |
| 620 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 621 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 622 | if [ -n "$PXY_CMD" ]; then |
| 623 | kill $PXY_PID >/dev/null 2>&1 |
| 624 | wait $PXY_PID |
| 625 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 626 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 627 | # retry only on timeouts |
| 628 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 629 | printf "RETRY " |
| 630 | else |
| 631 | TIMES_LEFT=0 |
| 632 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 633 | done |
| 634 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 635 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 636 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 637 | # expected client exit to incorrectly succeed in case of catastrophic |
| 638 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 639 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 640 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 641 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 642 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 643 | return |
| 644 | fi |
| 645 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 646 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 647 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 648 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 649 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 650 | return |
| 651 | fi |
| 652 | fi |
| 653 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 654 | # check server exit code |
| 655 | if [ $? != 0 ]; then |
| 656 | fail "server fail" |
| 657 | return |
| 658 | fi |
| 659 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 661 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 662 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 663 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 664 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 665 | return |
| 666 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 667 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 668 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 669 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 670 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 671 | while [ $# -gt 0 ] |
| 672 | do |
| 673 | case $1 in |
| 674 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 675 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 676 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 677 | return |
| 678 | fi |
| 679 | ;; |
| 680 | |
| 681 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 682 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 683 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 684 | return |
| 685 | fi |
| 686 | ;; |
| 687 | |
| 688 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 689 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 690 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 691 | return |
| 692 | fi |
| 693 | ;; |
| 694 | |
| 695 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 696 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 697 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 698 | return |
| 699 | fi |
| 700 | ;; |
| 701 | |
| 702 | # The filtering in the following two options (-u and -U) do the following |
| 703 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 704 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 705 | # - keep one of each non-unique line |
| 706 | # - count how many lines remain |
| 707 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 708 | # if there were no duplicates. |
| 709 | "-U") |
| 710 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 711 | fail "lines following pattern '$2' must be unique in Server output" |
| 712 | return |
| 713 | fi |
| 714 | ;; |
| 715 | |
| 716 | "-u") |
| 717 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 718 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 719 | return |
| 720 | fi |
| 721 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 722 | "-F") |
| 723 | if ! $2 "$SRV_OUT"; then |
| 724 | fail "function call to '$2' failed on Server output" |
| 725 | return |
| 726 | fi |
| 727 | ;; |
| 728 | "-f") |
| 729 | if ! $2 "$CLI_OUT"; then |
| 730 | fail "function call to '$2' failed on Client output" |
| 731 | return |
| 732 | fi |
| 733 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 734 | |
| 735 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 736 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 737 | exit 1 |
| 738 | esac |
| 739 | shift 2 |
| 740 | done |
| 741 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 742 | # check valgrind's results |
| 743 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 744 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 745 | fail "Server has memory errors" |
| 746 | return |
| 747 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 748 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 749 | fail "Client has memory errors" |
| 750 | return |
| 751 | fi |
| 752 | fi |
| 753 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 754 | # if we're here, everything is ok |
| 755 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 756 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 757 | mv $SRV_OUT o-srv-${TESTS}.log |
| 758 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 759 | if [ -n "$PXY_CMD" ]; then |
| 760 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 761 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 762 | fi |
| 763 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 764 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 765 | } |
| 766 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 767 | run_test_psa() { |
| 768 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 769 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 770 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 771 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 772 | 0 \ |
| 773 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 774 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 775 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 776 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 777 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 778 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 779 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 780 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 781 | -C "Failed to setup PSA-based cipher context"\ |
| 782 | -S "Failed to setup PSA-based cipher context"\ |
| 783 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 784 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 785 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 786 | -S "error" \ |
| 787 | -C "error" |
| 788 | } |
| 789 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 790 | run_test_psa_force_curve() { |
| 791 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 792 | run_test "PSA - ECDH with $1" \ |
| 793 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 794 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 795 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 796 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 797 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 798 | -c "PSA calc verify" \ |
| 799 | -c "calc PSA finished" \ |
| 800 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 801 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 802 | -s "PSA calc verify" \ |
| 803 | -s "calc PSA finished" \ |
| 804 | -C "Failed to setup PSA-based cipher context"\ |
| 805 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 806 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 807 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 808 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 809 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 810 | -C "error" |
| 811 | } |
| 812 | |
| 813 | cleanup() { |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 814 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
| 815 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 816 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 817 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 818 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
| 819 | exit 1 |
| 820 | } |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 821 | |
| 822 | # |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 823 | # MAIN |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 824 | # |
| 825 | |
| 826 | get_options "$@" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 827 | |
| 828 | # sanity checks, avoid an avalanche of errors |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 829 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 830 | P_CLI_BIN="${P_CLI%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 831 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 832 | if [ ! -x "$P_SRV_BIN" ]; then |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 833 | echo "Command '$P_SRV_BIN' is not an executable file" |
| 834 | exit 1 |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 835 | fi |
| 836 | if [ ! -x "$P_CLI_BIN" ]; then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 837 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 838 | exit 1 |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 839 | fi |
| 840 | if [ ! -x "$P_PXY_BIN" ]; then |
| 841 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 842 | exit 1 |
| 843 | fi |
| 844 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 845 | if which valgrind >/dev/null 2>&1; then :; else |
| 846 | echo "Memcheck not possible. Valgrind not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 847 | exit 1 |
| 848 | fi |
| 849 | fi |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 850 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 851 | echo "Command '$OPENSSL_CMD' not found" |
| 852 | exit 1 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 853 | fi |
| 854 | |
| 855 | # used by watchdog |
| 856 | MAIN_PID="$$" |
| 857 | |
| 858 | # We use somewhat arbitrary delays for tests: |
| 859 | # - how long do we wait for the server to start (when lsof not available)? |
| 860 | # - how long do we allow for the client to finish? |
| 861 | # (not to check performance, just to avoid waiting indefinitely) |
| 862 | # Things are slower with valgrind, so give extra time here. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 863 | # |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 864 | # Note: without lsof, there is a trade-off between the running time of this |
| 865 | # script and the risk of spurious errors because we didn't wait long enough. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 866 | # The watchdog delay on the other hand doesn't affect normal running time of |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 867 | # the script, only the case where a client or server gets stuck. |
| 868 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 869 | START_DELAY=6 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 870 | DOG_DELAY=60 |
| 871 | else |
| 872 | START_DELAY=2 |
| 873 | DOG_DELAY=20 |
| 874 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 875 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 876 | # some particular tests need more time: |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 877 | # - for the client, we multiply the usual watchdog limit by a factor |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 878 | # - for the server, we sleep for a number of seconds after the client exits |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 879 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 880 | CLI_DELAY_FACTOR=1 |
| 881 | SRV_DELAY_SECONDS=0 |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 882 | |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 883 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 884 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 885 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 886 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 887 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 888 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 889 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 890 | G_SRV="$G_SRV -p $SRV_PORT" |
| 891 | G_CLI="$G_CLI -p +SRV_PORT" |
| 892 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 893 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 894 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 895 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 896 | fi |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 897 | |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 898 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 899 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 900 | fi |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 901 | |
| 902 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 903 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 904 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 905 | |
| 906 | # Allow SHA-1, because many of our test certificates use it |
| 907 | P_SRV="$P_SRV allow_sha1=1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 908 | P_CLI="$P_CLI allow_sha1=1" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 909 | |
| 910 | # Also pick a unique name for intermediate files |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 911 | SRV_OUT="srv_out.$$" |
| 912 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 913 | PXY_OUT="pxy_out.$$" |
| 914 | SESSION="session.$$" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 915 | |
| 916 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 917 | |
| 918 | trap cleanup INT TERM HUP |
| 919 | |
| 920 | # Basic test |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 921 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 922 | # Checks that: |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 923 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 924 | # - the expected (highest security) parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 925 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 926 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 927 | "$P_SRV debug_level=3" \ |
| 928 | "$P_CLI" \ |
| 929 | 0 \ |
| 930 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 931 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 932 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 933 | -s "ECDHE curve: secp521r1" \ |
| 934 | -S "error" \ |
| 935 | -C "error" |
| 936 | |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 937 | run_test "Default, DTLS" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 938 | "$P_SRV dtls=1" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 939 | "$P_CLI dtls=1" \ |
| 940 | 0 \ |
| 941 | -s "Protocol is DTLSv1.2" \ |
| 942 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 943 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 944 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 945 | run_test "CA callback on client" \ |
| 946 | "$P_SRV debug_level=3" \ |
| 947 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 948 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 949 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 950 | -S "error" \ |
| 951 | -C "error" |
| 952 | |
| 953 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 954 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 955 | requires_config_enabled MBEDTLS_ECDSA_C |
| 956 | requires_config_enabled MBEDTLS_SHA256_C |
| 957 | run_test "CA callback on server" \ |
| 958 | "$P_SRV auth_mode=required" \ |
| 959 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 960 | key_file=data_files/server5.key" \ |
| 961 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 962 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 963 | -s "Verifying peer X.509 certificate... ok" \ |
| 964 | -S "error" \ |
| 965 | -C "error" |
| 966 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 967 | # Test using an opaque private key for client authentication |
| 968 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 969 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 970 | requires_config_enabled MBEDTLS_ECDSA_C |
| 971 | requires_config_enabled MBEDTLS_SHA256_C |
| 972 | run_test "Opaque key for client authentication" \ |
| 973 | "$P_SRV auth_mode=required" \ |
| 974 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 975 | key_file=data_files/server5.key" \ |
| 976 | 0 \ |
| 977 | -c "key type: Opaque" \ |
| 978 | -s "Verifying peer X.509 certificate... ok" \ |
| 979 | -S "error" \ |
| 980 | -C "error" |
| 981 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 982 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 983 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 984 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 985 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 986 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 987 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 988 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 989 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 990 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 991 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 992 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 993 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 994 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 995 | run_test_psa_force_curve "secp521r1" |
| 996 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 997 | run_test_psa_force_curve "brainpoolP512r1" |
| 998 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 999 | run_test_psa_force_curve "secp384r1" |
| 1000 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1001 | run_test_psa_force_curve "brainpoolP384r1" |
| 1002 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1003 | run_test_psa_force_curve "secp256r1" |
| 1004 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1005 | run_test_psa_force_curve "secp256k1" |
| 1006 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1007 | run_test_psa_force_curve "brainpoolP256r1" |
| 1008 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1009 | run_test_psa_force_curve "secp224r1" |
| 1010 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1011 | run_test_psa_force_curve "secp224k1" |
| 1012 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1013 | run_test_psa_force_curve "secp192r1" |
| 1014 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1015 | run_test_psa_force_curve "secp192k1" |
| 1016 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1017 | # Test current time in ServerHello |
| 1018 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1019 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1020 | "$P_SRV debug_level=3" \ |
| 1021 | "$P_CLI debug_level=3" \ |
| 1022 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1023 | -f "check_server_hello_time" \ |
| 1024 | -F "check_server_hello_time" |
| 1025 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1026 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1027 | run_test "Unique IV in GCM" \ |
| 1028 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1029 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1030 | 0 \ |
| 1031 | -u "IV used" \ |
| 1032 | -U "IV used" |
| 1033 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1034 | # Tests for certificate verification callback |
| 1035 | run_test "Configuration-specific CRT verification callback" \ |
| 1036 | "$P_SRV debug_level=3" \ |
| 1037 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1038 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1039 | -S "error" \ |
| 1040 | -c "Verify requested for " \ |
| 1041 | -c "Use configuration-specific verification callback" \ |
| 1042 | -C "Use context-specific verification callback" \ |
| 1043 | -C "error" |
| 1044 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1045 | run_test "Context-specific CRT verification callback" \ |
| 1046 | "$P_SRV debug_level=3" \ |
| 1047 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1048 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1049 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1050 | -c "Verify requested for " \ |
| 1051 | -c "Use context-specific verification callback" \ |
| 1052 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1053 | -C "error" |
| 1054 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1055 | # Tests for rc4 option |
| 1056 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1057 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1058 | run_test "RC4: server disabled, client enabled" \ |
| 1059 | "$P_SRV" \ |
| 1060 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1061 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1062 | -s "SSL - The server has no ciphersuites in common" |
| 1063 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1064 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1065 | run_test "RC4: server half, client enabled" \ |
| 1066 | "$P_SRV arc4=1" \ |
| 1067 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1068 | 1 \ |
| 1069 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1070 | |
| 1071 | run_test "RC4: server enabled, client disabled" \ |
| 1072 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1073 | "$P_CLI" \ |
| 1074 | 1 \ |
| 1075 | -s "SSL - The server has no ciphersuites in common" |
| 1076 | |
| 1077 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1078 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1079 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1080 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1081 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1082 | -S "SSL - The server has no ciphersuites in common" |
| 1083 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1084 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1085 | |
| 1086 | requires_gnutls |
| 1087 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1088 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1089 | "$G_SRV"\ |
| 1090 | "$P_CLI force_version=tls1_1" \ |
| 1091 | 0 |
| 1092 | |
| 1093 | requires_gnutls |
| 1094 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1095 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1096 | "$G_SRV"\ |
| 1097 | "$P_CLI force_version=tls1" \ |
| 1098 | 0 |
| 1099 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1100 | # Tests for SHA-1 support |
| 1101 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1102 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1103 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1104 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1105 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1106 | 1 \ |
| 1107 | -c "The certificate is signed with an unacceptable hash" |
| 1108 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1109 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1110 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1111 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1112 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1113 | 0 |
| 1114 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1115 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1116 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1117 | "$P_CLI allow_sha1=1" \ |
| 1118 | 0 |
| 1119 | |
| 1120 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1121 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1122 | "$P_CLI allow_sha1=0" \ |
| 1123 | 0 |
| 1124 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1125 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1126 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1127 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1128 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1129 | 1 \ |
| 1130 | -s "The certificate is signed with an unacceptable hash" |
| 1131 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1132 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1133 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1134 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1135 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1136 | 0 |
| 1137 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1138 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1139 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1140 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1141 | 0 |
| 1142 | |
| 1143 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1144 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1145 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1146 | 0 |
| 1147 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1148 | # Tests for datagram packing |
| 1149 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1150 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1151 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1152 | 0 \ |
| 1153 | -c "next record in same datagram" \ |
| 1154 | -s "next record in same datagram" |
| 1155 | |
| 1156 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1157 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1158 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1159 | 0 \ |
| 1160 | -s "next record in same datagram" \ |
| 1161 | -C "next record in same datagram" |
| 1162 | |
| 1163 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1164 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1165 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1166 | 0 \ |
| 1167 | -S "next record in same datagram" \ |
| 1168 | -c "next record in same datagram" |
| 1169 | |
| 1170 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1171 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1172 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1173 | 0 \ |
| 1174 | -S "next record in same datagram" \ |
| 1175 | -C "next record in same datagram" |
| 1176 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1177 | # Tests for Truncated HMAC extension |
| 1178 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1179 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1180 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1181 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1182 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1183 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1184 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1185 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1187 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1188 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1189 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1190 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1191 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1192 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1193 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1194 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1195 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1196 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1197 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1198 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1199 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1200 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1201 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1202 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1203 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1204 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1205 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1206 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1207 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1208 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1209 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1210 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1211 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1212 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1213 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1214 | 0 \ |
| 1215 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1216 | -S "dumping 'expected mac' (10 bytes)" |
| 1217 | |
| 1218 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1219 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1220 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1221 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1222 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1223 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1224 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1225 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1226 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1227 | "$P_SRV dtls=1 debug_level=4" \ |
| 1228 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1229 | 0 \ |
| 1230 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1231 | -S "dumping 'expected mac' (10 bytes)" |
| 1232 | |
| 1233 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1234 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1235 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1236 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1237 | 0 \ |
| 1238 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1239 | -S "dumping 'expected mac' (10 bytes)" |
| 1240 | |
| 1241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1242 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1243 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1244 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1245 | 0 \ |
| 1246 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1247 | -S "dumping 'expected mac' (10 bytes)" |
| 1248 | |
| 1249 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1250 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1251 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1252 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1253 | 0 \ |
| 1254 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1255 | -S "dumping 'expected mac' (10 bytes)" |
| 1256 | |
| 1257 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1258 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1259 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1260 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=0" \ |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1261 | 0 \ |
| 1262 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1263 | -S "dumping 'expected mac' (10 bytes)" |
| 1264 | |
| 1265 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1266 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1267 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1268 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1269 | 0 \ |
| 1270 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1271 | -s "dumping 'expected mac' (10 bytes)" |
| 1272 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1273 | # Tests for DTLS Connection ID extension |
| 1274 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1275 | # So far, the CID API isn't implemented, so we can't |
| 1276 | # grep for output witnessing its use. This needs to be |
| 1277 | # changed once the CID extension is implemented. |
| 1278 | |
| 1279 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1280 | run_test "(STUB) Connection ID: Client enabled, server disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1281 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1282 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1283 | 0 \ |
| 1284 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1285 | -s "found CID extension" \ |
| 1286 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1287 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1288 | -c "client hello, adding CID extension" \ |
| 1289 | -S "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1290 | |
| 1291 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1292 | run_test "(STUB) Connection ID: Client disabled, server enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1293 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1294 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1295 | 0 \ |
| 1296 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1297 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1298 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1299 | -s "Enable use of CID extension." \ |
| 1300 | -S "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1301 | |
| 1302 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1303 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1304 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1305 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1306 | 0 \ |
| 1307 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1308 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1309 | -c "client hello, adding CID extension" \ |
| 1310 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1311 | -s "Use of CID extension negotiated" \ |
| 1312 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1313 | |
| 1314 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1315 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1316 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1317 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1318 | 0 \ |
| 1319 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1320 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1321 | -c "client hello, adding CID extension" \ |
| 1322 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1323 | -s "Use of CID extension negotiated" \ |
| 1324 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1325 | |
| 1326 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1327 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1328 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1329 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1330 | 0 \ |
| 1331 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1332 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1333 | -c "client hello, adding CID extension" \ |
| 1334 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1335 | -s "Use of CID extension negotiated" \ |
| 1336 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1337 | |
| 1338 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1339 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1340 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1341 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1342 | 0 \ |
| 1343 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1344 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1345 | -c "client hello, adding CID extension" \ |
| 1346 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1347 | -s "Use of CID extension negotiated" \ |
| 1348 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1349 | |
| 1350 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1351 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1352 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1353 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1354 | 0 \ |
| 1355 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1356 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1357 | -c "client hello, adding CID extension" \ |
| 1358 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1359 | -s "Use of CID extension negotiated" \ |
| 1360 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1361 | |
| 1362 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1363 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1364 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1365 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1366 | 0 \ |
| 1367 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1368 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1369 | -c "client hello, adding CID extension" \ |
| 1370 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1371 | -s "Use of CID extension negotiated" \ |
| 1372 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1373 | |
| 1374 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1375 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1376 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1377 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1378 | 0 \ |
| 1379 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1380 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1381 | -c "client hello, adding CID extension" \ |
| 1382 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1383 | -s "Use of CID extension negotiated" \ |
| 1384 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1385 | |
| 1386 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1387 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1388 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1389 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1390 | 0 \ |
| 1391 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1392 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1393 | -c "client hello, adding CID extension" \ |
| 1394 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1395 | -s "Use of CID extension negotiated" \ |
| 1396 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1397 | |
| 1398 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1399 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1400 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1401 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1402 | 0 \ |
| 1403 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1404 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1405 | -c "client hello, adding CID extension" \ |
| 1406 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1407 | -s "Use of CID extension negotiated" \ |
| 1408 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1409 | |
| 1410 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1411 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1412 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1413 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1414 | 0 \ |
| 1415 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1416 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1417 | -c "client hello, adding CID extension" \ |
| 1418 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1419 | -s "Use of CID extension negotiated" \ |
| 1420 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1421 | |
| 1422 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1423 | run_test "(STUB) Connection ID: Client+Server enabled, Server CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1424 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1425 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1426 | 0 \ |
| 1427 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1428 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1429 | -c "client hello, adding CID extension" \ |
| 1430 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1431 | -s "Use of CID extension negotiated" \ |
| 1432 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1433 | |
| 1434 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1435 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1436 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1437 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1438 | 0 \ |
| 1439 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1440 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1441 | -c "client hello, adding CID extension" \ |
| 1442 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1443 | -s "Use of CID extension negotiated" \ |
| 1444 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1445 | |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1446 | requires_config_enabled MBEDTLS_SSL_CID |
| 1447 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1448 | run_test "(STUB) Connection ID: Client+Server enabled, renegotiate" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1449 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1450 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1451 | 0 \ |
| 1452 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1453 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1454 | -c "client hello, adding CID extension" \ |
| 1455 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame^] | 1456 | -s "Use of CID extension negotiated" \ |
| 1457 | -s "server hello, adding CID extension" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1458 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1459 | # Tests for Encrypt-then-MAC extension |
| 1460 | |
| 1461 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1462 | "$P_SRV debug_level=3 \ |
| 1463 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1464 | "$P_CLI debug_level=3" \ |
| 1465 | 0 \ |
| 1466 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1467 | -s "found encrypt then mac extension" \ |
| 1468 | -s "server hello, adding encrypt then mac extension" \ |
| 1469 | -c "found encrypt_then_mac extension" \ |
| 1470 | -c "using encrypt then mac" \ |
| 1471 | -s "using encrypt then mac" |
| 1472 | |
| 1473 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1474 | "$P_SRV debug_level=3 etm=0 \ |
| 1475 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1476 | "$P_CLI debug_level=3 etm=1" \ |
| 1477 | 0 \ |
| 1478 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1479 | -s "found encrypt then mac extension" \ |
| 1480 | -S "server hello, adding encrypt then mac extension" \ |
| 1481 | -C "found encrypt_then_mac extension" \ |
| 1482 | -C "using encrypt then mac" \ |
| 1483 | -S "using encrypt then mac" |
| 1484 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1485 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1486 | "$P_SRV debug_level=3 etm=1 \ |
| 1487 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1488 | "$P_CLI debug_level=3 etm=1" \ |
| 1489 | 0 \ |
| 1490 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1491 | -s "found encrypt then mac extension" \ |
| 1492 | -S "server hello, adding encrypt then mac extension" \ |
| 1493 | -C "found encrypt_then_mac extension" \ |
| 1494 | -C "using encrypt then mac" \ |
| 1495 | -S "using encrypt then mac" |
| 1496 | |
| 1497 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1498 | "$P_SRV debug_level=3 etm=1 \ |
| 1499 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1500 | "$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] | 1501 | 0 \ |
| 1502 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1503 | -s "found encrypt then mac extension" \ |
| 1504 | -S "server hello, adding encrypt then mac extension" \ |
| 1505 | -C "found encrypt_then_mac extension" \ |
| 1506 | -C "using encrypt then mac" \ |
| 1507 | -S "using encrypt then mac" |
| 1508 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1509 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1510 | "$P_SRV debug_level=3 etm=1 \ |
| 1511 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1512 | "$P_CLI debug_level=3 etm=0" \ |
| 1513 | 0 \ |
| 1514 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1515 | -S "found encrypt then mac extension" \ |
| 1516 | -S "server hello, adding encrypt then mac extension" \ |
| 1517 | -C "found encrypt_then_mac extension" \ |
| 1518 | -C "using encrypt then mac" \ |
| 1519 | -S "using encrypt then mac" |
| 1520 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1521 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1522 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1523 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1524 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1525 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1526 | 0 \ |
| 1527 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1528 | -S "found encrypt then mac extension" \ |
| 1529 | -S "server hello, adding encrypt then mac extension" \ |
| 1530 | -C "found encrypt_then_mac extension" \ |
| 1531 | -C "using encrypt then mac" \ |
| 1532 | -S "using encrypt then mac" |
| 1533 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1534 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1535 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1536 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1537 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1538 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1539 | 0 \ |
| 1540 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1541 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1542 | -S "server hello, adding encrypt then mac extension" \ |
| 1543 | -C "found encrypt_then_mac extension" \ |
| 1544 | -C "using encrypt then mac" \ |
| 1545 | -S "using encrypt then mac" |
| 1546 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1547 | # Tests for Extended Master Secret extension |
| 1548 | |
| 1549 | run_test "Extended Master Secret: default" \ |
| 1550 | "$P_SRV debug_level=3" \ |
| 1551 | "$P_CLI debug_level=3" \ |
| 1552 | 0 \ |
| 1553 | -c "client hello, adding extended_master_secret extension" \ |
| 1554 | -s "found extended master secret extension" \ |
| 1555 | -s "server hello, adding extended master secret extension" \ |
| 1556 | -c "found extended_master_secret extension" \ |
| 1557 | -c "using extended master secret" \ |
| 1558 | -s "using extended master secret" |
| 1559 | |
| 1560 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1561 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1562 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1563 | 0 \ |
| 1564 | -c "client hello, adding extended_master_secret extension" \ |
| 1565 | -s "found extended master secret extension" \ |
| 1566 | -S "server hello, adding extended master secret extension" \ |
| 1567 | -C "found extended_master_secret extension" \ |
| 1568 | -C "using extended master secret" \ |
| 1569 | -S "using extended master secret" |
| 1570 | |
| 1571 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1572 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1573 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1574 | 0 \ |
| 1575 | -C "client hello, adding extended_master_secret extension" \ |
| 1576 | -S "found extended master secret extension" \ |
| 1577 | -S "server hello, adding extended master secret extension" \ |
| 1578 | -C "found extended_master_secret extension" \ |
| 1579 | -C "using extended master secret" \ |
| 1580 | -S "using extended master secret" |
| 1581 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1582 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1583 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1584 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1585 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1586 | 0 \ |
| 1587 | -C "client hello, adding extended_master_secret extension" \ |
| 1588 | -S "found extended master secret extension" \ |
| 1589 | -S "server hello, adding extended master secret extension" \ |
| 1590 | -C "found extended_master_secret extension" \ |
| 1591 | -C "using extended master secret" \ |
| 1592 | -S "using extended master secret" |
| 1593 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1594 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1595 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1596 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1597 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1598 | 0 \ |
| 1599 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1600 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1601 | -S "server hello, adding extended master secret extension" \ |
| 1602 | -C "found extended_master_secret extension" \ |
| 1603 | -C "using extended master secret" \ |
| 1604 | -S "using extended master secret" |
| 1605 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1606 | # Tests for FALLBACK_SCSV |
| 1607 | |
| 1608 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1609 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1610 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1611 | 0 \ |
| 1612 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1613 | -S "received FALLBACK_SCSV" \ |
| 1614 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1615 | -C "is a fatal alert message (msg 86)" |
| 1616 | |
| 1617 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1618 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1619 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1620 | 0 \ |
| 1621 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1622 | -S "received FALLBACK_SCSV" \ |
| 1623 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1624 | -C "is a fatal alert message (msg 86)" |
| 1625 | |
| 1626 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1627 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1628 | "$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] | 1629 | 1 \ |
| 1630 | -c "adding FALLBACK_SCSV" \ |
| 1631 | -s "received FALLBACK_SCSV" \ |
| 1632 | -s "inapropriate fallback" \ |
| 1633 | -c "is a fatal alert message (msg 86)" |
| 1634 | |
| 1635 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1636 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1637 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1638 | 0 \ |
| 1639 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1640 | -s "received FALLBACK_SCSV" \ |
| 1641 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1642 | -C "is a fatal alert message (msg 86)" |
| 1643 | |
| 1644 | requires_openssl_with_fallback_scsv |
| 1645 | run_test "Fallback SCSV: default, openssl server" \ |
| 1646 | "$O_SRV" \ |
| 1647 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1648 | 0 \ |
| 1649 | -C "adding FALLBACK_SCSV" \ |
| 1650 | -C "is a fatal alert message (msg 86)" |
| 1651 | |
| 1652 | requires_openssl_with_fallback_scsv |
| 1653 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1654 | "$O_SRV" \ |
| 1655 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1656 | 1 \ |
| 1657 | -c "adding FALLBACK_SCSV" \ |
| 1658 | -c "is a fatal alert message (msg 86)" |
| 1659 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1660 | requires_openssl_with_fallback_scsv |
| 1661 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1662 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1663 | "$O_CLI -tls1_1" \ |
| 1664 | 0 \ |
| 1665 | -S "received FALLBACK_SCSV" \ |
| 1666 | -S "inapropriate fallback" |
| 1667 | |
| 1668 | requires_openssl_with_fallback_scsv |
| 1669 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1670 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1671 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1672 | 1 \ |
| 1673 | -s "received FALLBACK_SCSV" \ |
| 1674 | -s "inapropriate fallback" |
| 1675 | |
| 1676 | requires_openssl_with_fallback_scsv |
| 1677 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1678 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1679 | "$O_CLI -fallback_scsv" \ |
| 1680 | 0 \ |
| 1681 | -s "received FALLBACK_SCSV" \ |
| 1682 | -S "inapropriate fallback" |
| 1683 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1684 | # Test sending and receiving empty application data records |
| 1685 | |
| 1686 | run_test "Encrypt then MAC: empty application data record" \ |
| 1687 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1688 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1689 | 0 \ |
| 1690 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1691 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1692 | -c "0 bytes written in 1 fragments" |
| 1693 | |
| 1694 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1695 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1696 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1697 | 0 \ |
| 1698 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1699 | -c "0 bytes written in 1 fragments" |
| 1700 | |
| 1701 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1702 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1703 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1704 | 0 \ |
| 1705 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1706 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1707 | -c "0 bytes written in 1 fragments" |
| 1708 | |
| 1709 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1710 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1711 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1712 | 0 \ |
| 1713 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1714 | -c "0 bytes written in 1 fragments" |
| 1715 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1716 | ## ClientHello generated with |
| 1717 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1718 | ## then manually twiddling the ciphersuite list. |
| 1719 | ## The ClientHello content is spelled out below as a hex string as |
| 1720 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1721 | ## The expected response is an inappropriate_fallback alert. |
| 1722 | requires_openssl_with_fallback_scsv |
| 1723 | run_test "Fallback SCSV: beginning of list" \ |
| 1724 | "$P_SRV debug_level=2" \ |
| 1725 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1726 | 0 \ |
| 1727 | -s "received FALLBACK_SCSV" \ |
| 1728 | -s "inapropriate fallback" |
| 1729 | |
| 1730 | requires_openssl_with_fallback_scsv |
| 1731 | run_test "Fallback SCSV: end of list" \ |
| 1732 | "$P_SRV debug_level=2" \ |
| 1733 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1734 | 0 \ |
| 1735 | -s "received FALLBACK_SCSV" \ |
| 1736 | -s "inapropriate fallback" |
| 1737 | |
| 1738 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1739 | requires_openssl_with_fallback_scsv |
| 1740 | run_test "Fallback SCSV: not in list" \ |
| 1741 | "$P_SRV debug_level=2" \ |
| 1742 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1743 | 0 \ |
| 1744 | -S "received FALLBACK_SCSV" \ |
| 1745 | -S "inapropriate fallback" |
| 1746 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1747 | # Tests for CBC 1/n-1 record splitting |
| 1748 | |
| 1749 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1750 | "$P_SRV" \ |
| 1751 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1752 | request_size=123 force_version=tls1_2" \ |
| 1753 | 0 \ |
| 1754 | -s "Read from client: 123 bytes read" \ |
| 1755 | -S "Read from client: 1 bytes read" \ |
| 1756 | -S "122 bytes read" |
| 1757 | |
| 1758 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1759 | "$P_SRV" \ |
| 1760 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1761 | request_size=123 force_version=tls1_1" \ |
| 1762 | 0 \ |
| 1763 | -s "Read from client: 123 bytes read" \ |
| 1764 | -S "Read from client: 1 bytes read" \ |
| 1765 | -S "122 bytes read" |
| 1766 | |
| 1767 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1768 | "$P_SRV" \ |
| 1769 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1770 | request_size=123 force_version=tls1" \ |
| 1771 | 0 \ |
| 1772 | -S "Read from client: 123 bytes read" \ |
| 1773 | -s "Read from client: 1 bytes read" \ |
| 1774 | -s "122 bytes read" |
| 1775 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1776 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1777 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1778 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1779 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1780 | request_size=123 force_version=ssl3" \ |
| 1781 | 0 \ |
| 1782 | -S "Read from client: 123 bytes read" \ |
| 1783 | -s "Read from client: 1 bytes read" \ |
| 1784 | -s "122 bytes read" |
| 1785 | |
| 1786 | 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] | 1787 | "$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] | 1788 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1789 | request_size=123 force_version=tls1" \ |
| 1790 | 0 \ |
| 1791 | -s "Read from client: 123 bytes read" \ |
| 1792 | -S "Read from client: 1 bytes read" \ |
| 1793 | -S "122 bytes read" |
| 1794 | |
| 1795 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1796 | "$P_SRV" \ |
| 1797 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1798 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1799 | 0 \ |
| 1800 | -s "Read from client: 123 bytes read" \ |
| 1801 | -S "Read from client: 1 bytes read" \ |
| 1802 | -S "122 bytes read" |
| 1803 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1804 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1805 | "$P_SRV nbio=2" \ |
| 1806 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1807 | request_size=123 force_version=tls1" \ |
| 1808 | 0 \ |
| 1809 | -S "Read from client: 123 bytes read" \ |
| 1810 | -s "Read from client: 1 bytes read" \ |
| 1811 | -s "122 bytes read" |
| 1812 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1813 | # Tests for Session Tickets |
| 1814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1815 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1816 | "$P_SRV debug_level=3 tickets=1" \ |
| 1817 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1818 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1819 | -c "client hello, adding session ticket extension" \ |
| 1820 | -s "found session ticket extension" \ |
| 1821 | -s "server hello, adding session ticket extension" \ |
| 1822 | -c "found session_ticket extension" \ |
| 1823 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1824 | -S "session successfully restored from cache" \ |
| 1825 | -s "session successfully restored from ticket" \ |
| 1826 | -s "a session has been resumed" \ |
| 1827 | -c "a session has been resumed" |
| 1828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1829 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1830 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1831 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1832 | 0 \ |
| 1833 | -c "client hello, adding session ticket extension" \ |
| 1834 | -s "found session ticket extension" \ |
| 1835 | -s "server hello, adding session ticket extension" \ |
| 1836 | -c "found session_ticket extension" \ |
| 1837 | -c "parse new session ticket" \ |
| 1838 | -S "session successfully restored from cache" \ |
| 1839 | -s "session successfully restored from ticket" \ |
| 1840 | -s "a session has been resumed" \ |
| 1841 | -c "a session has been resumed" |
| 1842 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1843 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1844 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1845 | "$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] | 1846 | 0 \ |
| 1847 | -c "client hello, adding session ticket extension" \ |
| 1848 | -s "found session ticket extension" \ |
| 1849 | -s "server hello, adding session ticket extension" \ |
| 1850 | -c "found session_ticket extension" \ |
| 1851 | -c "parse new session ticket" \ |
| 1852 | -S "session successfully restored from cache" \ |
| 1853 | -S "session successfully restored from ticket" \ |
| 1854 | -S "a session has been resumed" \ |
| 1855 | -C "a session has been resumed" |
| 1856 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1857 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1858 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1859 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1860 | 0 \ |
| 1861 | -c "client hello, adding session ticket extension" \ |
| 1862 | -c "found session_ticket extension" \ |
| 1863 | -c "parse new session ticket" \ |
| 1864 | -c "a session has been resumed" |
| 1865 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1866 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1867 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1868 | "( $O_CLI -sess_out $SESSION; \ |
| 1869 | $O_CLI -sess_in $SESSION; \ |
| 1870 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1871 | 0 \ |
| 1872 | -s "found session ticket extension" \ |
| 1873 | -s "server hello, adding session ticket extension" \ |
| 1874 | -S "session successfully restored from cache" \ |
| 1875 | -s "session successfully restored from ticket" \ |
| 1876 | -s "a session has been resumed" |
| 1877 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1878 | # Tests for Session Tickets with DTLS |
| 1879 | |
| 1880 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1881 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1882 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1883 | 0 \ |
| 1884 | -c "client hello, adding session ticket extension" \ |
| 1885 | -s "found session ticket extension" \ |
| 1886 | -s "server hello, adding session ticket extension" \ |
| 1887 | -c "found session_ticket extension" \ |
| 1888 | -c "parse new session ticket" \ |
| 1889 | -S "session successfully restored from cache" \ |
| 1890 | -s "session successfully restored from ticket" \ |
| 1891 | -s "a session has been resumed" \ |
| 1892 | -c "a session has been resumed" |
| 1893 | |
| 1894 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1895 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 1896 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1897 | 0 \ |
| 1898 | -c "client hello, adding session ticket extension" \ |
| 1899 | -s "found session ticket extension" \ |
| 1900 | -s "server hello, adding session ticket extension" \ |
| 1901 | -c "found session_ticket extension" \ |
| 1902 | -c "parse new session ticket" \ |
| 1903 | -S "session successfully restored from cache" \ |
| 1904 | -s "session successfully restored from ticket" \ |
| 1905 | -s "a session has been resumed" \ |
| 1906 | -c "a session has been resumed" |
| 1907 | |
| 1908 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1909 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1910 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 1911 | 0 \ |
| 1912 | -c "client hello, adding session ticket extension" \ |
| 1913 | -s "found session ticket extension" \ |
| 1914 | -s "server hello, adding session ticket extension" \ |
| 1915 | -c "found session_ticket extension" \ |
| 1916 | -c "parse new session ticket" \ |
| 1917 | -S "session successfully restored from cache" \ |
| 1918 | -S "session successfully restored from ticket" \ |
| 1919 | -S "a session has been resumed" \ |
| 1920 | -C "a session has been resumed" |
| 1921 | |
| 1922 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1923 | "$O_SRV -dtls1" \ |
| 1924 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1925 | 0 \ |
| 1926 | -c "client hello, adding session ticket extension" \ |
| 1927 | -c "found session_ticket extension" \ |
| 1928 | -c "parse new session ticket" \ |
| 1929 | -c "a session has been resumed" |
| 1930 | |
| 1931 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1932 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1933 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1934 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1935 | rm -f $SESSION )" \ |
| 1936 | 0 \ |
| 1937 | -s "found session ticket extension" \ |
| 1938 | -s "server hello, adding session ticket extension" \ |
| 1939 | -S "session successfully restored from cache" \ |
| 1940 | -s "session successfully restored from ticket" \ |
| 1941 | -s "a session has been resumed" |
| 1942 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1943 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1945 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1946 | "$P_SRV debug_level=3 tickets=0" \ |
| 1947 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1948 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1949 | -c "client hello, adding session ticket extension" \ |
| 1950 | -s "found session ticket extension" \ |
| 1951 | -S "server hello, adding session ticket extension" \ |
| 1952 | -C "found session_ticket extension" \ |
| 1953 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1954 | -s "session successfully restored from cache" \ |
| 1955 | -S "session successfully restored from ticket" \ |
| 1956 | -s "a session has been resumed" \ |
| 1957 | -c "a session has been resumed" |
| 1958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1959 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1960 | "$P_SRV debug_level=3 tickets=1" \ |
| 1961 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1962 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1963 | -C "client hello, adding session ticket extension" \ |
| 1964 | -S "found session ticket extension" \ |
| 1965 | -S "server hello, adding session ticket extension" \ |
| 1966 | -C "found session_ticket extension" \ |
| 1967 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1968 | -s "session successfully restored from cache" \ |
| 1969 | -S "session successfully restored from ticket" \ |
| 1970 | -s "a session has been resumed" \ |
| 1971 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1972 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1973 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1974 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1975 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1976 | 0 \ |
| 1977 | -S "session successfully restored from cache" \ |
| 1978 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1979 | -S "a session has been resumed" \ |
| 1980 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1982 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1983 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1984 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1985 | 0 \ |
| 1986 | -s "session successfully restored from cache" \ |
| 1987 | -S "session successfully restored from ticket" \ |
| 1988 | -s "a session has been resumed" \ |
| 1989 | -c "a session has been resumed" |
| 1990 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1991 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1992 | "$P_SRV debug_level=3 tickets=0" \ |
| 1993 | "$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] | 1994 | 0 \ |
| 1995 | -s "session successfully restored from cache" \ |
| 1996 | -S "session successfully restored from ticket" \ |
| 1997 | -s "a session has been resumed" \ |
| 1998 | -c "a session has been resumed" |
| 1999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2000 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2001 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2002 | "$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] | 2003 | 0 \ |
| 2004 | -S "session successfully restored from cache" \ |
| 2005 | -S "session successfully restored from ticket" \ |
| 2006 | -S "a session has been resumed" \ |
| 2007 | -C "a session has been resumed" |
| 2008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2009 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2010 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2011 | "$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] | 2012 | 0 \ |
| 2013 | -s "session successfully restored from cache" \ |
| 2014 | -S "session successfully restored from ticket" \ |
| 2015 | -s "a session has been resumed" \ |
| 2016 | -c "a session has been resumed" |
| 2017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2018 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2019 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2020 | "( $O_CLI -sess_out $SESSION; \ |
| 2021 | $O_CLI -sess_in $SESSION; \ |
| 2022 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2023 | 0 \ |
| 2024 | -s "found session ticket extension" \ |
| 2025 | -S "server hello, adding session ticket extension" \ |
| 2026 | -s "session successfully restored from cache" \ |
| 2027 | -S "session successfully restored from ticket" \ |
| 2028 | -s "a session has been resumed" |
| 2029 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2030 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2031 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2032 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2033 | 0 \ |
| 2034 | -C "found session_ticket extension" \ |
| 2035 | -C "parse new session ticket" \ |
| 2036 | -c "a session has been resumed" |
| 2037 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2038 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2039 | |
| 2040 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2041 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2042 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2043 | 0 \ |
| 2044 | -c "client hello, adding session ticket extension" \ |
| 2045 | -s "found session ticket extension" \ |
| 2046 | -S "server hello, adding session ticket extension" \ |
| 2047 | -C "found session_ticket extension" \ |
| 2048 | -C "parse new session ticket" \ |
| 2049 | -s "session successfully restored from cache" \ |
| 2050 | -S "session successfully restored from ticket" \ |
| 2051 | -s "a session has been resumed" \ |
| 2052 | -c "a session has been resumed" |
| 2053 | |
| 2054 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2055 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2056 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2057 | 0 \ |
| 2058 | -C "client hello, adding session ticket extension" \ |
| 2059 | -S "found session ticket extension" \ |
| 2060 | -S "server hello, adding session ticket extension" \ |
| 2061 | -C "found session_ticket extension" \ |
| 2062 | -C "parse new session ticket" \ |
| 2063 | -s "session successfully restored from cache" \ |
| 2064 | -S "session successfully restored from ticket" \ |
| 2065 | -s "a session has been resumed" \ |
| 2066 | -c "a session has been resumed" |
| 2067 | |
| 2068 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2069 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2070 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2071 | 0 \ |
| 2072 | -S "session successfully restored from cache" \ |
| 2073 | -S "session successfully restored from ticket" \ |
| 2074 | -S "a session has been resumed" \ |
| 2075 | -C "a session has been resumed" |
| 2076 | |
| 2077 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2078 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2079 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2080 | 0 \ |
| 2081 | -s "session successfully restored from cache" \ |
| 2082 | -S "session successfully restored from ticket" \ |
| 2083 | -s "a session has been resumed" \ |
| 2084 | -c "a session has been resumed" |
| 2085 | |
| 2086 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2087 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2088 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2089 | 0 \ |
| 2090 | -s "session successfully restored from cache" \ |
| 2091 | -S "session successfully restored from ticket" \ |
| 2092 | -s "a session has been resumed" \ |
| 2093 | -c "a session has been resumed" |
| 2094 | |
| 2095 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2096 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2097 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2098 | 0 \ |
| 2099 | -S "session successfully restored from cache" \ |
| 2100 | -S "session successfully restored from ticket" \ |
| 2101 | -S "a session has been resumed" \ |
| 2102 | -C "a session has been resumed" |
| 2103 | |
| 2104 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2105 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2106 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2107 | 0 \ |
| 2108 | -s "session successfully restored from cache" \ |
| 2109 | -S "session successfully restored from ticket" \ |
| 2110 | -s "a session has been resumed" \ |
| 2111 | -c "a session has been resumed" |
| 2112 | |
| 2113 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2114 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2115 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2116 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2117 | rm -f $SESSION )" \ |
| 2118 | 0 \ |
| 2119 | -s "found session ticket extension" \ |
| 2120 | -S "server hello, adding session ticket extension" \ |
| 2121 | -s "session successfully restored from cache" \ |
| 2122 | -S "session successfully restored from ticket" \ |
| 2123 | -s "a session has been resumed" |
| 2124 | |
| 2125 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2126 | "$O_SRV -dtls1" \ |
| 2127 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2128 | 0 \ |
| 2129 | -C "found session_ticket extension" \ |
| 2130 | -C "parse new session ticket" \ |
| 2131 | -c "a session has been resumed" |
| 2132 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2133 | # Tests for Max Fragment Length extension |
| 2134 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2135 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2136 | 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] | 2137 | exit 1 |
| 2138 | fi |
| 2139 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2140 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2141 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2142 | fi |
| 2143 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2144 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2145 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2146 | "$P_SRV debug_level=3" \ |
| 2147 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2148 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2149 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2150 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2151 | -C "client hello, adding max_fragment_length extension" \ |
| 2152 | -S "found max fragment length extension" \ |
| 2153 | -S "server hello, max_fragment_length extension" \ |
| 2154 | -C "found max_fragment_length extension" |
| 2155 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2156 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2157 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2158 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2159 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2160 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2161 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2162 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2163 | -C "client hello, adding max_fragment_length extension" \ |
| 2164 | -S "found max fragment length extension" \ |
| 2165 | -S "server hello, max_fragment_length extension" \ |
| 2166 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2167 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2168 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2169 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2170 | |
| 2171 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2172 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2173 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2174 | "$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] | 2175 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2176 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2177 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2178 | -C "client hello, adding max_fragment_length extension" \ |
| 2179 | -S "found max fragment length extension" \ |
| 2180 | -S "server hello, max_fragment_length extension" \ |
| 2181 | -C "found max_fragment_length extension" \ |
| 2182 | -c "fragment larger than.*maximum " |
| 2183 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2184 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2185 | # (session fragment length will be 16384 regardless of mbedtls |
| 2186 | # content length configuration.) |
| 2187 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2188 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2189 | run_test "Max fragment length: disabled, larger message" \ |
| 2190 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2191 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2192 | 0 \ |
| 2193 | -C "Maximum fragment length is 16384" \ |
| 2194 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2195 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2196 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2197 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2198 | |
| 2199 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2200 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2201 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2202 | "$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] | 2203 | 1 \ |
| 2204 | -C "Maximum fragment length is 16384" \ |
| 2205 | -S "Maximum fragment length is 16384" \ |
| 2206 | -c "fragment larger than.*maximum " |
| 2207 | |
| 2208 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2209 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2210 | "$P_SRV debug_level=3" \ |
| 2211 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2212 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2213 | -c "Maximum fragment length is 4096" \ |
| 2214 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2215 | -c "client hello, adding max_fragment_length extension" \ |
| 2216 | -s "found max fragment length extension" \ |
| 2217 | -s "server hello, max_fragment_length extension" \ |
| 2218 | -c "found max_fragment_length extension" |
| 2219 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2221 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2222 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2223 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2224 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2225 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2226 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2227 | -C "client hello, adding max_fragment_length extension" \ |
| 2228 | -S "found max fragment length extension" \ |
| 2229 | -S "server hello, max_fragment_length extension" \ |
| 2230 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2231 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2233 | requires_gnutls |
| 2234 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2235 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2236 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2237 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2238 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2239 | -c "client hello, adding max_fragment_length extension" \ |
| 2240 | -c "found max_fragment_length extension" |
| 2241 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2243 | run_test "Max fragment length: client, message just fits" \ |
| 2244 | "$P_SRV debug_level=3" \ |
| 2245 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2246 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2247 | -c "Maximum fragment length is 2048" \ |
| 2248 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2249 | -c "client hello, adding max_fragment_length extension" \ |
| 2250 | -s "found max fragment length extension" \ |
| 2251 | -s "server hello, max_fragment_length extension" \ |
| 2252 | -c "found max_fragment_length extension" \ |
| 2253 | -c "2048 bytes written in 1 fragments" \ |
| 2254 | -s "2048 bytes read" |
| 2255 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2257 | run_test "Max fragment length: client, larger message" \ |
| 2258 | "$P_SRV debug_level=3" \ |
| 2259 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2260 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2261 | -c "Maximum fragment length is 2048" \ |
| 2262 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2263 | -c "client hello, adding max_fragment_length extension" \ |
| 2264 | -s "found max fragment length extension" \ |
| 2265 | -s "server hello, max_fragment_length extension" \ |
| 2266 | -c "found max_fragment_length extension" \ |
| 2267 | -c "2345 bytes written in 2 fragments" \ |
| 2268 | -s "2048 bytes read" \ |
| 2269 | -s "297 bytes read" |
| 2270 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2271 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2272 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2273 | "$P_SRV debug_level=3 dtls=1" \ |
| 2274 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2275 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2276 | -c "Maximum fragment length is 2048" \ |
| 2277 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2278 | -c "client hello, adding max_fragment_length extension" \ |
| 2279 | -s "found max fragment length extension" \ |
| 2280 | -s "server hello, max_fragment_length extension" \ |
| 2281 | -c "found max_fragment_length extension" \ |
| 2282 | -c "fragment larger than.*maximum" |
| 2283 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2284 | # Tests for renegotiation |
| 2285 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2286 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2287 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2288 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2289 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2290 | 0 \ |
| 2291 | -C "client hello, adding renegotiation extension" \ |
| 2292 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2293 | -S "found renegotiation extension" \ |
| 2294 | -s "server hello, secure renegotiation extension" \ |
| 2295 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2296 | -C "=> renegotiate" \ |
| 2297 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2298 | -S "write hello request" |
| 2299 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2300 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2301 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2302 | "$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] | 2303 | "$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] | 2304 | 0 \ |
| 2305 | -c "client hello, adding renegotiation extension" \ |
| 2306 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2307 | -s "found renegotiation extension" \ |
| 2308 | -s "server hello, secure renegotiation extension" \ |
| 2309 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2310 | -c "=> renegotiate" \ |
| 2311 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2312 | -S "write hello request" |
| 2313 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2315 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2316 | "$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] | 2317 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2318 | 0 \ |
| 2319 | -c "client hello, adding renegotiation extension" \ |
| 2320 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2321 | -s "found renegotiation extension" \ |
| 2322 | -s "server hello, secure renegotiation extension" \ |
| 2323 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2324 | -c "=> renegotiate" \ |
| 2325 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2326 | -s "write hello request" |
| 2327 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2328 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2329 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2330 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2332 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2333 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2334 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2335 | 0 \ |
| 2336 | -c "client hello, adding renegotiation extension" \ |
| 2337 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2338 | -s "found renegotiation extension" \ |
| 2339 | -s "server hello, secure renegotiation extension" \ |
| 2340 | -c "found renegotiation extension" \ |
| 2341 | -c "=> renegotiate" \ |
| 2342 | -s "=> renegotiate" \ |
| 2343 | -S "write hello request" \ |
| 2344 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2345 | |
| 2346 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2347 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2348 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2350 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2351 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2352 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2353 | 0 \ |
| 2354 | -c "client hello, adding renegotiation extension" \ |
| 2355 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2356 | -s "found renegotiation extension" \ |
| 2357 | -s "server hello, secure renegotiation extension" \ |
| 2358 | -c "found renegotiation extension" \ |
| 2359 | -c "=> renegotiate" \ |
| 2360 | -s "=> renegotiate" \ |
| 2361 | -s "write hello request" \ |
| 2362 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2363 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2364 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2365 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2366 | "$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] | 2367 | "$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] | 2368 | 0 \ |
| 2369 | -c "client hello, adding renegotiation extension" \ |
| 2370 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2371 | -s "found renegotiation extension" \ |
| 2372 | -s "server hello, secure renegotiation extension" \ |
| 2373 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2374 | -c "=> renegotiate" \ |
| 2375 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2376 | -s "write hello request" |
| 2377 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2378 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2379 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2380 | "$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] | 2381 | "$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] | 2382 | 1 \ |
| 2383 | -c "client hello, adding renegotiation extension" \ |
| 2384 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2385 | -S "found renegotiation extension" \ |
| 2386 | -s "server hello, secure renegotiation extension" \ |
| 2387 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2388 | -c "=> renegotiate" \ |
| 2389 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2390 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2391 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2392 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2393 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2395 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2396 | "$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] | 2397 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2398 | 0 \ |
| 2399 | -C "client hello, adding renegotiation extension" \ |
| 2400 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2401 | -S "found renegotiation extension" \ |
| 2402 | -s "server hello, secure renegotiation extension" \ |
| 2403 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2404 | -C "=> renegotiate" \ |
| 2405 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2406 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2407 | -S "SSL - An unexpected message was received from our peer" \ |
| 2408 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2409 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2411 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2412 | "$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] | 2413 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2414 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2415 | 0 \ |
| 2416 | -C "client hello, adding renegotiation extension" \ |
| 2417 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2418 | -S "found renegotiation extension" \ |
| 2419 | -s "server hello, secure renegotiation extension" \ |
| 2420 | -c "found renegotiation extension" \ |
| 2421 | -C "=> renegotiate" \ |
| 2422 | -S "=> renegotiate" \ |
| 2423 | -s "write hello request" \ |
| 2424 | -S "SSL - An unexpected message was received from our peer" \ |
| 2425 | -S "failed" |
| 2426 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2427 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2428 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2429 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2430 | "$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] | 2431 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2432 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2433 | 0 \ |
| 2434 | -C "client hello, adding renegotiation extension" \ |
| 2435 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2436 | -S "found renegotiation extension" \ |
| 2437 | -s "server hello, secure renegotiation extension" \ |
| 2438 | -c "found renegotiation extension" \ |
| 2439 | -C "=> renegotiate" \ |
| 2440 | -S "=> renegotiate" \ |
| 2441 | -s "write hello request" \ |
| 2442 | -S "SSL - An unexpected message was received from our peer" \ |
| 2443 | -S "failed" |
| 2444 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2446 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2447 | "$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] | 2448 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2449 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2450 | 0 \ |
| 2451 | -C "client hello, adding renegotiation extension" \ |
| 2452 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2453 | -S "found renegotiation extension" \ |
| 2454 | -s "server hello, secure renegotiation extension" \ |
| 2455 | -c "found renegotiation extension" \ |
| 2456 | -C "=> renegotiate" \ |
| 2457 | -S "=> renegotiate" \ |
| 2458 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2459 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2460 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2462 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2463 | "$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] | 2464 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2465 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2466 | 0 \ |
| 2467 | -c "client hello, adding renegotiation extension" \ |
| 2468 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2469 | -s "found renegotiation extension" \ |
| 2470 | -s "server hello, secure renegotiation extension" \ |
| 2471 | -c "found renegotiation extension" \ |
| 2472 | -c "=> renegotiate" \ |
| 2473 | -s "=> renegotiate" \ |
| 2474 | -s "write hello request" \ |
| 2475 | -S "SSL - An unexpected message was received from our peer" \ |
| 2476 | -S "failed" |
| 2477 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2479 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2480 | "$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] | 2481 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2482 | 0 \ |
| 2483 | -C "client hello, adding renegotiation extension" \ |
| 2484 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2485 | -S "found renegotiation extension" \ |
| 2486 | -s "server hello, secure renegotiation extension" \ |
| 2487 | -c "found renegotiation extension" \ |
| 2488 | -S "record counter limit reached: renegotiate" \ |
| 2489 | -C "=> renegotiate" \ |
| 2490 | -S "=> renegotiate" \ |
| 2491 | -S "write hello request" \ |
| 2492 | -S "SSL - An unexpected message was received from our peer" \ |
| 2493 | -S "failed" |
| 2494 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2495 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2496 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2497 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2498 | "$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] | 2499 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2500 | 0 \ |
| 2501 | -c "client hello, adding renegotiation extension" \ |
| 2502 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2503 | -s "found renegotiation extension" \ |
| 2504 | -s "server hello, secure renegotiation extension" \ |
| 2505 | -c "found renegotiation extension" \ |
| 2506 | -s "record counter limit reached: renegotiate" \ |
| 2507 | -c "=> renegotiate" \ |
| 2508 | -s "=> renegotiate" \ |
| 2509 | -s "write hello request" \ |
| 2510 | -S "SSL - An unexpected message was received from our peer" \ |
| 2511 | -S "failed" |
| 2512 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2514 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2515 | "$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] | 2516 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2517 | 0 \ |
| 2518 | -c "client hello, adding renegotiation extension" \ |
| 2519 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2520 | -s "found renegotiation extension" \ |
| 2521 | -s "server hello, secure renegotiation extension" \ |
| 2522 | -c "found renegotiation extension" \ |
| 2523 | -s "record counter limit reached: renegotiate" \ |
| 2524 | -c "=> renegotiate" \ |
| 2525 | -s "=> renegotiate" \ |
| 2526 | -s "write hello request" \ |
| 2527 | -S "SSL - An unexpected message was received from our peer" \ |
| 2528 | -S "failed" |
| 2529 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2530 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2531 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2532 | "$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] | 2533 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2534 | 0 \ |
| 2535 | -C "client hello, adding renegotiation extension" \ |
| 2536 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2537 | -S "found renegotiation extension" \ |
| 2538 | -s "server hello, secure renegotiation extension" \ |
| 2539 | -c "found renegotiation extension" \ |
| 2540 | -S "record counter limit reached: renegotiate" \ |
| 2541 | -C "=> renegotiate" \ |
| 2542 | -S "=> renegotiate" \ |
| 2543 | -S "write hello request" \ |
| 2544 | -S "SSL - An unexpected message was received from our peer" \ |
| 2545 | -S "failed" |
| 2546 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2548 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2549 | "$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] | 2550 | "$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] | 2551 | 0 \ |
| 2552 | -c "client hello, adding renegotiation extension" \ |
| 2553 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2554 | -s "found renegotiation extension" \ |
| 2555 | -s "server hello, secure renegotiation extension" \ |
| 2556 | -c "found renegotiation extension" \ |
| 2557 | -c "=> renegotiate" \ |
| 2558 | -s "=> renegotiate" \ |
| 2559 | -S "write hello request" |
| 2560 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2562 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2563 | "$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] | 2564 | "$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] | 2565 | 0 \ |
| 2566 | -c "client hello, adding renegotiation extension" \ |
| 2567 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2568 | -s "found renegotiation extension" \ |
| 2569 | -s "server hello, secure renegotiation extension" \ |
| 2570 | -c "found renegotiation extension" \ |
| 2571 | -c "=> renegotiate" \ |
| 2572 | -s "=> renegotiate" \ |
| 2573 | -s "write hello request" |
| 2574 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2575 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2576 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2577 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2578 | "$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] | 2579 | 0 \ |
| 2580 | -c "client hello, adding renegotiation extension" \ |
| 2581 | -c "found renegotiation extension" \ |
| 2582 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2583 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2584 | -C "error" \ |
| 2585 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2586 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2587 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2588 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2589 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2590 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2591 | "$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] | 2592 | 0 \ |
| 2593 | -c "client hello, adding renegotiation extension" \ |
| 2594 | -c "found renegotiation extension" \ |
| 2595 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2596 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2597 | -C "error" \ |
| 2598 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2599 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2600 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2601 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2602 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2603 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2604 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2605 | 1 \ |
| 2606 | -c "client hello, adding renegotiation extension" \ |
| 2607 | -C "found renegotiation extension" \ |
| 2608 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2609 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2610 | -c "error" \ |
| 2611 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2612 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2613 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2615 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2616 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2617 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2618 | allow_legacy=0" \ |
| 2619 | 1 \ |
| 2620 | -c "client hello, adding renegotiation extension" \ |
| 2621 | -C "found renegotiation extension" \ |
| 2622 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2623 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2624 | -c "error" \ |
| 2625 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2626 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2627 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2628 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2629 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2630 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2631 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2632 | allow_legacy=1" \ |
| 2633 | 0 \ |
| 2634 | -c "client hello, adding renegotiation extension" \ |
| 2635 | -C "found renegotiation extension" \ |
| 2636 | -c "=> renegotiate" \ |
| 2637 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2638 | -C "error" \ |
| 2639 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2640 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2642 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2643 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2644 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2645 | 0 \ |
| 2646 | -c "client hello, adding renegotiation extension" \ |
| 2647 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2648 | -s "found renegotiation extension" \ |
| 2649 | -s "server hello, secure renegotiation extension" \ |
| 2650 | -c "found renegotiation extension" \ |
| 2651 | -c "=> renegotiate" \ |
| 2652 | -s "=> renegotiate" \ |
| 2653 | -S "write hello request" |
| 2654 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2656 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2657 | "$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] | 2658 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2659 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2660 | 0 \ |
| 2661 | -c "client hello, adding renegotiation extension" \ |
| 2662 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2663 | -s "found renegotiation extension" \ |
| 2664 | -s "server hello, secure renegotiation extension" \ |
| 2665 | -c "found renegotiation extension" \ |
| 2666 | -c "=> renegotiate" \ |
| 2667 | -s "=> renegotiate" \ |
| 2668 | -s "write hello request" |
| 2669 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2670 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2671 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2672 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2673 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2674 | 0 \ |
| 2675 | -c "client hello, adding renegotiation extension" \ |
| 2676 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2677 | -s "found renegotiation extension" \ |
| 2678 | -s "server hello, secure renegotiation extension" \ |
| 2679 | -s "record counter limit reached: renegotiate" \ |
| 2680 | -c "=> renegotiate" \ |
| 2681 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2682 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2683 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2684 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2685 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2686 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2687 | "$G_SRV -u --mtu 4096" \ |
| 2688 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2689 | 0 \ |
| 2690 | -c "client hello, adding renegotiation extension" \ |
| 2691 | -c "found renegotiation extension" \ |
| 2692 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2693 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2694 | -C "error" \ |
| 2695 | -s "Extra-header:" |
| 2696 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2697 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2698 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2699 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2700 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2701 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2702 | "$P_CLI debug_level=3" \ |
| 2703 | 0 \ |
| 2704 | -c "found renegotiation extension" \ |
| 2705 | -C "error" \ |
| 2706 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2707 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2708 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2709 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2710 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2711 | "$P_CLI debug_level=3" \ |
| 2712 | 0 \ |
| 2713 | -C "found renegotiation extension" \ |
| 2714 | -C "error" \ |
| 2715 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2716 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2717 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2718 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2719 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2720 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2721 | 1 \ |
| 2722 | -C "found renegotiation extension" \ |
| 2723 | -c "error" \ |
| 2724 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2725 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2726 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2727 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2728 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2729 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2730 | 0 \ |
| 2731 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2732 | -s "server hello, secure renegotiation extension" |
| 2733 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2734 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2735 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2736 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2737 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2738 | 0 \ |
| 2739 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2740 | -S "server hello, secure renegotiation extension" |
| 2741 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2742 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2743 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2744 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2745 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2746 | 1 \ |
| 2747 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2748 | -S "server hello, secure renegotiation extension" |
| 2749 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2750 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2751 | |
| 2752 | requires_gnutls |
| 2753 | run_test "DER format: no trailing bytes" \ |
| 2754 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2755 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2756 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2757 | 0 \ |
| 2758 | -c "Handshake was completed" \ |
| 2759 | |
| 2760 | requires_gnutls |
| 2761 | run_test "DER format: with a trailing zero byte" \ |
| 2762 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2763 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2764 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2765 | 0 \ |
| 2766 | -c "Handshake was completed" \ |
| 2767 | |
| 2768 | requires_gnutls |
| 2769 | run_test "DER format: with a trailing random byte" \ |
| 2770 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2771 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2772 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2773 | 0 \ |
| 2774 | -c "Handshake was completed" \ |
| 2775 | |
| 2776 | requires_gnutls |
| 2777 | run_test "DER format: with 2 trailing random bytes" \ |
| 2778 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2779 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2780 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2781 | 0 \ |
| 2782 | -c "Handshake was completed" \ |
| 2783 | |
| 2784 | requires_gnutls |
| 2785 | run_test "DER format: with 4 trailing random bytes" \ |
| 2786 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2787 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2788 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2789 | 0 \ |
| 2790 | -c "Handshake was completed" \ |
| 2791 | |
| 2792 | requires_gnutls |
| 2793 | run_test "DER format: with 8 trailing random bytes" \ |
| 2794 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2795 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2796 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2797 | 0 \ |
| 2798 | -c "Handshake was completed" \ |
| 2799 | |
| 2800 | requires_gnutls |
| 2801 | run_test "DER format: with 9 trailing random bytes" \ |
| 2802 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2803 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2804 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2805 | 0 \ |
| 2806 | -c "Handshake was completed" \ |
| 2807 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 2808 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 2809 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2810 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2811 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2812 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2813 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2814 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2815 | 1 \ |
| 2816 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2817 | -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] | 2818 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2819 | -c "X509 - Certificate verification failed" |
| 2820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2821 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2822 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2823 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2824 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2825 | 0 \ |
| 2826 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2827 | -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] | 2828 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2829 | -C "X509 - Certificate verification failed" |
| 2830 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2831 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2832 | "$P_SRV" \ |
| 2833 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2834 | 0 \ |
| 2835 | -c "x509_verify_cert() returned" \ |
| 2836 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2837 | -c "! Certificate verification flags"\ |
| 2838 | -C "! mbedtls_ssl_handshake returned" \ |
| 2839 | -C "X509 - Certificate verification failed" \ |
| 2840 | -C "SSL - No CA Chain is set, but required to operate" |
| 2841 | |
| 2842 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2843 | "$P_SRV" \ |
| 2844 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2845 | 1 \ |
| 2846 | -c "x509_verify_cert() returned" \ |
| 2847 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2848 | -c "! Certificate verification flags"\ |
| 2849 | -c "! mbedtls_ssl_handshake returned" \ |
| 2850 | -c "SSL - No CA Chain is set, but required to operate" |
| 2851 | |
| 2852 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2853 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2854 | # the client informs the server about the supported curves - it does, though, in the |
| 2855 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2856 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2857 | # different means to have the server ignoring the client's supported curve list. |
| 2858 | |
| 2859 | requires_config_enabled MBEDTLS_ECP_C |
| 2860 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2861 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2862 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2863 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2864 | 1 \ |
| 2865 | -c "bad certificate (EC key curve)"\ |
| 2866 | -c "! Certificate verification flags"\ |
| 2867 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2868 | |
| 2869 | requires_config_enabled MBEDTLS_ECP_C |
| 2870 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2871 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2872 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2873 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2874 | 1 \ |
| 2875 | -c "bad certificate (EC key curve)"\ |
| 2876 | -c "! Certificate verification flags"\ |
| 2877 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2879 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2880 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2881 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2882 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2883 | 0 \ |
| 2884 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2885 | -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] | 2886 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2887 | -C "X509 - Certificate verification failed" |
| 2888 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2889 | run_test "Authentication: client SHA256, server required" \ |
| 2890 | "$P_SRV auth_mode=required" \ |
| 2891 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2892 | key_file=data_files/server6.key \ |
| 2893 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2894 | 0 \ |
| 2895 | -c "Supported Signature Algorithm found: 4," \ |
| 2896 | -c "Supported Signature Algorithm found: 5," |
| 2897 | |
| 2898 | run_test "Authentication: client SHA384, server required" \ |
| 2899 | "$P_SRV auth_mode=required" \ |
| 2900 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2901 | key_file=data_files/server6.key \ |
| 2902 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2903 | 0 \ |
| 2904 | -c "Supported Signature Algorithm found: 4," \ |
| 2905 | -c "Supported Signature Algorithm found: 5," |
| 2906 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2907 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2908 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2909 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2910 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2911 | key_file=data_files/server5.key" \ |
| 2912 | 1 \ |
| 2913 | -S "skip write certificate request" \ |
| 2914 | -C "skip parse certificate request" \ |
| 2915 | -c "got a certificate request" \ |
| 2916 | -c "got no certificate to send" \ |
| 2917 | -S "x509_verify_cert() returned" \ |
| 2918 | -s "client has no certificate" \ |
| 2919 | -s "! mbedtls_ssl_handshake returned" \ |
| 2920 | -c "! mbedtls_ssl_handshake returned" \ |
| 2921 | -s "No client certification received from the client, but required by the authentication mode" |
| 2922 | |
| 2923 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2924 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2925 | "$P_CLI debug_level=3 crt_file=none \ |
| 2926 | key_file=data_files/server5.key" \ |
| 2927 | 1 \ |
| 2928 | -S "skip write certificate request" \ |
| 2929 | -C "skip parse certificate request" \ |
| 2930 | -c "got a certificate request" \ |
| 2931 | -c "= write certificate$" \ |
| 2932 | -C "skip write certificate$" \ |
| 2933 | -S "x509_verify_cert() returned" \ |
| 2934 | -s "client has no certificate" \ |
| 2935 | -s "! mbedtls_ssl_handshake returned" \ |
| 2936 | -c "! mbedtls_ssl_handshake returned" \ |
| 2937 | -s "No client certification received from the client, but required by the authentication mode" |
| 2938 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2939 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2940 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2941 | "$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] | 2942 | key_file=data_files/server5.key" \ |
| 2943 | 1 \ |
| 2944 | -S "skip write certificate request" \ |
| 2945 | -C "skip parse certificate request" \ |
| 2946 | -c "got a certificate request" \ |
| 2947 | -C "skip write certificate" \ |
| 2948 | -C "skip write certificate verify" \ |
| 2949 | -S "skip parse certificate verify" \ |
| 2950 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2951 | -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] | 2952 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2953 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2954 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2955 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2956 | # We don't check that the client receives the alert because it might |
| 2957 | # detect that its write end of the connection is closed and abort |
| 2958 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2959 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2960 | run_test "Authentication: client cert not trusted, server required" \ |
| 2961 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2962 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2963 | key_file=data_files/server5.key" \ |
| 2964 | 1 \ |
| 2965 | -S "skip write certificate request" \ |
| 2966 | -C "skip parse certificate request" \ |
| 2967 | -c "got a certificate request" \ |
| 2968 | -C "skip write certificate" \ |
| 2969 | -C "skip write certificate verify" \ |
| 2970 | -S "skip parse certificate verify" \ |
| 2971 | -s "x509_verify_cert() returned" \ |
| 2972 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2973 | -s "! mbedtls_ssl_handshake returned" \ |
| 2974 | -c "! mbedtls_ssl_handshake returned" \ |
| 2975 | -s "X509 - Certificate verification failed" |
| 2976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2977 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2978 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2979 | "$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] | 2980 | key_file=data_files/server5.key" \ |
| 2981 | 0 \ |
| 2982 | -S "skip write certificate request" \ |
| 2983 | -C "skip parse certificate request" \ |
| 2984 | -c "got a certificate request" \ |
| 2985 | -C "skip write certificate" \ |
| 2986 | -C "skip write certificate verify" \ |
| 2987 | -S "skip parse certificate verify" \ |
| 2988 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2989 | -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] | 2990 | -S "! mbedtls_ssl_handshake returned" \ |
| 2991 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2992 | -S "X509 - Certificate verification failed" |
| 2993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2994 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2995 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2996 | "$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] | 2997 | key_file=data_files/server5.key" \ |
| 2998 | 0 \ |
| 2999 | -s "skip write certificate request" \ |
| 3000 | -C "skip parse certificate request" \ |
| 3001 | -c "got no certificate request" \ |
| 3002 | -c "skip write certificate" \ |
| 3003 | -c "skip write certificate verify" \ |
| 3004 | -s "skip parse certificate verify" \ |
| 3005 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3006 | -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] | 3007 | -S "! mbedtls_ssl_handshake returned" \ |
| 3008 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3009 | -S "X509 - Certificate verification failed" |
| 3010 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3011 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3012 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3013 | "$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] | 3014 | 0 \ |
| 3015 | -S "skip write certificate request" \ |
| 3016 | -C "skip parse certificate request" \ |
| 3017 | -c "got a certificate request" \ |
| 3018 | -C "skip write certificate$" \ |
| 3019 | -C "got no certificate to send" \ |
| 3020 | -S "SSLv3 client has no certificate" \ |
| 3021 | -c "skip write certificate verify" \ |
| 3022 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3023 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3024 | -S "! mbedtls_ssl_handshake returned" \ |
| 3025 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3026 | -S "X509 - Certificate verification failed" |
| 3027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3028 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3029 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3030 | "$O_CLI" \ |
| 3031 | 0 \ |
| 3032 | -S "skip write certificate request" \ |
| 3033 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3034 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3035 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3036 | -S "X509 - Certificate verification failed" |
| 3037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3038 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3039 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3040 | "$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] | 3041 | 0 \ |
| 3042 | -C "skip parse certificate request" \ |
| 3043 | -c "got a certificate request" \ |
| 3044 | -C "skip write certificate$" \ |
| 3045 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3046 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3047 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3048 | run_test "Authentication: client no cert, openssl server required" \ |
| 3049 | "$O_SRV -Verify 10" \ |
| 3050 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3051 | 1 \ |
| 3052 | -C "skip parse certificate request" \ |
| 3053 | -c "got a certificate request" \ |
| 3054 | -C "skip write certificate$" \ |
| 3055 | -c "skip write certificate verify" \ |
| 3056 | -c "! mbedtls_ssl_handshake returned" |
| 3057 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3058 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3059 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3060 | "$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] | 3061 | "$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] | 3062 | 0 \ |
| 3063 | -S "skip write certificate request" \ |
| 3064 | -C "skip parse certificate request" \ |
| 3065 | -c "got a certificate request" \ |
| 3066 | -C "skip write certificate$" \ |
| 3067 | -c "skip write certificate verify" \ |
| 3068 | -c "got no certificate to send" \ |
| 3069 | -s "SSLv3 client has no certificate" \ |
| 3070 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3071 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3072 | -S "! mbedtls_ssl_handshake returned" \ |
| 3073 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3074 | -S "X509 - Certificate verification failed" |
| 3075 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3076 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3077 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3078 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3079 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3080 | 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] | 3081 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3082 | 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] | 3083 | 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] | 3084 | 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] | 3085 | printf "test value of ${MAX_IM_CA}. \n" |
| 3086 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3087 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3088 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3089 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3090 | |
| 3091 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3092 | fi |
| 3093 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3094 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3095 | run_test "Authentication: server max_int chain, client default" \ |
| 3096 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3097 | key_file=data_files/dir-maxpath/09.key" \ |
| 3098 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3099 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3100 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3101 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3102 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3103 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3104 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3105 | key_file=data_files/dir-maxpath/10.key" \ |
| 3106 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3107 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3108 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3109 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3110 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3111 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3112 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3113 | key_file=data_files/dir-maxpath/10.key" \ |
| 3114 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3115 | auth_mode=optional" \ |
| 3116 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3117 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3118 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3119 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3120 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3121 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3122 | key_file=data_files/dir-maxpath/10.key" \ |
| 3123 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3124 | auth_mode=none" \ |
| 3125 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3126 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3127 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3128 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3129 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3130 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3131 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3132 | key_file=data_files/dir-maxpath/10.key" \ |
| 3133 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3134 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3135 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3136 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3137 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3138 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3139 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3140 | key_file=data_files/dir-maxpath/10.key" \ |
| 3141 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3142 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3143 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3144 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3145 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3146 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3147 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3148 | key_file=data_files/dir-maxpath/10.key" \ |
| 3149 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3150 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3151 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3152 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3153 | run_test "Authentication: client max_int chain, server required" \ |
| 3154 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3155 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3156 | key_file=data_files/dir-maxpath/09.key" \ |
| 3157 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3158 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3159 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3160 | # Tests for CA list in CertificateRequest messages |
| 3161 | |
| 3162 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3163 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3164 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3165 | key_file=data_files/server6.key" \ |
| 3166 | 0 \ |
| 3167 | -s "requested DN" |
| 3168 | |
| 3169 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3170 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3171 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3172 | key_file=data_files/server6.key" \ |
| 3173 | 0 \ |
| 3174 | -S "requested DN" |
| 3175 | |
| 3176 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3177 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3178 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3179 | key_file=data_files/server5.key" \ |
| 3180 | 1 \ |
| 3181 | -S "requested DN" \ |
| 3182 | -s "x509_verify_cert() returned" \ |
| 3183 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3184 | -s "! mbedtls_ssl_handshake returned" \ |
| 3185 | -c "! mbedtls_ssl_handshake returned" \ |
| 3186 | -s "X509 - Certificate verification failed" |
| 3187 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3188 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3189 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3190 | |
| 3191 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3192 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3193 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3194 | key_file=data_files/server5.key" \ |
| 3195 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3196 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3197 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3198 | -c "x509_verify_cert() returned" \ |
| 3199 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3200 | -c "! mbedtls_ssl_handshake returned" \ |
| 3201 | -c "X509 - Certificate verification failed" |
| 3202 | |
| 3203 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3204 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3205 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3206 | key_file=data_files/server5.key" \ |
| 3207 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3208 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3209 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3210 | -c "x509_verify_cert() returned" \ |
| 3211 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3212 | -C "! mbedtls_ssl_handshake returned" \ |
| 3213 | -C "X509 - Certificate verification failed" |
| 3214 | |
| 3215 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3216 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3217 | # the client informs the server about the supported curves - it does, though, in the |
| 3218 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3219 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3220 | # different means to have the server ignoring the client's supported curve list. |
| 3221 | |
| 3222 | requires_config_enabled MBEDTLS_ECP_C |
| 3223 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3224 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3225 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3226 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3227 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3228 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3229 | -c "use CA callback for X.509 CRT verification" \ |
| 3230 | -c "bad certificate (EC key curve)" \ |
| 3231 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3232 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3233 | |
| 3234 | requires_config_enabled MBEDTLS_ECP_C |
| 3235 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3236 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3237 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3238 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3239 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3240 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3241 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3242 | -c "bad certificate (EC key curve)"\ |
| 3243 | -c "! Certificate verification flags"\ |
| 3244 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3245 | |
| 3246 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3247 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 3248 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3249 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3250 | key_file=data_files/server6.key \ |
| 3251 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3252 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3253 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3254 | -c "Supported Signature Algorithm found: 4," \ |
| 3255 | -c "Supported Signature Algorithm found: 5," |
| 3256 | |
| 3257 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3258 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 3259 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3260 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3261 | key_file=data_files/server6.key \ |
| 3262 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3263 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3264 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3265 | -c "Supported Signature Algorithm found: 4," \ |
| 3266 | -c "Supported Signature Algorithm found: 5," |
| 3267 | |
| 3268 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3269 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 3270 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3271 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3272 | key_file=data_files/server5.key" \ |
| 3273 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3274 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3275 | -S "skip write certificate request" \ |
| 3276 | -C "skip parse certificate request" \ |
| 3277 | -c "got a certificate request" \ |
| 3278 | -C "skip write certificate" \ |
| 3279 | -C "skip write certificate verify" \ |
| 3280 | -S "skip parse certificate verify" \ |
| 3281 | -s "x509_verify_cert() returned" \ |
| 3282 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3283 | -s "! mbedtls_ssl_handshake returned" \ |
| 3284 | -s "send alert level=2 message=48" \ |
| 3285 | -c "! mbedtls_ssl_handshake returned" \ |
| 3286 | -s "X509 - Certificate verification failed" |
| 3287 | # We don't check that the client receives the alert because it might |
| 3288 | # detect that its write end of the connection is closed and abort |
| 3289 | # before reading the alert message. |
| 3290 | |
| 3291 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3292 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 3293 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3294 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3295 | key_file=data_files/server5.key" \ |
| 3296 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3297 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3298 | -S "skip write certificate request" \ |
| 3299 | -C "skip parse certificate request" \ |
| 3300 | -c "got a certificate request" \ |
| 3301 | -C "skip write certificate" \ |
| 3302 | -C "skip write certificate verify" \ |
| 3303 | -S "skip parse certificate verify" \ |
| 3304 | -s "x509_verify_cert() returned" \ |
| 3305 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3306 | -s "! mbedtls_ssl_handshake returned" \ |
| 3307 | -c "! mbedtls_ssl_handshake returned" \ |
| 3308 | -s "X509 - Certificate verification failed" |
| 3309 | |
| 3310 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3311 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 3312 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3313 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3314 | key_file=data_files/server5.key" \ |
| 3315 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3316 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3317 | -S "skip write certificate request" \ |
| 3318 | -C "skip parse certificate request" \ |
| 3319 | -c "got a certificate request" \ |
| 3320 | -C "skip write certificate" \ |
| 3321 | -C "skip write certificate verify" \ |
| 3322 | -S "skip parse certificate verify" \ |
| 3323 | -s "x509_verify_cert() returned" \ |
| 3324 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3325 | -S "! mbedtls_ssl_handshake returned" \ |
| 3326 | -C "! mbedtls_ssl_handshake returned" \ |
| 3327 | -S "X509 - Certificate verification failed" |
| 3328 | |
| 3329 | requires_full_size_output_buffer |
| 3330 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3331 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 3332 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3333 | key_file=data_files/dir-maxpath/09.key" \ |
| 3334 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3335 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3336 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3337 | -C "X509 - A fatal error occurred" |
| 3338 | |
| 3339 | requires_full_size_output_buffer |
| 3340 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3341 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 3342 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3343 | key_file=data_files/dir-maxpath/10.key" \ |
| 3344 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3345 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3346 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3347 | -c "X509 - A fatal error occurred" |
| 3348 | |
| 3349 | requires_full_size_output_buffer |
| 3350 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3351 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 3352 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3353 | key_file=data_files/dir-maxpath/10.key" \ |
| 3354 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3355 | debug_level=3 auth_mode=optional" \ |
| 3356 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3357 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3358 | -c "X509 - A fatal error occurred" |
| 3359 | |
| 3360 | requires_full_size_output_buffer |
| 3361 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3362 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 3363 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3364 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3365 | key_file=data_files/dir-maxpath/10.key" \ |
| 3366 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3367 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3368 | -s "X509 - A fatal error occurred" |
| 3369 | |
| 3370 | requires_full_size_output_buffer |
| 3371 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3372 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 3373 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3374 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3375 | key_file=data_files/dir-maxpath/10.key" \ |
| 3376 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3377 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3378 | -s "X509 - A fatal error occurred" |
| 3379 | |
| 3380 | requires_full_size_output_buffer |
| 3381 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3382 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 3383 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3384 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3385 | key_file=data_files/dir-maxpath/09.key" \ |
| 3386 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3387 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3388 | -S "X509 - A fatal error occurred" |
| 3389 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3390 | # Tests for certificate selection based on SHA verson |
| 3391 | |
| 3392 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3393 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3394 | key_file=data_files/server5.key \ |
| 3395 | crt_file2=data_files/server5-sha1.crt \ |
| 3396 | key_file2=data_files/server5.key" \ |
| 3397 | "$P_CLI force_version=tls1_2" \ |
| 3398 | 0 \ |
| 3399 | -c "signed using.*ECDSA with SHA256" \ |
| 3400 | -C "signed using.*ECDSA with SHA1" |
| 3401 | |
| 3402 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3403 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3404 | key_file=data_files/server5.key \ |
| 3405 | crt_file2=data_files/server5-sha1.crt \ |
| 3406 | key_file2=data_files/server5.key" \ |
| 3407 | "$P_CLI force_version=tls1_1" \ |
| 3408 | 0 \ |
| 3409 | -C "signed using.*ECDSA with SHA256" \ |
| 3410 | -c "signed using.*ECDSA with SHA1" |
| 3411 | |
| 3412 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3413 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3414 | key_file=data_files/server5.key \ |
| 3415 | crt_file2=data_files/server5-sha1.crt \ |
| 3416 | key_file2=data_files/server5.key" \ |
| 3417 | "$P_CLI force_version=tls1" \ |
| 3418 | 0 \ |
| 3419 | -C "signed using.*ECDSA with SHA256" \ |
| 3420 | -c "signed using.*ECDSA with SHA1" |
| 3421 | |
| 3422 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3423 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3424 | key_file=data_files/server5.key \ |
| 3425 | crt_file2=data_files/server6.crt \ |
| 3426 | key_file2=data_files/server6.key" \ |
| 3427 | "$P_CLI force_version=tls1_1" \ |
| 3428 | 0 \ |
| 3429 | -c "serial number.*09" \ |
| 3430 | -c "signed using.*ECDSA with SHA256" \ |
| 3431 | -C "signed using.*ECDSA with SHA1" |
| 3432 | |
| 3433 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3434 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3435 | key_file=data_files/server6.key \ |
| 3436 | crt_file2=data_files/server5.crt \ |
| 3437 | key_file2=data_files/server5.key" \ |
| 3438 | "$P_CLI force_version=tls1_1" \ |
| 3439 | 0 \ |
| 3440 | -c "serial number.*0A" \ |
| 3441 | -c "signed using.*ECDSA with SHA256" \ |
| 3442 | -C "signed using.*ECDSA with SHA1" |
| 3443 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3444 | # tests for SNI |
| 3445 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3446 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3447 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3448 | 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] | 3449 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3450 | 0 \ |
| 3451 | -S "parse ServerName extension" \ |
| 3452 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3453 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3454 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3455 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3456 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3457 | 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] | 3458 | 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] | 3459 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3460 | 0 \ |
| 3461 | -s "parse ServerName extension" \ |
| 3462 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3463 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3465 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3466 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3467 | 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] | 3468 | 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] | 3469 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3470 | 0 \ |
| 3471 | -s "parse ServerName extension" \ |
| 3472 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3473 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3475 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3476 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3477 | 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] | 3478 | 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] | 3479 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3480 | 1 \ |
| 3481 | -s "parse ServerName extension" \ |
| 3482 | -s "ssl_sni_wrapper() returned" \ |
| 3483 | -s "mbedtls_ssl_handshake returned" \ |
| 3484 | -c "mbedtls_ssl_handshake returned" \ |
| 3485 | -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] | 3486 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3487 | run_test "SNI: client auth no override: optional" \ |
| 3488 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3489 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3490 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3491 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3492 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3493 | -S "skip write certificate request" \ |
| 3494 | -C "skip parse certificate request" \ |
| 3495 | -c "got a certificate request" \ |
| 3496 | -C "skip write certificate" \ |
| 3497 | -C "skip write certificate verify" \ |
| 3498 | -S "skip parse certificate verify" |
| 3499 | |
| 3500 | run_test "SNI: client auth override: none -> optional" \ |
| 3501 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3502 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3503 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3504 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3505 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3506 | -S "skip write certificate request" \ |
| 3507 | -C "skip parse certificate request" \ |
| 3508 | -c "got a certificate request" \ |
| 3509 | -C "skip write certificate" \ |
| 3510 | -C "skip write certificate verify" \ |
| 3511 | -S "skip parse certificate verify" |
| 3512 | |
| 3513 | run_test "SNI: client auth override: optional -> none" \ |
| 3514 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3515 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3516 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3517 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3518 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3519 | -s "skip write certificate request" \ |
| 3520 | -C "skip parse certificate request" \ |
| 3521 | -c "got no certificate request" \ |
| 3522 | -c "skip write certificate" \ |
| 3523 | -c "skip write certificate verify" \ |
| 3524 | -s "skip parse certificate verify" |
| 3525 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3526 | run_test "SNI: CA no override" \ |
| 3527 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3528 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3529 | ca_file=data_files/test-ca.crt \ |
| 3530 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3531 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3532 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3533 | 1 \ |
| 3534 | -S "skip write certificate request" \ |
| 3535 | -C "skip parse certificate request" \ |
| 3536 | -c "got a certificate request" \ |
| 3537 | -C "skip write certificate" \ |
| 3538 | -C "skip write certificate verify" \ |
| 3539 | -S "skip parse certificate verify" \ |
| 3540 | -s "x509_verify_cert() returned" \ |
| 3541 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3542 | -S "The certificate has been revoked (is on a CRL)" |
| 3543 | |
| 3544 | run_test "SNI: CA override" \ |
| 3545 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3546 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3547 | ca_file=data_files/test-ca.crt \ |
| 3548 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3549 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3550 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3551 | 0 \ |
| 3552 | -S "skip write certificate request" \ |
| 3553 | -C "skip parse certificate request" \ |
| 3554 | -c "got a certificate request" \ |
| 3555 | -C "skip write certificate" \ |
| 3556 | -C "skip write certificate verify" \ |
| 3557 | -S "skip parse certificate verify" \ |
| 3558 | -S "x509_verify_cert() returned" \ |
| 3559 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3560 | -S "The certificate has been revoked (is on a CRL)" |
| 3561 | |
| 3562 | run_test "SNI: CA override with CRL" \ |
| 3563 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3564 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3565 | ca_file=data_files/test-ca.crt \ |
| 3566 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3567 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3568 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3569 | 1 \ |
| 3570 | -S "skip write certificate request" \ |
| 3571 | -C "skip parse certificate request" \ |
| 3572 | -c "got a certificate request" \ |
| 3573 | -C "skip write certificate" \ |
| 3574 | -C "skip write certificate verify" \ |
| 3575 | -S "skip parse certificate verify" \ |
| 3576 | -s "x509_verify_cert() returned" \ |
| 3577 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3578 | -s "The certificate has been revoked (is on a CRL)" |
| 3579 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3580 | # Tests for SNI and DTLS |
| 3581 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3582 | run_test "SNI: DTLS, no SNI callback" \ |
| 3583 | "$P_SRV debug_level=3 dtls=1 \ |
| 3584 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3585 | "$P_CLI server_name=localhost dtls=1" \ |
| 3586 | 0 \ |
| 3587 | -S "parse ServerName extension" \ |
| 3588 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3589 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3590 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3591 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3592 | "$P_SRV debug_level=3 dtls=1 \ |
| 3593 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3594 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3595 | "$P_CLI server_name=localhost dtls=1" \ |
| 3596 | 0 \ |
| 3597 | -s "parse ServerName extension" \ |
| 3598 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3599 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3600 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3601 | run_test "SNI: DTLS, matching cert 2" \ |
| 3602 | "$P_SRV debug_level=3 dtls=1 \ |
| 3603 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3604 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3605 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3606 | 0 \ |
| 3607 | -s "parse ServerName extension" \ |
| 3608 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3609 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3610 | |
| 3611 | run_test "SNI: DTLS, no matching cert" \ |
| 3612 | "$P_SRV debug_level=3 dtls=1 \ |
| 3613 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3614 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3615 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3616 | 1 \ |
| 3617 | -s "parse ServerName extension" \ |
| 3618 | -s "ssl_sni_wrapper() returned" \ |
| 3619 | -s "mbedtls_ssl_handshake returned" \ |
| 3620 | -c "mbedtls_ssl_handshake returned" \ |
| 3621 | -c "SSL - A fatal alert message was received from our peer" |
| 3622 | |
| 3623 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3624 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3625 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3626 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3627 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3628 | 0 \ |
| 3629 | -S "skip write certificate request" \ |
| 3630 | -C "skip parse certificate request" \ |
| 3631 | -c "got a certificate request" \ |
| 3632 | -C "skip write certificate" \ |
| 3633 | -C "skip write certificate verify" \ |
| 3634 | -S "skip parse certificate verify" |
| 3635 | |
| 3636 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3637 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3638 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3639 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3640 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3641 | 0 \ |
| 3642 | -S "skip write certificate request" \ |
| 3643 | -C "skip parse certificate request" \ |
| 3644 | -c "got a certificate request" \ |
| 3645 | -C "skip write certificate" \ |
| 3646 | -C "skip write certificate verify" \ |
| 3647 | -S "skip parse certificate verify" |
| 3648 | |
| 3649 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3650 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3651 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3652 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3653 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3654 | 0 \ |
| 3655 | -s "skip write certificate request" \ |
| 3656 | -C "skip parse certificate request" \ |
| 3657 | -c "got no certificate request" \ |
| 3658 | -c "skip write certificate" \ |
| 3659 | -c "skip write certificate verify" \ |
| 3660 | -s "skip parse certificate verify" |
| 3661 | |
| 3662 | run_test "SNI: DTLS, CA no override" \ |
| 3663 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3664 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3665 | ca_file=data_files/test-ca.crt \ |
| 3666 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3667 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3668 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3669 | 1 \ |
| 3670 | -S "skip write certificate request" \ |
| 3671 | -C "skip parse certificate request" \ |
| 3672 | -c "got a certificate request" \ |
| 3673 | -C "skip write certificate" \ |
| 3674 | -C "skip write certificate verify" \ |
| 3675 | -S "skip parse certificate verify" \ |
| 3676 | -s "x509_verify_cert() returned" \ |
| 3677 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3678 | -S "The certificate has been revoked (is on a CRL)" |
| 3679 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3680 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3681 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3682 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3683 | ca_file=data_files/test-ca.crt \ |
| 3684 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3685 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3686 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3687 | 0 \ |
| 3688 | -S "skip write certificate request" \ |
| 3689 | -C "skip parse certificate request" \ |
| 3690 | -c "got a certificate request" \ |
| 3691 | -C "skip write certificate" \ |
| 3692 | -C "skip write certificate verify" \ |
| 3693 | -S "skip parse certificate verify" \ |
| 3694 | -S "x509_verify_cert() returned" \ |
| 3695 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3696 | -S "The certificate has been revoked (is on a CRL)" |
| 3697 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3698 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3699 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3700 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3701 | ca_file=data_files/test-ca.crt \ |
| 3702 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3703 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3704 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3705 | 1 \ |
| 3706 | -S "skip write certificate request" \ |
| 3707 | -C "skip parse certificate request" \ |
| 3708 | -c "got a certificate request" \ |
| 3709 | -C "skip write certificate" \ |
| 3710 | -C "skip write certificate verify" \ |
| 3711 | -S "skip parse certificate verify" \ |
| 3712 | -s "x509_verify_cert() returned" \ |
| 3713 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3714 | -s "The certificate has been revoked (is on a CRL)" |
| 3715 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3716 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3718 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3719 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3720 | "$P_CLI nbio=2 tickets=0" \ |
| 3721 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3722 | -S "mbedtls_ssl_handshake returned" \ |
| 3723 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3724 | -c "Read from server: .* bytes read" |
| 3725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3726 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3727 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3728 | "$P_CLI nbio=2 tickets=0" \ |
| 3729 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3730 | -S "mbedtls_ssl_handshake returned" \ |
| 3731 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3732 | -c "Read from server: .* bytes read" |
| 3733 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3734 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3735 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3736 | "$P_CLI nbio=2 tickets=1" \ |
| 3737 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3738 | -S "mbedtls_ssl_handshake returned" \ |
| 3739 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3740 | -c "Read from server: .* bytes read" |
| 3741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3742 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3743 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3744 | "$P_CLI nbio=2 tickets=1" \ |
| 3745 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3746 | -S "mbedtls_ssl_handshake returned" \ |
| 3747 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3748 | -c "Read from server: .* bytes read" |
| 3749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3750 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3751 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3752 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3753 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3754 | -S "mbedtls_ssl_handshake returned" \ |
| 3755 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3756 | -c "Read from server: .* bytes read" |
| 3757 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3758 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3759 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3760 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3761 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3762 | -S "mbedtls_ssl_handshake returned" \ |
| 3763 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3764 | -c "Read from server: .* bytes read" |
| 3765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3766 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3767 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3768 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3769 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3770 | -S "mbedtls_ssl_handshake returned" \ |
| 3771 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3772 | -c "Read from server: .* bytes read" |
| 3773 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3774 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3775 | |
| 3776 | run_test "Event-driven I/O: basic handshake" \ |
| 3777 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3778 | "$P_CLI event=1 tickets=0" \ |
| 3779 | 0 \ |
| 3780 | -S "mbedtls_ssl_handshake returned" \ |
| 3781 | -C "mbedtls_ssl_handshake returned" \ |
| 3782 | -c "Read from server: .* bytes read" |
| 3783 | |
| 3784 | run_test "Event-driven I/O: client auth" \ |
| 3785 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3786 | "$P_CLI event=1 tickets=0" \ |
| 3787 | 0 \ |
| 3788 | -S "mbedtls_ssl_handshake returned" \ |
| 3789 | -C "mbedtls_ssl_handshake returned" \ |
| 3790 | -c "Read from server: .* bytes read" |
| 3791 | |
| 3792 | run_test "Event-driven I/O: ticket" \ |
| 3793 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3794 | "$P_CLI event=1 tickets=1" \ |
| 3795 | 0 \ |
| 3796 | -S "mbedtls_ssl_handshake returned" \ |
| 3797 | -C "mbedtls_ssl_handshake returned" \ |
| 3798 | -c "Read from server: .* bytes read" |
| 3799 | |
| 3800 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3801 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3802 | "$P_CLI event=1 tickets=1" \ |
| 3803 | 0 \ |
| 3804 | -S "mbedtls_ssl_handshake returned" \ |
| 3805 | -C "mbedtls_ssl_handshake returned" \ |
| 3806 | -c "Read from server: .* bytes read" |
| 3807 | |
| 3808 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3809 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3810 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3811 | 0 \ |
| 3812 | -S "mbedtls_ssl_handshake returned" \ |
| 3813 | -C "mbedtls_ssl_handshake returned" \ |
| 3814 | -c "Read from server: .* bytes read" |
| 3815 | |
| 3816 | run_test "Event-driven I/O: ticket + resume" \ |
| 3817 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3818 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3819 | 0 \ |
| 3820 | -S "mbedtls_ssl_handshake returned" \ |
| 3821 | -C "mbedtls_ssl_handshake returned" \ |
| 3822 | -c "Read from server: .* bytes read" |
| 3823 | |
| 3824 | run_test "Event-driven I/O: session-id resume" \ |
| 3825 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3826 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3827 | 0 \ |
| 3828 | -S "mbedtls_ssl_handshake returned" \ |
| 3829 | -C "mbedtls_ssl_handshake returned" \ |
| 3830 | -c "Read from server: .* bytes read" |
| 3831 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3832 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3833 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3834 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3835 | 0 \ |
| 3836 | -c "Read from server: .* bytes read" |
| 3837 | |
| 3838 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3839 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3840 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3841 | 0 \ |
| 3842 | -c "Read from server: .* bytes read" |
| 3843 | |
| 3844 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3845 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3846 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3847 | 0 \ |
| 3848 | -c "Read from server: .* bytes read" |
| 3849 | |
| 3850 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3851 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3852 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3853 | 0 \ |
| 3854 | -c "Read from server: .* bytes read" |
| 3855 | |
| 3856 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3857 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3858 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3859 | 0 \ |
| 3860 | -c "Read from server: .* bytes read" |
| 3861 | |
| 3862 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3863 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3864 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3865 | 0 \ |
| 3866 | -c "Read from server: .* bytes read" |
| 3867 | |
| 3868 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3869 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3870 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3871 | 0 \ |
| 3872 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3873 | |
| 3874 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3875 | # During session resumption, the client will send its ApplicationData record |
| 3876 | # within the same datagram as the Finished messages. In this situation, the |
| 3877 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3878 | # because the ApplicationData request has already been queued internally. |
| 3879 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3880 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3881 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3882 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3883 | 0 \ |
| 3884 | -c "Read from server: .* bytes read" |
| 3885 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3886 | # Tests for version negotiation |
| 3887 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3888 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3889 | "$P_SRV" \ |
| 3890 | "$P_CLI" \ |
| 3891 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3892 | -S "mbedtls_ssl_handshake returned" \ |
| 3893 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3894 | -s "Protocol is TLSv1.2" \ |
| 3895 | -c "Protocol is TLSv1.2" |
| 3896 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3897 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3898 | "$P_SRV" \ |
| 3899 | "$P_CLI max_version=tls1_1" \ |
| 3900 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3901 | -S "mbedtls_ssl_handshake returned" \ |
| 3902 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3903 | -s "Protocol is TLSv1.1" \ |
| 3904 | -c "Protocol is TLSv1.1" |
| 3905 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3906 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3907 | "$P_SRV max_version=tls1_1" \ |
| 3908 | "$P_CLI" \ |
| 3909 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3910 | -S "mbedtls_ssl_handshake returned" \ |
| 3911 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3912 | -s "Protocol is TLSv1.1" \ |
| 3913 | -c "Protocol is TLSv1.1" |
| 3914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3915 | 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] | 3916 | "$P_SRV max_version=tls1_1" \ |
| 3917 | "$P_CLI max_version=tls1_1" \ |
| 3918 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3919 | -S "mbedtls_ssl_handshake returned" \ |
| 3920 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3921 | -s "Protocol is TLSv1.1" \ |
| 3922 | -c "Protocol is TLSv1.1" |
| 3923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3924 | 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] | 3925 | "$P_SRV min_version=tls1_1" \ |
| 3926 | "$P_CLI max_version=tls1_1" \ |
| 3927 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3928 | -S "mbedtls_ssl_handshake returned" \ |
| 3929 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3930 | -s "Protocol is TLSv1.1" \ |
| 3931 | -c "Protocol is TLSv1.1" |
| 3932 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3933 | 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] | 3934 | "$P_SRV max_version=tls1_1" \ |
| 3935 | "$P_CLI min_version=tls1_1" \ |
| 3936 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3937 | -S "mbedtls_ssl_handshake returned" \ |
| 3938 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3939 | -s "Protocol is TLSv1.1" \ |
| 3940 | -c "Protocol is TLSv1.1" |
| 3941 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3942 | 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] | 3943 | "$P_SRV max_version=tls1_1" \ |
| 3944 | "$P_CLI min_version=tls1_2" \ |
| 3945 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3946 | -s "mbedtls_ssl_handshake returned" \ |
| 3947 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3948 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3949 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3950 | 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] | 3951 | "$P_SRV min_version=tls1_2" \ |
| 3952 | "$P_CLI max_version=tls1_1" \ |
| 3953 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3954 | -s "mbedtls_ssl_handshake returned" \ |
| 3955 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3956 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3957 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3958 | # Tests for ALPN extension |
| 3959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3960 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3961 | "$P_SRV debug_level=3" \ |
| 3962 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3963 | 0 \ |
| 3964 | -C "client hello, adding alpn extension" \ |
| 3965 | -S "found alpn extension" \ |
| 3966 | -C "got an alert message, type: \\[2:120]" \ |
| 3967 | -S "server hello, adding alpn extension" \ |
| 3968 | -C "found alpn extension " \ |
| 3969 | -C "Application Layer Protocol is" \ |
| 3970 | -S "Application Layer Protocol is" |
| 3971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3972 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3973 | "$P_SRV debug_level=3" \ |
| 3974 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3975 | 0 \ |
| 3976 | -c "client hello, adding alpn extension" \ |
| 3977 | -s "found alpn extension" \ |
| 3978 | -C "got an alert message, type: \\[2:120]" \ |
| 3979 | -S "server hello, adding alpn extension" \ |
| 3980 | -C "found alpn extension " \ |
| 3981 | -c "Application Layer Protocol is (none)" \ |
| 3982 | -S "Application Layer Protocol is" |
| 3983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3985 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3986 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3987 | 0 \ |
| 3988 | -C "client hello, adding alpn extension" \ |
| 3989 | -S "found alpn extension" \ |
| 3990 | -C "got an alert message, type: \\[2:120]" \ |
| 3991 | -S "server hello, adding alpn extension" \ |
| 3992 | -C "found alpn extension " \ |
| 3993 | -C "Application Layer Protocol is" \ |
| 3994 | -s "Application Layer Protocol is (none)" |
| 3995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3996 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3997 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3998 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3999 | 0 \ |
| 4000 | -c "client hello, adding alpn extension" \ |
| 4001 | -s "found alpn extension" \ |
| 4002 | -C "got an alert message, type: \\[2:120]" \ |
| 4003 | -s "server hello, adding alpn extension" \ |
| 4004 | -c "found alpn extension" \ |
| 4005 | -c "Application Layer Protocol is abc" \ |
| 4006 | -s "Application Layer Protocol is abc" |
| 4007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4008 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4009 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4010 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4011 | 0 \ |
| 4012 | -c "client hello, adding alpn extension" \ |
| 4013 | -s "found alpn extension" \ |
| 4014 | -C "got an alert message, type: \\[2:120]" \ |
| 4015 | -s "server hello, adding alpn extension" \ |
| 4016 | -c "found alpn extension" \ |
| 4017 | -c "Application Layer Protocol is abc" \ |
| 4018 | -s "Application Layer Protocol is abc" |
| 4019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4020 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4021 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4022 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4023 | 0 \ |
| 4024 | -c "client hello, adding alpn extension" \ |
| 4025 | -s "found alpn extension" \ |
| 4026 | -C "got an alert message, type: \\[2:120]" \ |
| 4027 | -s "server hello, adding alpn extension" \ |
| 4028 | -c "found alpn extension" \ |
| 4029 | -c "Application Layer Protocol is 1234" \ |
| 4030 | -s "Application Layer Protocol is 1234" |
| 4031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4032 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4034 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4035 | 1 \ |
| 4036 | -c "client hello, adding alpn extension" \ |
| 4037 | -s "found alpn extension" \ |
| 4038 | -c "got an alert message, type: \\[2:120]" \ |
| 4039 | -S "server hello, adding alpn extension" \ |
| 4040 | -C "found alpn extension" \ |
| 4041 | -C "Application Layer Protocol is 1234" \ |
| 4042 | -S "Application Layer Protocol is 1234" |
| 4043 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4044 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4045 | # Tests for keyUsage in leaf certificates, part 1: |
| 4046 | # server-side certificate/suite selection |
| 4047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4048 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4049 | "$P_SRV key_file=data_files/server2.key \ |
| 4050 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4051 | "$P_CLI" \ |
| 4052 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4053 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4054 | |
| 4055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4056 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4057 | "$P_SRV key_file=data_files/server2.key \ |
| 4058 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4059 | "$P_CLI" \ |
| 4060 | 0 \ |
| 4061 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4062 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4063 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4064 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4065 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4066 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4067 | 1 \ |
| 4068 | -C "Ciphersuite is " |
| 4069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4070 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4071 | "$P_SRV key_file=data_files/server5.key \ |
| 4072 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4073 | "$P_CLI" \ |
| 4074 | 0 \ |
| 4075 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4076 | |
| 4077 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4078 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4079 | "$P_SRV key_file=data_files/server5.key \ |
| 4080 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4081 | "$P_CLI" \ |
| 4082 | 0 \ |
| 4083 | -c "Ciphersuite is TLS-ECDH-" |
| 4084 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4085 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4086 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4087 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4088 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4089 | 1 \ |
| 4090 | -C "Ciphersuite is " |
| 4091 | |
| 4092 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4093 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4095 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4096 | "$O_SRV -key data_files/server2.key \ |
| 4097 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4098 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4099 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4100 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4101 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4102 | -C "Processing of the Certificate handshake message failed" \ |
| 4103 | -c "Ciphersuite is TLS-" |
| 4104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4106 | "$O_SRV -key data_files/server2.key \ |
| 4107 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4108 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4109 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4110 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4111 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4112 | -C "Processing of the Certificate handshake message failed" \ |
| 4113 | -c "Ciphersuite is TLS-" |
| 4114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4115 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4116 | "$O_SRV -key data_files/server2.key \ |
| 4117 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4118 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4119 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4120 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4121 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4122 | -C "Processing of the Certificate handshake message failed" \ |
| 4123 | -c "Ciphersuite is TLS-" |
| 4124 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4125 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4126 | "$O_SRV -key data_files/server2.key \ |
| 4127 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4128 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4129 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4130 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4131 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4132 | -c "Processing of the Certificate handshake message failed" \ |
| 4133 | -C "Ciphersuite is TLS-" |
| 4134 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4135 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4136 | "$O_SRV -key data_files/server2.key \ |
| 4137 | -cert data_files/server2.ku-ke.crt" \ |
| 4138 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4139 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4140 | 0 \ |
| 4141 | -c "bad certificate (usage extensions)" \ |
| 4142 | -C "Processing of the Certificate handshake message failed" \ |
| 4143 | -c "Ciphersuite is TLS-" \ |
| 4144 | -c "! Usage does not match the keyUsage extension" |
| 4145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4146 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4147 | "$O_SRV -key data_files/server2.key \ |
| 4148 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4149 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4150 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4151 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4152 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4153 | -C "Processing of the Certificate handshake message failed" \ |
| 4154 | -c "Ciphersuite is TLS-" |
| 4155 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4156 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4157 | "$O_SRV -key data_files/server2.key \ |
| 4158 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4159 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4160 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4161 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4162 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4163 | -c "Processing of the Certificate handshake message failed" \ |
| 4164 | -C "Ciphersuite is TLS-" |
| 4165 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4166 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4167 | "$O_SRV -key data_files/server2.key \ |
| 4168 | -cert data_files/server2.ku-ds.crt" \ |
| 4169 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4170 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4171 | 0 \ |
| 4172 | -c "bad certificate (usage extensions)" \ |
| 4173 | -C "Processing of the Certificate handshake message failed" \ |
| 4174 | -c "Ciphersuite is TLS-" \ |
| 4175 | -c "! Usage does not match the keyUsage extension" |
| 4176 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4177 | # Tests for keyUsage in leaf certificates, part 3: |
| 4178 | # server-side checking of client cert |
| 4179 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4180 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4181 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4182 | "$O_CLI -key data_files/server2.key \ |
| 4183 | -cert data_files/server2.ku-ds.crt" \ |
| 4184 | 0 \ |
| 4185 | -S "bad certificate (usage extensions)" \ |
| 4186 | -S "Processing of the Certificate handshake message failed" |
| 4187 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4188 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4189 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4190 | "$O_CLI -key data_files/server2.key \ |
| 4191 | -cert data_files/server2.ku-ke.crt" \ |
| 4192 | 0 \ |
| 4193 | -s "bad certificate (usage extensions)" \ |
| 4194 | -S "Processing of the Certificate handshake message failed" |
| 4195 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4196 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4197 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4198 | "$O_CLI -key data_files/server2.key \ |
| 4199 | -cert data_files/server2.ku-ke.crt" \ |
| 4200 | 1 \ |
| 4201 | -s "bad certificate (usage extensions)" \ |
| 4202 | -s "Processing of the Certificate handshake message failed" |
| 4203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4204 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4205 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4206 | "$O_CLI -key data_files/server5.key \ |
| 4207 | -cert data_files/server5.ku-ds.crt" \ |
| 4208 | 0 \ |
| 4209 | -S "bad certificate (usage extensions)" \ |
| 4210 | -S "Processing of the Certificate handshake message failed" |
| 4211 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4212 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4213 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4214 | "$O_CLI -key data_files/server5.key \ |
| 4215 | -cert data_files/server5.ku-ka.crt" \ |
| 4216 | 0 \ |
| 4217 | -s "bad certificate (usage extensions)" \ |
| 4218 | -S "Processing of the Certificate handshake message failed" |
| 4219 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4220 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4221 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4222 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4223 | "$P_SRV key_file=data_files/server5.key \ |
| 4224 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4225 | "$P_CLI" \ |
| 4226 | 0 |
| 4227 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4228 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4229 | "$P_SRV key_file=data_files/server5.key \ |
| 4230 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4231 | "$P_CLI" \ |
| 4232 | 0 |
| 4233 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4234 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4235 | "$P_SRV key_file=data_files/server5.key \ |
| 4236 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4237 | "$P_CLI" \ |
| 4238 | 0 |
| 4239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4240 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4241 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4242 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4243 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4244 | 1 |
| 4245 | |
| 4246 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4247 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4248 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4249 | "$O_SRV -key data_files/server5.key \ |
| 4250 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4251 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4252 | 0 \ |
| 4253 | -C "bad certificate (usage extensions)" \ |
| 4254 | -C "Processing of the Certificate handshake message failed" \ |
| 4255 | -c "Ciphersuite is TLS-" |
| 4256 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4257 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4258 | "$O_SRV -key data_files/server5.key \ |
| 4259 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4260 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4261 | 0 \ |
| 4262 | -C "bad certificate (usage extensions)" \ |
| 4263 | -C "Processing of the Certificate handshake message failed" \ |
| 4264 | -c "Ciphersuite is TLS-" |
| 4265 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4266 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4267 | "$O_SRV -key data_files/server5.key \ |
| 4268 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4269 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4270 | 0 \ |
| 4271 | -C "bad certificate (usage extensions)" \ |
| 4272 | -C "Processing of the Certificate handshake message failed" \ |
| 4273 | -c "Ciphersuite is TLS-" |
| 4274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4275 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4276 | "$O_SRV -key data_files/server5.key \ |
| 4277 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4278 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4279 | 1 \ |
| 4280 | -c "bad certificate (usage extensions)" \ |
| 4281 | -c "Processing of the Certificate handshake message failed" \ |
| 4282 | -C "Ciphersuite is TLS-" |
| 4283 | |
| 4284 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4286 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4287 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4288 | "$O_CLI -key data_files/server5.key \ |
| 4289 | -cert data_files/server5.eku-cli.crt" \ |
| 4290 | 0 \ |
| 4291 | -S "bad certificate (usage extensions)" \ |
| 4292 | -S "Processing of the Certificate handshake message failed" |
| 4293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4294 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4295 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4296 | "$O_CLI -key data_files/server5.key \ |
| 4297 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4298 | 0 \ |
| 4299 | -S "bad certificate (usage extensions)" \ |
| 4300 | -S "Processing of the Certificate handshake message failed" |
| 4301 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4304 | "$O_CLI -key data_files/server5.key \ |
| 4305 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4306 | 0 \ |
| 4307 | -S "bad certificate (usage extensions)" \ |
| 4308 | -S "Processing of the Certificate handshake message failed" |
| 4309 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4310 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4311 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4312 | "$O_CLI -key data_files/server5.key \ |
| 4313 | -cert data_files/server5.eku-cs.crt" \ |
| 4314 | 0 \ |
| 4315 | -s "bad certificate (usage extensions)" \ |
| 4316 | -S "Processing of the Certificate handshake message failed" |
| 4317 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4318 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4319 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4320 | "$O_CLI -key data_files/server5.key \ |
| 4321 | -cert data_files/server5.eku-cs.crt" \ |
| 4322 | 1 \ |
| 4323 | -s "bad certificate (usage extensions)" \ |
| 4324 | -s "Processing of the Certificate handshake message failed" |
| 4325 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4326 | # Tests for DHM parameters loading |
| 4327 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4328 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4329 | "$P_SRV" \ |
| 4330 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4331 | debug_level=3" \ |
| 4332 | 0 \ |
| 4333 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 4334 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4335 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4336 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4337 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4338 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4339 | debug_level=3" \ |
| 4340 | 0 \ |
| 4341 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4342 | -c "value of 'DHM: G ' (2 bits)" |
| 4343 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4344 | # Tests for DHM client-side size checking |
| 4345 | |
| 4346 | run_test "DHM size: server default, client default, OK" \ |
| 4347 | "$P_SRV" \ |
| 4348 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4349 | debug_level=1" \ |
| 4350 | 0 \ |
| 4351 | -C "DHM prime too short:" |
| 4352 | |
| 4353 | run_test "DHM size: server default, client 2048, OK" \ |
| 4354 | "$P_SRV" \ |
| 4355 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4356 | debug_level=1 dhmlen=2048" \ |
| 4357 | 0 \ |
| 4358 | -C "DHM prime too short:" |
| 4359 | |
| 4360 | run_test "DHM size: server 1024, client default, OK" \ |
| 4361 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4362 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4363 | debug_level=1" \ |
| 4364 | 0 \ |
| 4365 | -C "DHM prime too short:" |
| 4366 | |
| 4367 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4368 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4369 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4370 | debug_level=1" \ |
| 4371 | 1 \ |
| 4372 | -c "DHM prime too short:" |
| 4373 | |
| 4374 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4375 | "$P_SRV" \ |
| 4376 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4377 | debug_level=1 dhmlen=2049" \ |
| 4378 | 1 \ |
| 4379 | -c "DHM prime too short:" |
| 4380 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4381 | # Tests for PSK callback |
| 4382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4384 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4385 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4386 | psk_identity=foo psk=abc123" \ |
| 4387 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4388 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4389 | -S "SSL - Unknown identity received" \ |
| 4390 | -S "SSL - Verification of the message MAC failed" |
| 4391 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4392 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4393 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 4394 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4395 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4396 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4397 | 0 \ |
| 4398 | -c "skip PMS generation for opaque PSK"\ |
| 4399 | -S "skip PMS generation for opaque PSK"\ |
| 4400 | -C "using extended master secret"\ |
| 4401 | -S "using extended master secret"\ |
| 4402 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4403 | -S "SSL - Unknown identity received" \ |
| 4404 | -S "SSL - Verification of the message MAC failed" |
| 4405 | |
| 4406 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4407 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 4408 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4409 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4410 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4411 | 0 \ |
| 4412 | -c "skip PMS generation for opaque PSK"\ |
| 4413 | -S "skip PMS generation for opaque PSK"\ |
| 4414 | -C "using extended master secret"\ |
| 4415 | -S "using extended master secret"\ |
| 4416 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4417 | -S "SSL - Unknown identity received" \ |
| 4418 | -S "SSL - Verification of the message MAC failed" |
| 4419 | |
| 4420 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4421 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 4422 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4423 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4424 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4425 | 0 \ |
| 4426 | -c "skip PMS generation for opaque PSK"\ |
| 4427 | -S "skip PMS generation for opaque PSK"\ |
| 4428 | -c "using extended master secret"\ |
| 4429 | -s "using extended master secret"\ |
| 4430 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4431 | -S "SSL - Unknown identity received" \ |
| 4432 | -S "SSL - Verification of the message MAC failed" |
| 4433 | |
| 4434 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4435 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 4436 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4437 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4438 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4439 | 0 \ |
| 4440 | -c "skip PMS generation for opaque PSK"\ |
| 4441 | -S "skip PMS generation for opaque PSK"\ |
| 4442 | -c "using extended master secret"\ |
| 4443 | -s "using extended master secret"\ |
| 4444 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4445 | -S "SSL - Unknown identity received" \ |
| 4446 | -S "SSL - Verification of the message MAC failed" |
| 4447 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4448 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4449 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4450 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4451 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4452 | psk_identity=foo psk=abc123" \ |
| 4453 | 0 \ |
| 4454 | -C "skip PMS generation for opaque PSK"\ |
| 4455 | -s "skip PMS generation for opaque PSK"\ |
| 4456 | -C "using extended master secret"\ |
| 4457 | -S "using extended master secret"\ |
| 4458 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4459 | -S "SSL - Unknown identity received" \ |
| 4460 | -S "SSL - Verification of the message MAC failed" |
| 4461 | |
| 4462 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4463 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4464 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4465 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4466 | psk_identity=foo psk=abc123" \ |
| 4467 | 0 \ |
| 4468 | -C "skip PMS generation for opaque PSK"\ |
| 4469 | -s "skip PMS generation for opaque PSK"\ |
| 4470 | -C "using extended master secret"\ |
| 4471 | -S "using extended master secret"\ |
| 4472 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4473 | -S "SSL - Unknown identity received" \ |
| 4474 | -S "SSL - Verification of the message MAC failed" |
| 4475 | |
| 4476 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4477 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4478 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4479 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4480 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4481 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4482 | 0 \ |
| 4483 | -c "using extended master secret"\ |
| 4484 | -s "using extended master secret"\ |
| 4485 | -C "skip PMS generation for opaque PSK"\ |
| 4486 | -s "skip PMS generation for opaque PSK"\ |
| 4487 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4488 | -S "SSL - Unknown identity received" \ |
| 4489 | -S "SSL - Verification of the message MAC failed" |
| 4490 | |
| 4491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4492 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4493 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4494 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4495 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4496 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4497 | 0 \ |
| 4498 | -c "using extended master secret"\ |
| 4499 | -s "using extended master secret"\ |
| 4500 | -C "skip PMS generation for opaque PSK"\ |
| 4501 | -s "skip PMS generation for opaque PSK"\ |
| 4502 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4503 | -S "SSL - Unknown identity received" \ |
| 4504 | -S "SSL - Verification of the message MAC failed" |
| 4505 | |
| 4506 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4507 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4508 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4509 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4510 | psk_identity=def psk=beef" \ |
| 4511 | 0 \ |
| 4512 | -C "skip PMS generation for opaque PSK"\ |
| 4513 | -s "skip PMS generation for opaque PSK"\ |
| 4514 | -C "using extended master secret"\ |
| 4515 | -S "using extended master secret"\ |
| 4516 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4517 | -S "SSL - Unknown identity received" \ |
| 4518 | -S "SSL - Verification of the message MAC failed" |
| 4519 | |
| 4520 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4521 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4522 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4523 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4524 | psk_identity=def psk=beef" \ |
| 4525 | 0 \ |
| 4526 | -C "skip PMS generation for opaque PSK"\ |
| 4527 | -s "skip PMS generation for opaque PSK"\ |
| 4528 | -C "using extended master secret"\ |
| 4529 | -S "using extended master secret"\ |
| 4530 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4531 | -S "SSL - Unknown identity received" \ |
| 4532 | -S "SSL - Verification of the message MAC failed" |
| 4533 | |
| 4534 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4535 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4536 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4537 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4538 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4539 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4540 | 0 \ |
| 4541 | -c "using extended master secret"\ |
| 4542 | -s "using extended master secret"\ |
| 4543 | -C "skip PMS generation for opaque PSK"\ |
| 4544 | -s "skip PMS generation for opaque PSK"\ |
| 4545 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4546 | -S "SSL - Unknown identity received" \ |
| 4547 | -S "SSL - Verification of the message MAC failed" |
| 4548 | |
| 4549 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4550 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4551 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4552 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4553 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4554 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4555 | 0 \ |
| 4556 | -c "using extended master secret"\ |
| 4557 | -s "using extended master secret"\ |
| 4558 | -C "skip PMS generation for opaque PSK"\ |
| 4559 | -s "skip PMS generation for opaque PSK"\ |
| 4560 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4561 | -S "SSL - Unknown identity received" \ |
| 4562 | -S "SSL - Verification of the message MAC failed" |
| 4563 | |
| 4564 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4565 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4566 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4567 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4568 | psk_identity=def psk=beef" \ |
| 4569 | 0 \ |
| 4570 | -C "skip PMS generation for opaque PSK"\ |
| 4571 | -s "skip PMS generation for opaque PSK"\ |
| 4572 | -C "using extended master secret"\ |
| 4573 | -S "using extended master secret"\ |
| 4574 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4575 | -S "SSL - Unknown identity received" \ |
| 4576 | -S "SSL - Verification of the message MAC failed" |
| 4577 | |
| 4578 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4579 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4580 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4581 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4582 | psk_identity=def psk=beef" \ |
| 4583 | 0 \ |
| 4584 | -C "skip PMS generation for opaque PSK"\ |
| 4585 | -s "skip PMS generation for opaque PSK"\ |
| 4586 | -C "using extended master secret"\ |
| 4587 | -S "using extended master secret"\ |
| 4588 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4589 | -S "SSL - Unknown identity received" \ |
| 4590 | -S "SSL - Verification of the message MAC failed" |
| 4591 | |
| 4592 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4593 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4594 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4595 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4596 | psk_identity=def psk=beef" \ |
| 4597 | 0 \ |
| 4598 | -C "skip PMS generation for opaque PSK"\ |
| 4599 | -C "using extended master secret"\ |
| 4600 | -S "using extended master secret"\ |
| 4601 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4602 | -S "SSL - Unknown identity received" \ |
| 4603 | -S "SSL - Verification of the message MAC failed" |
| 4604 | |
| 4605 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4606 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4607 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4608 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4609 | psk_identity=def psk=beef" \ |
| 4610 | 0 \ |
| 4611 | -C "skip PMS generation for opaque PSK"\ |
| 4612 | -C "using extended master secret"\ |
| 4613 | -S "using extended master secret"\ |
| 4614 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4615 | -S "SSL - Unknown identity received" \ |
| 4616 | -S "SSL - Verification of the message MAC failed" |
| 4617 | |
| 4618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4619 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 4620 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4621 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4622 | psk_identity=def psk=beef" \ |
| 4623 | 1 \ |
| 4624 | -s "SSL - Verification of the message MAC failed" |
| 4625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4626 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4627 | "$P_SRV" \ |
| 4628 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4629 | psk_identity=foo psk=abc123" \ |
| 4630 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4631 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4632 | -S "SSL - Unknown identity received" \ |
| 4633 | -S "SSL - Verification of the message MAC failed" |
| 4634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4635 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4636 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4637 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4638 | psk_identity=foo psk=abc123" \ |
| 4639 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4640 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4641 | -s "SSL - Unknown identity received" \ |
| 4642 | -S "SSL - Verification of the message MAC failed" |
| 4643 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4644 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4645 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4646 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4647 | psk_identity=abc psk=dead" \ |
| 4648 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4649 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4650 | -S "SSL - Unknown identity received" \ |
| 4651 | -S "SSL - Verification of the message MAC failed" |
| 4652 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4653 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4654 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4655 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4656 | psk_identity=def psk=beef" \ |
| 4657 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4658 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4659 | -S "SSL - Unknown identity received" \ |
| 4660 | -S "SSL - Verification of the message MAC failed" |
| 4661 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4662 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4663 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4664 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4665 | psk_identity=ghi psk=beef" \ |
| 4666 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4667 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4668 | -s "SSL - Unknown identity received" \ |
| 4669 | -S "SSL - Verification of the message MAC failed" |
| 4670 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4671 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4672 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4673 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4674 | psk_identity=abc psk=beef" \ |
| 4675 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4676 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4677 | -S "SSL - Unknown identity received" \ |
| 4678 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4679 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4680 | # Tests for EC J-PAKE |
| 4681 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4682 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4683 | run_test "ECJPAKE: client not configured" \ |
| 4684 | "$P_SRV debug_level=3" \ |
| 4685 | "$P_CLI debug_level=3" \ |
| 4686 | 0 \ |
| 4687 | -C "add ciphersuite: c0ff" \ |
| 4688 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4689 | -S "found ecjpake kkpp extension" \ |
| 4690 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4691 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4692 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4693 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4694 | -S "None of the common ciphersuites is usable" |
| 4695 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4696 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4697 | run_test "ECJPAKE: server not configured" \ |
| 4698 | "$P_SRV debug_level=3" \ |
| 4699 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4700 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4701 | 1 \ |
| 4702 | -c "add ciphersuite: c0ff" \ |
| 4703 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4704 | -s "found ecjpake kkpp extension" \ |
| 4705 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4706 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4707 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4708 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4709 | -s "None of the common ciphersuites is usable" |
| 4710 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4711 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4712 | run_test "ECJPAKE: working, TLS" \ |
| 4713 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4714 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4715 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4716 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4717 | -c "add ciphersuite: c0ff" \ |
| 4718 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4719 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4720 | -s "found ecjpake kkpp extension" \ |
| 4721 | -S "skip ecjpake kkpp extension" \ |
| 4722 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4723 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4724 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4725 | -S "None of the common ciphersuites is usable" \ |
| 4726 | -S "SSL - Verification of the message MAC failed" |
| 4727 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4728 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4730 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4731 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4732 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4733 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4734 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4735 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4736 | -s "SSL - Verification of the message MAC failed" |
| 4737 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4738 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4739 | run_test "ECJPAKE: working, DTLS" \ |
| 4740 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4741 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4742 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4743 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4744 | -c "re-using cached ecjpake parameters" \ |
| 4745 | -S "SSL - Verification of the message MAC failed" |
| 4746 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4747 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4748 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4749 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4750 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4751 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4752 | 0 \ |
| 4753 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4754 | -S "SSL - Verification of the message MAC failed" |
| 4755 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4756 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4757 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4758 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4759 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4760 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4761 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4762 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4763 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4764 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4765 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4766 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4767 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4768 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4769 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4770 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4771 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4772 | 0 |
| 4773 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4774 | # Tests for ciphersuites per version |
| 4775 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4776 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4777 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4778 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4779 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4780 | "$P_SRV min_version=ssl3 version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4781 | "$P_CLI force_version=ssl3" \ |
| 4782 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4783 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4784 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4785 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4786 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4787 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4788 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4789 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 4790 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4791 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4792 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4793 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4795 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4796 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4797 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4798 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4799 | "$P_CLI force_version=tls1_1" \ |
| 4800 | 0 \ |
| 4801 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4802 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4804 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4805 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4806 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4807 | "$P_SRV version_suites=TLS-RSA-WITH-CAMELLIA-128-CBC-SHA,TLS-RSA-WITH-AES-256-CBC-SHA,TLS-RSA-WITH-AES-128-CBC-SHA,TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4808 | "$P_CLI force_version=tls1_2" \ |
| 4809 | 0 \ |
| 4810 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4811 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4812 | # Test for ClientHello without extensions |
| 4813 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4814 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4815 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | 574ac57 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 4816 | "$P_SRV debug_level=3 key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4817 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4818 | 0 \ |
| 4819 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4820 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4821 | requires_gnutls |
| 4822 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 4823 | "$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] | 4824 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4825 | 0 \ |
| 4826 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4827 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4828 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4829 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4830 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4831 | "$P_SRV" \ |
| 4832 | "$P_CLI request_size=100" \ |
| 4833 | 0 \ |
| 4834 | -s "Read from client: 100 bytes read$" |
| 4835 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4836 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4837 | "$P_SRV" \ |
| 4838 | "$P_CLI request_size=500" \ |
| 4839 | 0 \ |
| 4840 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4841 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4842 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4843 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4844 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4845 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4846 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4847 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4848 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4849 | 0 \ |
| 4850 | -s "Read from client: 1 bytes read" |
| 4851 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4852 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4853 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4854 | "$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] | 4855 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4856 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4857 | 0 \ |
| 4858 | -s "Read from client: 1 bytes read" |
| 4859 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4860 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4861 | "$P_SRV" \ |
| 4862 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4864 | 0 \ |
| 4865 | -s "Read from client: 1 bytes read" |
| 4866 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4867 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4868 | "$P_SRV" \ |
| 4869 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4870 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4871 | 0 \ |
| 4872 | -s "Read from client: 1 bytes read" |
| 4873 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4874 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4875 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4876 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4877 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4878 | 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] | 4879 | 0 \ |
| 4880 | -s "Read from client: 1 bytes read" |
| 4881 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4882 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4883 | run_test "Small client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4884 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4885 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4886 | 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] | 4887 | 0 \ |
| 4888 | -s "Read from client: 1 bytes read" |
| 4889 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4890 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4891 | "$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] | 4892 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4893 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4894 | 0 \ |
| 4895 | -s "Read from client: 1 bytes read" |
| 4896 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4897 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4898 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4899 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4900 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4901 | 0 \ |
| 4902 | -s "Read from client: 1 bytes read" |
| 4903 | |
| 4904 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4905 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4906 | "$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] | 4907 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4908 | 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] | 4909 | 0 \ |
| 4910 | -s "Read from client: 1 bytes read" |
| 4911 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4912 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4913 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4914 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4915 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4916 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4917 | 0 \ |
| 4918 | -s "Read from client: 1 bytes read" |
| 4919 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4920 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4921 | "$P_SRV" \ |
| 4922 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4923 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4924 | 0 \ |
| 4925 | -s "Read from client: 1 bytes read" |
| 4926 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4927 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4928 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4929 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4930 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4931 | 0 \ |
| 4932 | -s "Read from client: 1 bytes read" |
| 4933 | |
| 4934 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4935 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4936 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4937 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4938 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4939 | 0 \ |
| 4940 | -s "Read from client: 1 bytes read" |
| 4941 | |
| 4942 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4943 | run_test "Small client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4944 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4945 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4946 | 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] | 4947 | 0 \ |
| 4948 | -s "Read from client: 1 bytes read" |
| 4949 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4950 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4951 | "$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] | 4952 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4953 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4954 | 0 \ |
| 4955 | -s "Read from client: 1 bytes read" |
| 4956 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4957 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4958 | "$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] | 4959 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4960 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4961 | 0 \ |
| 4962 | -s "Read from client: 1 bytes read" |
| 4963 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4964 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4965 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4966 | "$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] | 4967 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4968 | 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] | 4969 | 0 \ |
| 4970 | -s "Read from client: 1 bytes read" |
| 4971 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4973 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4974 | "$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] | 4975 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4976 | 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] | 4977 | 0 \ |
| 4978 | -s "Read from client: 1 bytes read" |
| 4979 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4980 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4981 | "$P_SRV" \ |
| 4982 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4983 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4984 | 0 \ |
| 4985 | -s "Read from client: 1 bytes read" |
| 4986 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4987 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 4988 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4989 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4990 | 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] | 4991 | 0 \ |
| 4992 | -s "Read from client: 1 bytes read" |
| 4993 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4994 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4995 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4996 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4997 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4998 | 0 \ |
| 4999 | -s "Read from client: 1 bytes read" |
| 5000 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5001 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5002 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5003 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5004 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5005 | 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] | 5006 | 0 \ |
| 5007 | -s "Read from client: 1 bytes read" |
| 5008 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5009 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5010 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5011 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5012 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5013 | 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] | 5014 | 0 \ |
| 5015 | -s "Read from client: 1 bytes read" |
| 5016 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5017 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5018 | "$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] | 5019 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5020 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5021 | 0 \ |
| 5022 | -s "Read from client: 1 bytes read" |
| 5023 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5024 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5025 | "$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] | 5026 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5027 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5028 | 0 \ |
| 5029 | -s "Read from client: 1 bytes read" |
| 5030 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5031 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5032 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5033 | "$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] | 5034 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5035 | 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] | 5036 | 0 \ |
| 5037 | -s "Read from client: 1 bytes read" |
| 5038 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5039 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5040 | run_test "Small client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5041 | "$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] | 5042 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5043 | 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] | 5044 | 0 \ |
| 5045 | -s "Read from client: 1 bytes read" |
| 5046 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5047 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5048 | "$P_SRV" \ |
| 5049 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5050 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5051 | 0 \ |
| 5052 | -s "Read from client: 1 bytes read" |
| 5053 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5054 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5055 | "$P_SRV" \ |
| 5056 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5057 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5058 | 0 \ |
| 5059 | -s "Read from client: 1 bytes read" |
| 5060 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5061 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5062 | |
| 5063 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5064 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5065 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5066 | "$P_CLI dtls=1 request_size=1 \ |
| 5067 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5068 | 0 \ |
| 5069 | -s "Read from client: 1 bytes read" |
| 5070 | |
| 5071 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5072 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5073 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5074 | "$P_CLI dtls=1 request_size=1 \ |
| 5075 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5076 | 0 \ |
| 5077 | -s "Read from client: 1 bytes read" |
| 5078 | |
| 5079 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5080 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5081 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5082 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5083 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5084 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5085 | 0 \ |
| 5086 | -s "Read from client: 1 bytes read" |
| 5087 | |
| 5088 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5089 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5090 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5091 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5092 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5093 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5094 | 0 \ |
| 5095 | -s "Read from client: 1 bytes read" |
| 5096 | |
| 5097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5098 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5099 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5100 | "$P_CLI dtls=1 request_size=1 \ |
| 5101 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5102 | 0 \ |
| 5103 | -s "Read from client: 1 bytes read" |
| 5104 | |
| 5105 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5106 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5107 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5108 | "$P_CLI dtls=1 request_size=1 \ |
| 5109 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5110 | 0 \ |
| 5111 | -s "Read from client: 1 bytes read" |
| 5112 | |
| 5113 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5114 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5115 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5116 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5117 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5119 | 0 \ |
| 5120 | -s "Read from client: 1 bytes read" |
| 5121 | |
| 5122 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5123 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5124 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5125 | "$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] | 5126 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5127 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5128 | 0 \ |
| 5129 | -s "Read from client: 1 bytes read" |
| 5130 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5131 | # Tests for small server packets |
| 5132 | |
| 5133 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5134 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5135 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5136 | "$P_CLI force_version=ssl3 \ |
| 5137 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5138 | 0 \ |
| 5139 | -c "Read from server: 1 bytes read" |
| 5140 | |
| 5141 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5142 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5143 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5144 | "$P_CLI force_version=ssl3 \ |
| 5145 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5146 | 0 \ |
| 5147 | -c "Read from server: 1 bytes read" |
| 5148 | |
| 5149 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5150 | "$P_SRV response_size=1" \ |
| 5151 | "$P_CLI force_version=tls1 \ |
| 5152 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5153 | 0 \ |
| 5154 | -c "Read from server: 1 bytes read" |
| 5155 | |
| 5156 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5157 | "$P_SRV response_size=1" \ |
| 5158 | "$P_CLI force_version=tls1 etm=0 \ |
| 5159 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5160 | 0 \ |
| 5161 | -c "Read from server: 1 bytes read" |
| 5162 | |
| 5163 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5164 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5165 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5166 | "$P_CLI force_version=tls1 \ |
| 5167 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5168 | 0 \ |
| 5169 | -c "Read from server: 1 bytes read" |
| 5170 | |
| 5171 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5172 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5173 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5174 | "$P_CLI force_version=tls1 \ |
| 5175 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5176 | 0 \ |
| 5177 | -c "Read from server: 1 bytes read" |
| 5178 | |
| 5179 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5180 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5181 | "$P_CLI force_version=tls1 \ |
| 5182 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5183 | 0 \ |
| 5184 | -c "Read from server: 1 bytes read" |
| 5185 | |
| 5186 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5187 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5188 | "$P_CLI force_version=tls1 \ |
| 5189 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5190 | 0 \ |
| 5191 | -c "Read from server: 1 bytes read" |
| 5192 | |
| 5193 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5194 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5195 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5196 | "$P_CLI force_version=tls1 \ |
| 5197 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5198 | 0 \ |
| 5199 | -c "Read from server: 1 bytes read" |
| 5200 | |
| 5201 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5202 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5203 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5204 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5205 | trunc_hmac=1 etm=0" \ |
| 5206 | 0 \ |
| 5207 | -c "Read from server: 1 bytes read" |
| 5208 | |
| 5209 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5210 | "$P_SRV response_size=1" \ |
| 5211 | "$P_CLI force_version=tls1_1 \ |
| 5212 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5213 | 0 \ |
| 5214 | -c "Read from server: 1 bytes read" |
| 5215 | |
| 5216 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5217 | "$P_SRV response_size=1" \ |
| 5218 | "$P_CLI force_version=tls1_1 \ |
| 5219 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5220 | 0 \ |
| 5221 | -c "Read from server: 1 bytes read" |
| 5222 | |
| 5223 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5224 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5225 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5226 | "$P_CLI force_version=tls1_1 \ |
| 5227 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5228 | 0 \ |
| 5229 | -c "Read from server: 1 bytes read" |
| 5230 | |
| 5231 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5232 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5233 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5234 | "$P_CLI force_version=tls1_1 \ |
| 5235 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5236 | 0 \ |
| 5237 | -c "Read from server: 1 bytes read" |
| 5238 | |
| 5239 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5240 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5241 | "$P_CLI force_version=tls1_1 \ |
| 5242 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5243 | 0 \ |
| 5244 | -c "Read from server: 1 bytes read" |
| 5245 | |
| 5246 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5247 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5248 | "$P_CLI force_version=tls1_1 \ |
| 5249 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5250 | 0 \ |
| 5251 | -c "Read from server: 1 bytes read" |
| 5252 | |
| 5253 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5254 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5255 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5256 | "$P_CLI force_version=tls1_1 \ |
| 5257 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5258 | 0 \ |
| 5259 | -c "Read from server: 1 bytes read" |
| 5260 | |
| 5261 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5262 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5263 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5264 | "$P_CLI force_version=tls1_1 \ |
| 5265 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5266 | 0 \ |
| 5267 | -c "Read from server: 1 bytes read" |
| 5268 | |
| 5269 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5270 | "$P_SRV response_size=1" \ |
| 5271 | "$P_CLI force_version=tls1_2 \ |
| 5272 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5273 | 0 \ |
| 5274 | -c "Read from server: 1 bytes read" |
| 5275 | |
| 5276 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5277 | "$P_SRV response_size=1" \ |
| 5278 | "$P_CLI force_version=tls1_2 \ |
| 5279 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5280 | 0 \ |
| 5281 | -c "Read from server: 1 bytes read" |
| 5282 | |
| 5283 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5284 | "$P_SRV response_size=1" \ |
| 5285 | "$P_CLI force_version=tls1_2 \ |
| 5286 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5287 | 0 \ |
| 5288 | -c "Read from server: 1 bytes read" |
| 5289 | |
| 5290 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5291 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5292 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5293 | "$P_CLI force_version=tls1_2 \ |
| 5294 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5295 | 0 \ |
| 5296 | -c "Read from server: 1 bytes read" |
| 5297 | |
| 5298 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5299 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5300 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5301 | "$P_CLI force_version=tls1_2 \ |
| 5302 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5303 | 0 \ |
| 5304 | -c "Read from server: 1 bytes read" |
| 5305 | |
| 5306 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5307 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5308 | "$P_CLI force_version=tls1_2 \ |
| 5309 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5310 | 0 \ |
| 5311 | -c "Read from server: 1 bytes read" |
| 5312 | |
| 5313 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5314 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5315 | "$P_CLI force_version=tls1_2 \ |
| 5316 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5317 | 0 \ |
| 5318 | -c "Read from server: 1 bytes read" |
| 5319 | |
| 5320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5321 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5322 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5323 | "$P_CLI force_version=tls1_2 \ |
| 5324 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5325 | 0 \ |
| 5326 | -c "Read from server: 1 bytes read" |
| 5327 | |
| 5328 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5329 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5330 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5331 | "$P_CLI force_version=tls1_2 \ |
| 5332 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5333 | 0 \ |
| 5334 | -c "Read from server: 1 bytes read" |
| 5335 | |
| 5336 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5337 | "$P_SRV response_size=1" \ |
| 5338 | "$P_CLI force_version=tls1_2 \ |
| 5339 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5340 | 0 \ |
| 5341 | -c "Read from server: 1 bytes read" |
| 5342 | |
| 5343 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5344 | "$P_SRV response_size=1" \ |
| 5345 | "$P_CLI force_version=tls1_2 \ |
| 5346 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5347 | 0 \ |
| 5348 | -c "Read from server: 1 bytes read" |
| 5349 | |
| 5350 | # Tests for small server packets in DTLS |
| 5351 | |
| 5352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5353 | run_test "Small server packet DTLS 1.0" \ |
| 5354 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5355 | "$P_CLI dtls=1 \ |
| 5356 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5357 | 0 \ |
| 5358 | -c "Read from server: 1 bytes read" |
| 5359 | |
| 5360 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5361 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 5362 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 5363 | "$P_CLI dtls=1 \ |
| 5364 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5365 | 0 \ |
| 5366 | -c "Read from server: 1 bytes read" |
| 5367 | |
| 5368 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5369 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5370 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 5371 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 5372 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 5373 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5374 | 0 \ |
| 5375 | -c "Read from server: 1 bytes read" |
| 5376 | |
| 5377 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5378 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5379 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 5380 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 5381 | "$P_CLI dtls=1 \ |
| 5382 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5383 | 0 \ |
| 5384 | -c "Read from server: 1 bytes read" |
| 5385 | |
| 5386 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5387 | run_test "Small server packet DTLS 1.2" \ |
| 5388 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5389 | "$P_CLI dtls=1 \ |
| 5390 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5391 | 0 \ |
| 5392 | -c "Read from server: 1 bytes read" |
| 5393 | |
| 5394 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5395 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5396 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5397 | "$P_CLI dtls=1 \ |
| 5398 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5399 | 0 \ |
| 5400 | -c "Read from server: 1 bytes read" |
| 5401 | |
| 5402 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5403 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5404 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 5405 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 5406 | "$P_CLI dtls=1 \ |
| 5407 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5408 | 0 \ |
| 5409 | -c "Read from server: 1 bytes read" |
| 5410 | |
| 5411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5412 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5413 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 5414 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 5415 | "$P_CLI dtls=1 \ |
| 5416 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5417 | 0 \ |
| 5418 | -c "Read from server: 1 bytes read" |
| 5419 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 5420 | # A test for extensions in SSLv3 |
| 5421 | |
| 5422 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5423 | run_test "SSLv3 with extensions, server side" \ |
| 5424 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 5425 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 5426 | 0 \ |
| 5427 | -S "dumping 'client hello extensions'" \ |
| 5428 | -S "server hello, total extension length:" |
| 5429 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5430 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5431 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5432 | # How many fragments do we expect to write $1 bytes? |
| 5433 | fragments_for_write() { |
| 5434 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5435 | } |
| 5436 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5437 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5438 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5439 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5440 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5441 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5442 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5443 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5444 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5445 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5446 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5447 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5448 | "$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] | 5449 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 5450 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5451 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5452 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5453 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5454 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5455 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5456 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5457 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5458 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5459 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5460 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5461 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5462 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5463 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5464 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5465 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 5466 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5467 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5468 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5469 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5470 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5471 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5472 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5473 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5474 | 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] | 5475 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5476 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5477 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5478 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5479 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5480 | run_test "Large client packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5481 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5482 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5483 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5484 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5485 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5486 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5487 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5488 | "$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] | 5489 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5490 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5491 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5492 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5493 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5494 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5495 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5496 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5497 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5498 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5499 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5500 | |
| 5501 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5502 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5503 | "$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] | 5504 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5505 | 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] | 5506 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5507 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5508 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5509 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5510 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5511 | "$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] | 5512 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5513 | 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] | 5514 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5515 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5516 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5517 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5518 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5519 | "$P_SRV" \ |
| 5520 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5521 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5522 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5523 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5524 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5525 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5526 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5527 | "$P_SRV" \ |
| 5528 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 5529 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5530 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5531 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5532 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5533 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5534 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5535 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5536 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5537 | 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] | 5538 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5539 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5540 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5541 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5542 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5543 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5544 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5545 | 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] | 5546 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5547 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5548 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5549 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5550 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5551 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5552 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5553 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5554 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5555 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5556 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5557 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5558 | "$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] | 5559 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5560 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5561 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5562 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5563 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5564 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5565 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5566 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5567 | "$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] | 5568 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5569 | 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] | 5570 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5571 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5572 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5573 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5574 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5575 | "$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] | 5576 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5577 | 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] | 5578 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5579 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5580 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5581 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5582 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5583 | "$P_SRV" \ |
| 5584 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5585 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5586 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5587 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5588 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5589 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5590 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5591 | "$P_SRV" \ |
| 5592 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5593 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5594 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5595 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5596 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5597 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5598 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5599 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5600 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5601 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5602 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5603 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5604 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5605 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5606 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5607 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5608 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5609 | 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] | 5610 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5611 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5612 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5613 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5614 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5615 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5616 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5617 | 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] | 5618 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5619 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5620 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5621 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5622 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5623 | "$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] | 5624 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5625 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5626 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5627 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5628 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5629 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5630 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5631 | "$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] | 5632 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5633 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5634 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5635 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5636 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5637 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5638 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5639 | "$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] | 5640 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5641 | 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] | 5642 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5643 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5644 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5645 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5646 | run_test "Large client packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5647 | "$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] | 5648 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5649 | 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] | 5650 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5651 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5652 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5653 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5654 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5655 | "$P_SRV" \ |
| 5656 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5657 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5658 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5659 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5660 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5661 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5662 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5663 | "$P_SRV" \ |
| 5664 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5665 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5666 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5667 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5668 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5669 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5670 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5671 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5672 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5673 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5674 | "$P_CLI force_version=ssl3 \ |
| 5675 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5676 | 0 \ |
| 5677 | -c "Read from server: 16384 bytes read" |
| 5678 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5679 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5680 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5681 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5682 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5683 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5684 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5685 | 0 \ |
| 5686 | -c "Read from server: 1 bytes read"\ |
| 5687 | -c "16383 bytes read"\ |
| 5688 | -C "Read from server: 16384 bytes read" |
| 5689 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5690 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5691 | "$P_SRV response_size=16384" \ |
| 5692 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5693 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5694 | 0 \ |
| 5695 | -c "Read from server: 1 bytes read"\ |
| 5696 | -c "16383 bytes read"\ |
| 5697 | -C "Read from server: 16384 bytes read" |
| 5698 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5699 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5700 | "$P_SRV response_size=16384" \ |
| 5701 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5702 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5703 | 0 \ |
| 5704 | -c "Read from server: 1 bytes read"\ |
| 5705 | -c "16383 bytes read"\ |
| 5706 | -C "Read from server: 16384 bytes read" |
| 5707 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5708 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5709 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5710 | "$P_SRV response_size=16384" \ |
| 5711 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5712 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5713 | trunc_hmac=1" \ |
| 5714 | 0 \ |
| 5715 | -c "Read from server: 1 bytes read"\ |
| 5716 | -c "16383 bytes read"\ |
| 5717 | -C "Read from server: 16384 bytes read" |
| 5718 | |
| 5719 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5720 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5721 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5722 | "$P_CLI force_version=tls1 \ |
| 5723 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5724 | trunc_hmac=1" \ |
| 5725 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5726 | -s "16384 bytes written in 1 fragments" \ |
| 5727 | -c "Read from server: 16384 bytes read" |
| 5728 | |
| 5729 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5730 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5731 | "$P_CLI force_version=tls1 \ |
| 5732 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5733 | 0 \ |
| 5734 | -s "16384 bytes written in 1 fragments" \ |
| 5735 | -c "Read from server: 16384 bytes read" |
| 5736 | |
| 5737 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5738 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5739 | "$P_CLI force_version=tls1 \ |
| 5740 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5741 | 0 \ |
| 5742 | -s "16384 bytes written in 1 fragments" \ |
| 5743 | -c "Read from server: 16384 bytes read" |
| 5744 | |
| 5745 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5746 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5747 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5748 | "$P_CLI force_version=tls1 \ |
| 5749 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5750 | 0 \ |
| 5751 | -s "16384 bytes written in 1 fragments" \ |
| 5752 | -c "Read from server: 16384 bytes read" |
| 5753 | |
| 5754 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5755 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5756 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5757 | "$P_CLI force_version=tls1 \ |
| 5758 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5759 | 0 \ |
| 5760 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5761 | -c "Read from server: 16384 bytes read" |
| 5762 | |
| 5763 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5764 | "$P_SRV response_size=16384" \ |
| 5765 | "$P_CLI force_version=tls1_1 \ |
| 5766 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5767 | 0 \ |
| 5768 | -c "Read from server: 16384 bytes read" |
| 5769 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5770 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5771 | "$P_SRV response_size=16384" \ |
| 5772 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5773 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5774 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5775 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5776 | -c "Read from server: 16384 bytes read" |
| 5777 | |
| 5778 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5779 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5780 | "$P_SRV response_size=16384" \ |
| 5781 | "$P_CLI force_version=tls1_1 \ |
| 5782 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5783 | trunc_hmac=1" \ |
| 5784 | 0 \ |
| 5785 | -c "Read from server: 16384 bytes read" |
| 5786 | |
| 5787 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5788 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5789 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5790 | "$P_CLI force_version=tls1_1 \ |
| 5791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5792 | 0 \ |
| 5793 | -s "16384 bytes written in 1 fragments" \ |
| 5794 | -c "Read from server: 16384 bytes read" |
| 5795 | |
| 5796 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5797 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5798 | "$P_CLI force_version=tls1_1 \ |
| 5799 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5800 | 0 \ |
| 5801 | -c "Read from server: 16384 bytes read" |
| 5802 | |
| 5803 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5804 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5805 | "$P_CLI force_version=tls1_1 \ |
| 5806 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5807 | 0 \ |
| 5808 | -s "16384 bytes written in 1 fragments" \ |
| 5809 | -c "Read from server: 16384 bytes read" |
| 5810 | |
| 5811 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5812 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5813 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5814 | "$P_CLI force_version=tls1_1 \ |
| 5815 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5816 | trunc_hmac=1" \ |
| 5817 | 0 \ |
| 5818 | -c "Read from server: 16384 bytes read" |
| 5819 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5820 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5821 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5822 | "$P_CLI force_version=tls1_1 \ |
| 5823 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5824 | 0 \ |
| 5825 | -s "16384 bytes written in 1 fragments" \ |
| 5826 | -c "Read from server: 16384 bytes read" |
| 5827 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5828 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5829 | "$P_SRV response_size=16384" \ |
| 5830 | "$P_CLI force_version=tls1_2 \ |
| 5831 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5832 | 0 \ |
| 5833 | -c "Read from server: 16384 bytes read" |
| 5834 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5835 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5836 | "$P_SRV response_size=16384" \ |
| 5837 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5838 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5839 | 0 \ |
| 5840 | -s "16384 bytes written in 1 fragments" \ |
| 5841 | -c "Read from server: 16384 bytes read" |
| 5842 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5843 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5844 | "$P_SRV response_size=16384" \ |
| 5845 | "$P_CLI force_version=tls1_2 \ |
| 5846 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5847 | 0 \ |
| 5848 | -c "Read from server: 16384 bytes read" |
| 5849 | |
| 5850 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5851 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5852 | "$P_SRV response_size=16384" \ |
| 5853 | "$P_CLI force_version=tls1_2 \ |
| 5854 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5855 | trunc_hmac=1" \ |
| 5856 | 0 \ |
| 5857 | -c "Read from server: 16384 bytes read" |
| 5858 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5859 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5860 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5861 | "$P_CLI force_version=tls1_2 \ |
| 5862 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5863 | 0 \ |
| 5864 | -s "16384 bytes written in 1 fragments" \ |
| 5865 | -c "Read from server: 16384 bytes read" |
| 5866 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5867 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5868 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5869 | "$P_CLI force_version=tls1_2 \ |
| 5870 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5871 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5872 | -s "16384 bytes written in 1 fragments" \ |
| 5873 | -c "Read from server: 16384 bytes read" |
| 5874 | |
| 5875 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5876 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5877 | "$P_CLI force_version=tls1_2 \ |
| 5878 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5879 | 0 \ |
| 5880 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5881 | -c "Read from server: 16384 bytes read" |
| 5882 | |
| 5883 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5884 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5885 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5886 | "$P_CLI force_version=tls1_2 \ |
| 5887 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5888 | trunc_hmac=1" \ |
| 5889 | 0 \ |
| 5890 | -c "Read from server: 16384 bytes read" |
| 5891 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5892 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5893 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5894 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5895 | "$P_CLI force_version=tls1_2 \ |
| 5896 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5897 | 0 \ |
| 5898 | -s "16384 bytes written in 1 fragments" \ |
| 5899 | -c "Read from server: 16384 bytes read" |
| 5900 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5901 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5902 | "$P_SRV response_size=16384" \ |
| 5903 | "$P_CLI force_version=tls1_2 \ |
| 5904 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5905 | 0 \ |
| 5906 | -c "Read from server: 16384 bytes read" |
| 5907 | |
| 5908 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5909 | "$P_SRV response_size=16384" \ |
| 5910 | "$P_CLI force_version=tls1_2 \ |
| 5911 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5912 | 0 \ |
| 5913 | -c "Read from server: 16384 bytes read" |
| 5914 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5915 | # Tests for restartable ECC |
| 5916 | |
| 5917 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5918 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5919 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5920 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5921 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5922 | debug_level=1" \ |
| 5923 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5924 | -C "x509_verify_cert.*4b00" \ |
| 5925 | -C "mbedtls_pk_verify.*4b00" \ |
| 5926 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5927 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5928 | |
| 5929 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5930 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5931 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5932 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5933 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5934 | debug_level=1 ec_max_ops=0" \ |
| 5935 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5936 | -C "x509_verify_cert.*4b00" \ |
| 5937 | -C "mbedtls_pk_verify.*4b00" \ |
| 5938 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5939 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5940 | |
| 5941 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5942 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5943 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5944 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5945 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5946 | debug_level=1 ec_max_ops=65535" \ |
| 5947 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5948 | -C "x509_verify_cert.*4b00" \ |
| 5949 | -C "mbedtls_pk_verify.*4b00" \ |
| 5950 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5951 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5952 | |
| 5953 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5954 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5955 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5956 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5957 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5958 | debug_level=1 ec_max_ops=1000" \ |
| 5959 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5960 | -c "x509_verify_cert.*4b00" \ |
| 5961 | -c "mbedtls_pk_verify.*4b00" \ |
| 5962 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5963 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5964 | |
| 5965 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5966 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5967 | "$P_SRV auth_mode=required \ |
| 5968 | crt_file=data_files/server5-badsign.crt \ |
| 5969 | key_file=data_files/server5.key" \ |
| 5970 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5971 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5972 | debug_level=1 ec_max_ops=1000" \ |
| 5973 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5974 | -c "x509_verify_cert.*4b00" \ |
| 5975 | -C "mbedtls_pk_verify.*4b00" \ |
| 5976 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5977 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5978 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5979 | -c "! mbedtls_ssl_handshake returned" \ |
| 5980 | -c "X509 - Certificate verification failed" |
| 5981 | |
| 5982 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5983 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5984 | "$P_SRV auth_mode=required \ |
| 5985 | crt_file=data_files/server5-badsign.crt \ |
| 5986 | key_file=data_files/server5.key" \ |
| 5987 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5988 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5989 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5990 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5991 | -c "x509_verify_cert.*4b00" \ |
| 5992 | -c "mbedtls_pk_verify.*4b00" \ |
| 5993 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5994 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5995 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5996 | -C "! mbedtls_ssl_handshake returned" \ |
| 5997 | -C "X509 - Certificate verification failed" |
| 5998 | |
| 5999 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6000 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6001 | "$P_SRV auth_mode=required \ |
| 6002 | crt_file=data_files/server5-badsign.crt \ |
| 6003 | key_file=data_files/server5.key" \ |
| 6004 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6005 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6006 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6007 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6008 | -C "x509_verify_cert.*4b00" \ |
| 6009 | -c "mbedtls_pk_verify.*4b00" \ |
| 6010 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6011 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6012 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6013 | -C "! mbedtls_ssl_handshake returned" \ |
| 6014 | -C "X509 - Certificate verification failed" |
| 6015 | |
| 6016 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6017 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6018 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6019 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6020 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6021 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6022 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6023 | -c "x509_verify_cert.*4b00" \ |
| 6024 | -c "mbedtls_pk_verify.*4b00" \ |
| 6025 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6026 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6027 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6028 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6029 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6030 | "$P_SRV" \ |
| 6031 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6032 | debug_level=1 ec_max_ops=1000" \ |
| 6033 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6034 | -c "x509_verify_cert.*4b00" \ |
| 6035 | -c "mbedtls_pk_verify.*4b00" \ |
| 6036 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6037 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6038 | |
| 6039 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6040 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6041 | "$P_SRV psk=abc123" \ |
| 6042 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6043 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6044 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6045 | -C "x509_verify_cert.*4b00" \ |
| 6046 | -C "mbedtls_pk_verify.*4b00" \ |
| 6047 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6048 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6049 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6050 | # Tests of asynchronous private key support in SSL |
| 6051 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6052 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6053 | run_test "SSL async private: sign, delay=0" \ |
| 6054 | "$P_SRV \ |
| 6055 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6056 | "$P_CLI" \ |
| 6057 | 0 \ |
| 6058 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6059 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6060 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6061 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6062 | run_test "SSL async private: sign, delay=1" \ |
| 6063 | "$P_SRV \ |
| 6064 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6065 | "$P_CLI" \ |
| 6066 | 0 \ |
| 6067 | -s "Async sign callback: using key slot " \ |
| 6068 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6069 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6070 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6071 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6072 | run_test "SSL async private: sign, delay=2" \ |
| 6073 | "$P_SRV \ |
| 6074 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6075 | "$P_CLI" \ |
| 6076 | 0 \ |
| 6077 | -s "Async sign callback: using key slot " \ |
| 6078 | -U "Async sign callback: using key slot " \ |
| 6079 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6080 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6081 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6082 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6083 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6084 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6085 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6087 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6088 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6089 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6090 | "$P_CLI force_version=tls1_1" \ |
| 6091 | 0 \ |
| 6092 | -s "Async sign callback: using key slot " \ |
| 6093 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6094 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6095 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6096 | run_test "SSL async private: sign, SNI" \ |
| 6097 | "$P_SRV debug_level=3 \ |
| 6098 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6099 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6100 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6101 | "$P_CLI server_name=polarssl.example" \ |
| 6102 | 0 \ |
| 6103 | -s "Async sign callback: using key slot " \ |
| 6104 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6105 | -s "parse ServerName extension" \ |
| 6106 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6107 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6108 | |
| 6109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6110 | run_test "SSL async private: decrypt, delay=0" \ |
| 6111 | "$P_SRV \ |
| 6112 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6113 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6114 | 0 \ |
| 6115 | -s "Async decrypt callback: using key slot " \ |
| 6116 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6117 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6118 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6119 | run_test "SSL async private: decrypt, delay=1" \ |
| 6120 | "$P_SRV \ |
| 6121 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6122 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6123 | 0 \ |
| 6124 | -s "Async decrypt callback: using key slot " \ |
| 6125 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6126 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6127 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6128 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6129 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6130 | "$P_SRV psk=abc123 \ |
| 6131 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6132 | "$P_CLI psk=abc123 \ |
| 6133 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6134 | 0 \ |
| 6135 | -s "Async decrypt callback: using key slot " \ |
| 6136 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6137 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6138 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6139 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6140 | "$P_SRV psk=abc123 \ |
| 6141 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6142 | "$P_CLI psk=abc123 \ |
| 6143 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6144 | 0 \ |
| 6145 | -s "Async decrypt callback: using key slot " \ |
| 6146 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6147 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6148 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6149 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6150 | run_test "SSL async private: sign callback not present" \ |
| 6151 | "$P_SRV \ |
| 6152 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6153 | "$P_CLI; [ \$? -eq 1 ] && |
| 6154 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6155 | 0 \ |
| 6156 | -S "Async sign callback" \ |
| 6157 | -s "! mbedtls_ssl_handshake returned" \ |
| 6158 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6159 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6160 | -s "Successful connection" |
| 6161 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6163 | run_test "SSL async private: decrypt callback not present" \ |
| 6164 | "$P_SRV debug_level=1 \ |
| 6165 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6166 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6167 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6168 | 0 \ |
| 6169 | -S "Async decrypt callback" \ |
| 6170 | -s "! mbedtls_ssl_handshake returned" \ |
| 6171 | -s "got no RSA private key" \ |
| 6172 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6173 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6174 | |
| 6175 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6176 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6177 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6178 | "$P_SRV \ |
| 6179 | async_operations=s async_private_delay1=1 \ |
| 6180 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6181 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6182 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6183 | 0 \ |
| 6184 | -s "Async sign callback: using key slot 0," \ |
| 6185 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6186 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6187 | |
| 6188 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6189 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6190 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6191 | "$P_SRV \ |
| 6192 | async_operations=s async_private_delay2=1 \ |
| 6193 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6194 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6195 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6196 | 0 \ |
| 6197 | -s "Async sign callback: using key slot 0," \ |
| 6198 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6199 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6200 | |
| 6201 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6203 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6204 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6205 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6206 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6207 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6208 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6209 | 0 \ |
| 6210 | -s "Async sign callback: using key slot 1," \ |
| 6211 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6212 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6213 | |
| 6214 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6215 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6216 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6217 | "$P_SRV \ |
| 6218 | async_operations=s async_private_delay1=1 \ |
| 6219 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6220 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6221 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6222 | 0 \ |
| 6223 | -s "Async sign callback: no key matches this certificate." |
| 6224 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6225 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6226 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6227 | "$P_SRV \ |
| 6228 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6229 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6230 | "$P_CLI" \ |
| 6231 | 1 \ |
| 6232 | -s "Async sign callback: injected error" \ |
| 6233 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6234 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6235 | -s "! mbedtls_ssl_handshake returned" |
| 6236 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6237 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6238 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6239 | "$P_SRV \ |
| 6240 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6241 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6242 | "$P_CLI" \ |
| 6243 | 1 \ |
| 6244 | -s "Async sign callback: using key slot " \ |
| 6245 | -S "Async resume" \ |
| 6246 | -s "Async cancel" |
| 6247 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6248 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6249 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6250 | "$P_SRV \ |
| 6251 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6252 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6253 | "$P_CLI" \ |
| 6254 | 1 \ |
| 6255 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6256 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6257 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6258 | -s "! mbedtls_ssl_handshake returned" |
| 6259 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6261 | run_test "SSL async private: decrypt, error in start" \ |
| 6262 | "$P_SRV \ |
| 6263 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6264 | async_private_error=1" \ |
| 6265 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6266 | 1 \ |
| 6267 | -s "Async decrypt callback: injected error" \ |
| 6268 | -S "Async resume" \ |
| 6269 | -S "Async cancel" \ |
| 6270 | -s "! mbedtls_ssl_handshake returned" |
| 6271 | |
| 6272 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6273 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6274 | "$P_SRV \ |
| 6275 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6276 | async_private_error=2" \ |
| 6277 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6278 | 1 \ |
| 6279 | -s "Async decrypt callback: using key slot " \ |
| 6280 | -S "Async resume" \ |
| 6281 | -s "Async cancel" |
| 6282 | |
| 6283 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6284 | run_test "SSL async private: decrypt, error in resume" \ |
| 6285 | "$P_SRV \ |
| 6286 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6287 | async_private_error=3" \ |
| 6288 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6289 | 1 \ |
| 6290 | -s "Async decrypt callback: using key slot " \ |
| 6291 | -s "Async resume callback: decrypt done but injected error" \ |
| 6292 | -S "Async cancel" \ |
| 6293 | -s "! mbedtls_ssl_handshake returned" |
| 6294 | |
| 6295 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6296 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6297 | "$P_SRV \ |
| 6298 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6299 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6300 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6301 | 0 \ |
| 6302 | -s "Async cancel" \ |
| 6303 | -s "! mbedtls_ssl_handshake returned" \ |
| 6304 | -s "Async resume" \ |
| 6305 | -s "Successful connection" |
| 6306 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6307 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6308 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6309 | "$P_SRV \ |
| 6310 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6311 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6312 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6313 | 0 \ |
| 6314 | -s "! mbedtls_ssl_handshake returned" \ |
| 6315 | -s "Async resume" \ |
| 6316 | -s "Successful connection" |
| 6317 | |
| 6318 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6319 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6320 | 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] | 6321 | "$P_SRV \ |
| 6322 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6323 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6324 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6325 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6326 | [ \$? -eq 1 ] && |
| 6327 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6328 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6329 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6330 | -S "Async resume" \ |
| 6331 | -s "Async cancel" \ |
| 6332 | -s "! mbedtls_ssl_handshake returned" \ |
| 6333 | -s "Async sign callback: no key matches this certificate." \ |
| 6334 | -s "Successful connection" |
| 6335 | |
| 6336 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6337 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6338 | 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] | 6339 | "$P_SRV \ |
| 6340 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6341 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6342 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6343 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6344 | [ \$? -eq 1 ] && |
| 6345 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6346 | 0 \ |
| 6347 | -s "Async resume" \ |
| 6348 | -s "! mbedtls_ssl_handshake returned" \ |
| 6349 | -s "Async sign callback: no key matches this certificate." \ |
| 6350 | -s "Successful connection" |
| 6351 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6352 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6354 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6355 | "$P_SRV \ |
| 6356 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6357 | exchanges=2 renegotiation=1" \ |
| 6358 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6359 | 0 \ |
| 6360 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6361 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6362 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6365 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 6366 | "$P_SRV \ |
| 6367 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6368 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6369 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6370 | 0 \ |
| 6371 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6372 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6373 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6374 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6376 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 6377 | "$P_SRV \ |
| 6378 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6379 | exchanges=2 renegotiation=1" \ |
| 6380 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6381 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6382 | 0 \ |
| 6383 | -s "Async decrypt callback: using key slot " \ |
| 6384 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6385 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6388 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 6389 | "$P_SRV \ |
| 6390 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6391 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6392 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6393 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6394 | 0 \ |
| 6395 | -s "Async decrypt callback: using key slot " \ |
| 6396 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6397 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6398 | # Tests for ECC extensions (rfc 4492) |
| 6399 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6400 | requires_config_enabled MBEDTLS_AES_C |
| 6401 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6402 | requires_config_enabled MBEDTLS_SHA256_C |
| 6403 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6404 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6405 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6406 | "$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] | 6407 | 0 \ |
| 6408 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6409 | -C "client hello, adding supported_point_formats extension" \ |
| 6410 | -S "found supported elliptic curves extension" \ |
| 6411 | -S "found supported point formats extension" |
| 6412 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_AES_C |
| 6414 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6415 | requires_config_enabled MBEDTLS_SHA256_C |
| 6416 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6417 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6418 | "$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] | 6419 | "$P_CLI debug_level=3" \ |
| 6420 | 0 \ |
| 6421 | -C "found supported_point_formats extension" \ |
| 6422 | -S "server hello, supported_point_formats extension" |
| 6423 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_AES_C |
| 6425 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6426 | requires_config_enabled MBEDTLS_SHA256_C |
| 6427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6428 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6429 | "$P_SRV debug_level=3" \ |
| 6430 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6431 | 0 \ |
| 6432 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6433 | -c "client hello, adding supported_point_formats extension" \ |
| 6434 | -s "found supported elliptic curves extension" \ |
| 6435 | -s "found supported point formats extension" |
| 6436 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_AES_C |
| 6438 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6439 | requires_config_enabled MBEDTLS_SHA256_C |
| 6440 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6441 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6442 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6443 | "$P_CLI debug_level=3" \ |
| 6444 | 0 \ |
| 6445 | -c "found supported_point_formats extension" \ |
| 6446 | -s "server hello, supported_point_formats extension" |
| 6447 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6448 | # Tests for DTLS HelloVerifyRequest |
| 6449 | |
| 6450 | run_test "DTLS cookie: enabled" \ |
| 6451 | "$P_SRV dtls=1 debug_level=2" \ |
| 6452 | "$P_CLI dtls=1 debug_level=2" \ |
| 6453 | 0 \ |
| 6454 | -s "cookie verification failed" \ |
| 6455 | -s "cookie verification passed" \ |
| 6456 | -S "cookie verification skipped" \ |
| 6457 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6458 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6459 | -S "SSL - The requested feature is not available" |
| 6460 | |
| 6461 | run_test "DTLS cookie: disabled" \ |
| 6462 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6463 | "$P_CLI dtls=1 debug_level=2" \ |
| 6464 | 0 \ |
| 6465 | -S "cookie verification failed" \ |
| 6466 | -S "cookie verification passed" \ |
| 6467 | -s "cookie verification skipped" \ |
| 6468 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6469 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6470 | -S "SSL - The requested feature is not available" |
| 6471 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6472 | run_test "DTLS cookie: default (failing)" \ |
| 6473 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6474 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6475 | 1 \ |
| 6476 | -s "cookie verification failed" \ |
| 6477 | -S "cookie verification passed" \ |
| 6478 | -S "cookie verification skipped" \ |
| 6479 | -C "received hello verify request" \ |
| 6480 | -S "hello verification requested" \ |
| 6481 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6482 | |
| 6483 | requires_ipv6 |
| 6484 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6485 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6486 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6487 | 0 \ |
| 6488 | -s "cookie verification failed" \ |
| 6489 | -s "cookie verification passed" \ |
| 6490 | -S "cookie verification skipped" \ |
| 6491 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6492 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6493 | -S "SSL - The requested feature is not available" |
| 6494 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6495 | run_test "DTLS cookie: enabled, nbio" \ |
| 6496 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6497 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6498 | 0 \ |
| 6499 | -s "cookie verification failed" \ |
| 6500 | -s "cookie verification passed" \ |
| 6501 | -S "cookie verification skipped" \ |
| 6502 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6503 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6504 | -S "SSL - The requested feature is not available" |
| 6505 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6506 | # Tests for client reconnecting from the same port with DTLS |
| 6507 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6508 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6509 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6510 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6511 | "$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] | 6512 | 0 \ |
| 6513 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6514 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6515 | -S "Client initiated reconnection from same port" |
| 6516 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6517 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6518 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6519 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6520 | "$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] | 6521 | 0 \ |
| 6522 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6523 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6524 | -s "Client initiated reconnection from same port" |
| 6525 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6526 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6527 | 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] | 6528 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6529 | "$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] | 6530 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6531 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6532 | -s "Client initiated reconnection from same port" |
| 6533 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6534 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6535 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6536 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6537 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6538 | 0 \ |
| 6539 | -S "The operation timed out" \ |
| 6540 | -s "Client initiated reconnection from same port" |
| 6541 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6542 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6543 | "$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] | 6544 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6545 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6546 | -s "The operation timed out" \ |
| 6547 | -S "Client initiated reconnection from same port" |
| 6548 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6549 | # Tests for various cases of client authentication with DTLS |
| 6550 | # (focused on handshake flows and message parsing) |
| 6551 | |
| 6552 | run_test "DTLS client auth: required" \ |
| 6553 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6554 | "$P_CLI dtls=1" \ |
| 6555 | 0 \ |
| 6556 | -s "Verifying peer X.509 certificate... ok" |
| 6557 | |
| 6558 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6559 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6560 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6561 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6562 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6563 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6564 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6565 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6566 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6567 | 0 \ |
| 6568 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6569 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6570 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6571 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6572 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6573 | "$P_CLI dtls=1 psk=abc124" \ |
| 6574 | 1 \ |
| 6575 | -s "SSL - Verification of the message MAC failed" \ |
| 6576 | -c "SSL - A fatal alert message was received from our peer" |
| 6577 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6578 | # Tests for receiving fragmented handshake messages with DTLS |
| 6579 | |
| 6580 | requires_gnutls |
| 6581 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6582 | "$G_SRV -u --mtu 2048 -a" \ |
| 6583 | "$P_CLI dtls=1 debug_level=2" \ |
| 6584 | 0 \ |
| 6585 | -C "found fragmented DTLS handshake message" \ |
| 6586 | -C "error" |
| 6587 | |
| 6588 | requires_gnutls |
| 6589 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6590 | "$G_SRV -u --mtu 512" \ |
| 6591 | "$P_CLI dtls=1 debug_level=2" \ |
| 6592 | 0 \ |
| 6593 | -c "found fragmented DTLS handshake message" \ |
| 6594 | -C "error" |
| 6595 | |
| 6596 | requires_gnutls |
| 6597 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6598 | "$G_SRV -u --mtu 128" \ |
| 6599 | "$P_CLI dtls=1 debug_level=2" \ |
| 6600 | 0 \ |
| 6601 | -c "found fragmented DTLS handshake message" \ |
| 6602 | -C "error" |
| 6603 | |
| 6604 | requires_gnutls |
| 6605 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6606 | "$G_SRV -u --mtu 128" \ |
| 6607 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6608 | 0 \ |
| 6609 | -c "found fragmented DTLS handshake message" \ |
| 6610 | -C "error" |
| 6611 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6612 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6613 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6614 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6615 | "$G_SRV -u --mtu 256" \ |
| 6616 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6617 | 0 \ |
| 6618 | -c "found fragmented DTLS handshake message" \ |
| 6619 | -c "client hello, adding renegotiation extension" \ |
| 6620 | -c "found renegotiation extension" \ |
| 6621 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6622 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6623 | -C "error" \ |
| 6624 | -s "Extra-header:" |
| 6625 | |
| 6626 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6627 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6628 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6629 | "$G_SRV -u --mtu 256" \ |
| 6630 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6631 | 0 \ |
| 6632 | -c "found fragmented DTLS handshake message" \ |
| 6633 | -c "client hello, adding renegotiation extension" \ |
| 6634 | -c "found renegotiation extension" \ |
| 6635 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6636 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6637 | -C "error" \ |
| 6638 | -s "Extra-header:" |
| 6639 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6640 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6641 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6642 | "$P_CLI dtls=1 debug_level=2" \ |
| 6643 | 0 \ |
| 6644 | -C "found fragmented DTLS handshake message" \ |
| 6645 | -C "error" |
| 6646 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6647 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6648 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6649 | "$P_CLI dtls=1 debug_level=2" \ |
| 6650 | 0 \ |
| 6651 | -c "found fragmented DTLS handshake message" \ |
| 6652 | -C "error" |
| 6653 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6654 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6655 | "$O_SRV -dtls1 -mtu 256" \ |
| 6656 | "$P_CLI dtls=1 debug_level=2" \ |
| 6657 | 0 \ |
| 6658 | -c "found fragmented DTLS handshake message" \ |
| 6659 | -C "error" |
| 6660 | |
| 6661 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6662 | "$O_SRV -dtls1 -mtu 256" \ |
| 6663 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6664 | 0 \ |
| 6665 | -c "found fragmented DTLS handshake message" \ |
| 6666 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6667 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6668 | # Tests for sending fragmented handshake messages with DTLS |
| 6669 | # |
| 6670 | # Use client auth when we need the client to send large messages, |
| 6671 | # and use large cert chains on both sides too (the long chains we have all use |
| 6672 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6673 | # Sizes reached (UDP payload): |
| 6674 | # - 2037B for server certificate |
| 6675 | # - 1542B for client certificate |
| 6676 | # - 1013B for newsessionticket |
| 6677 | # - all others below 512B |
| 6678 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6679 | |
| 6680 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6681 | requires_config_enabled MBEDTLS_RSA_C |
| 6682 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6683 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6684 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6685 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6686 | crt_file=data_files/server7_int-ca.crt \ |
| 6687 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6688 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6689 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6690 | "$P_CLI dtls=1 debug_level=2 \ |
| 6691 | crt_file=data_files/server8_int-ca2.crt \ |
| 6692 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6693 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6694 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6695 | 0 \ |
| 6696 | -S "found fragmented DTLS handshake message" \ |
| 6697 | -C "found fragmented DTLS handshake message" \ |
| 6698 | -C "error" |
| 6699 | |
| 6700 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6701 | requires_config_enabled MBEDTLS_RSA_C |
| 6702 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6703 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6704 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6705 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6706 | crt_file=data_files/server7_int-ca.crt \ |
| 6707 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6708 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6709 | max_frag_len=1024" \ |
| 6710 | "$P_CLI dtls=1 debug_level=2 \ |
| 6711 | crt_file=data_files/server8_int-ca2.crt \ |
| 6712 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6713 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6714 | max_frag_len=2048" \ |
| 6715 | 0 \ |
| 6716 | -S "found fragmented DTLS handshake message" \ |
| 6717 | -c "found fragmented DTLS handshake message" \ |
| 6718 | -C "error" |
| 6719 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6720 | # With the MFL extension, the server has no way of forcing |
| 6721 | # the client to not exceed a certain MTU; hence, the following |
| 6722 | # test can't be replicated with an MTU proxy such as the one |
| 6723 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6724 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6725 | requires_config_enabled MBEDTLS_RSA_C |
| 6726 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6727 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6728 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6729 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6730 | crt_file=data_files/server7_int-ca.crt \ |
| 6731 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6732 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6733 | max_frag_len=512" \ |
| 6734 | "$P_CLI dtls=1 debug_level=2 \ |
| 6735 | crt_file=data_files/server8_int-ca2.crt \ |
| 6736 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6737 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6738 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6739 | 0 \ |
| 6740 | -S "found fragmented DTLS handshake message" \ |
| 6741 | -c "found fragmented DTLS handshake message" \ |
| 6742 | -C "error" |
| 6743 | |
| 6744 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6745 | requires_config_enabled MBEDTLS_RSA_C |
| 6746 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6747 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6748 | 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] | 6749 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6750 | crt_file=data_files/server7_int-ca.crt \ |
| 6751 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6752 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6753 | max_frag_len=2048" \ |
| 6754 | "$P_CLI dtls=1 debug_level=2 \ |
| 6755 | crt_file=data_files/server8_int-ca2.crt \ |
| 6756 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6757 | hs_timeout=2500-60000 \ |
| 6758 | max_frag_len=1024" \ |
| 6759 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6760 | -S "found fragmented DTLS handshake message" \ |
| 6761 | -c "found fragmented DTLS handshake message" \ |
| 6762 | -C "error" |
| 6763 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6764 | # While not required by the standard defining the MFL extension |
| 6765 | # (according to which it only applies to records, not to datagrams), |
| 6766 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6767 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6768 | # to the peer. |
| 6769 | # The next test checks that no datagrams significantly larger than the |
| 6770 | # negotiated MFL are sent. |
| 6771 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6772 | requires_config_enabled MBEDTLS_RSA_C |
| 6773 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6774 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6775 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6776 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6777 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6778 | crt_file=data_files/server7_int-ca.crt \ |
| 6779 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6780 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6781 | max_frag_len=2048" \ |
| 6782 | "$P_CLI dtls=1 debug_level=2 \ |
| 6783 | crt_file=data_files/server8_int-ca2.crt \ |
| 6784 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6785 | hs_timeout=2500-60000 \ |
| 6786 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6787 | 0 \ |
| 6788 | -S "found fragmented DTLS handshake message" \ |
| 6789 | -c "found fragmented DTLS handshake message" \ |
| 6790 | -C "error" |
| 6791 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6793 | requires_config_enabled MBEDTLS_RSA_C |
| 6794 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6795 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6796 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6797 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6798 | crt_file=data_files/server7_int-ca.crt \ |
| 6799 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6800 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6801 | max_frag_len=2048" \ |
| 6802 | "$P_CLI dtls=1 debug_level=2 \ |
| 6803 | crt_file=data_files/server8_int-ca2.crt \ |
| 6804 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6805 | hs_timeout=2500-60000 \ |
| 6806 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6807 | 0 \ |
| 6808 | -s "found fragmented DTLS handshake message" \ |
| 6809 | -c "found fragmented DTLS handshake message" \ |
| 6810 | -C "error" |
| 6811 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6812 | # While not required by the standard defining the MFL extension |
| 6813 | # (according to which it only applies to records, not to datagrams), |
| 6814 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6815 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6816 | # to the peer. |
| 6817 | # The next test checks that no datagrams significantly larger than the |
| 6818 | # negotiated MFL are sent. |
| 6819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6820 | requires_config_enabled MBEDTLS_RSA_C |
| 6821 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6822 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6823 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6824 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6825 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6826 | crt_file=data_files/server7_int-ca.crt \ |
| 6827 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6828 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6829 | max_frag_len=2048" \ |
| 6830 | "$P_CLI dtls=1 debug_level=2 \ |
| 6831 | crt_file=data_files/server8_int-ca2.crt \ |
| 6832 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6833 | hs_timeout=2500-60000 \ |
| 6834 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6835 | 0 \ |
| 6836 | -s "found fragmented DTLS handshake message" \ |
| 6837 | -c "found fragmented DTLS handshake message" \ |
| 6838 | -C "error" |
| 6839 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6840 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6841 | requires_config_enabled MBEDTLS_RSA_C |
| 6842 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6843 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6844 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6845 | crt_file=data_files/server7_int-ca.crt \ |
| 6846 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6847 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6848 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6849 | "$P_CLI dtls=1 debug_level=2 \ |
| 6850 | crt_file=data_files/server8_int-ca2.crt \ |
| 6851 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6852 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6853 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6854 | 0 \ |
| 6855 | -S "found fragmented DTLS handshake message" \ |
| 6856 | -C "found fragmented DTLS handshake message" \ |
| 6857 | -C "error" |
| 6858 | |
| 6859 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6860 | requires_config_enabled MBEDTLS_RSA_C |
| 6861 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6862 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6863 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6864 | crt_file=data_files/server7_int-ca.crt \ |
| 6865 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6866 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6867 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6868 | "$P_CLI dtls=1 debug_level=2 \ |
| 6869 | crt_file=data_files/server8_int-ca2.crt \ |
| 6870 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6871 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6872 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6873 | 0 \ |
| 6874 | -s "found fragmented DTLS handshake message" \ |
| 6875 | -C "found fragmented DTLS handshake message" \ |
| 6876 | -C "error" |
| 6877 | |
| 6878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6879 | requires_config_enabled MBEDTLS_RSA_C |
| 6880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6881 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6882 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6883 | crt_file=data_files/server7_int-ca.crt \ |
| 6884 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6885 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6886 | mtu=512" \ |
| 6887 | "$P_CLI dtls=1 debug_level=2 \ |
| 6888 | crt_file=data_files/server8_int-ca2.crt \ |
| 6889 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6890 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6891 | mtu=2048" \ |
| 6892 | 0 \ |
| 6893 | -S "found fragmented DTLS handshake message" \ |
| 6894 | -c "found fragmented DTLS handshake message" \ |
| 6895 | -C "error" |
| 6896 | |
| 6897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6898 | requires_config_enabled MBEDTLS_RSA_C |
| 6899 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6900 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6901 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6902 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6903 | crt_file=data_files/server7_int-ca.crt \ |
| 6904 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6905 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6906 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6907 | "$P_CLI dtls=1 debug_level=2 \ |
| 6908 | crt_file=data_files/server8_int-ca2.crt \ |
| 6909 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6910 | hs_timeout=2500-60000 \ |
| 6911 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6912 | 0 \ |
| 6913 | -s "found fragmented DTLS handshake message" \ |
| 6914 | -c "found fragmented DTLS handshake message" \ |
| 6915 | -C "error" |
| 6916 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6917 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6918 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6919 | requires_config_enabled MBEDTLS_RSA_C |
| 6920 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6921 | requires_config_enabled MBEDTLS_SHA256_C |
| 6922 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6923 | requires_config_enabled MBEDTLS_AES_C |
| 6924 | requires_config_enabled MBEDTLS_GCM_C |
| 6925 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6926 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6927 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6928 | crt_file=data_files/server7_int-ca.crt \ |
| 6929 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6930 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6931 | mtu=512" \ |
| 6932 | "$P_CLI dtls=1 debug_level=2 \ |
| 6933 | crt_file=data_files/server8_int-ca2.crt \ |
| 6934 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6935 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6936 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6937 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6938 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6939 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6940 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6941 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6942 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6943 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6944 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6945 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6946 | # retransmissions, but in some cases (like both the server and client using |
| 6947 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6948 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6949 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6950 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6951 | requires_config_enabled MBEDTLS_RSA_C |
| 6952 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6953 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6954 | requires_config_enabled MBEDTLS_AES_C |
| 6955 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6956 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6957 | -p "$P_PXY mtu=508" \ |
| 6958 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6959 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6960 | key_file=data_files/server7.key \ |
| 6961 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6962 | "$P_CLI dtls=1 debug_level=2 \ |
| 6963 | crt_file=data_files/server8_int-ca2.crt \ |
| 6964 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6965 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6966 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6967 | 0 \ |
| 6968 | -s "found fragmented DTLS handshake message" \ |
| 6969 | -c "found fragmented DTLS handshake message" \ |
| 6970 | -C "error" |
| 6971 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6972 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6973 | only_with_valgrind |
| 6974 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6975 | requires_config_enabled MBEDTLS_RSA_C |
| 6976 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6977 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6978 | requires_config_enabled MBEDTLS_AES_C |
| 6979 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6980 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6981 | -p "$P_PXY mtu=508" \ |
| 6982 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6983 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6984 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6985 | hs_timeout=250-10000" \ |
| 6986 | "$P_CLI dtls=1 debug_level=2 \ |
| 6987 | crt_file=data_files/server8_int-ca2.crt \ |
| 6988 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6989 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6990 | hs_timeout=250-10000" \ |
| 6991 | 0 \ |
| 6992 | -s "found fragmented DTLS handshake message" \ |
| 6993 | -c "found fragmented DTLS handshake message" \ |
| 6994 | -C "error" |
| 6995 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6996 | # 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] | 6997 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6998 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6999 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7000 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7001 | requires_config_enabled MBEDTLS_RSA_C |
| 7002 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7003 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7004 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7005 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7006 | crt_file=data_files/server7_int-ca.crt \ |
| 7007 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7008 | hs_timeout=10000-60000 \ |
| 7009 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7010 | "$P_CLI dtls=1 debug_level=2 \ |
| 7011 | crt_file=data_files/server8_int-ca2.crt \ |
| 7012 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7013 | hs_timeout=10000-60000 \ |
| 7014 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7015 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7016 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7017 | -s "found fragmented DTLS handshake message" \ |
| 7018 | -c "found fragmented DTLS handshake message" \ |
| 7019 | -C "error" |
| 7020 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7021 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7022 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7023 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7024 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7025 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7027 | requires_config_enabled MBEDTLS_RSA_C |
| 7028 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7029 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7030 | requires_config_enabled MBEDTLS_AES_C |
| 7031 | requires_config_enabled MBEDTLS_GCM_C |
| 7032 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7033 | -p "$P_PXY mtu=512" \ |
| 7034 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7035 | crt_file=data_files/server7_int-ca.crt \ |
| 7036 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7037 | hs_timeout=10000-60000 \ |
| 7038 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7039 | "$P_CLI dtls=1 debug_level=2 \ |
| 7040 | crt_file=data_files/server8_int-ca2.crt \ |
| 7041 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7042 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7043 | hs_timeout=10000-60000 \ |
| 7044 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7045 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7046 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7047 | -s "found fragmented DTLS handshake message" \ |
| 7048 | -c "found fragmented DTLS handshake message" \ |
| 7049 | -C "error" |
| 7050 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7051 | not_with_valgrind # spurious autoreduction due to timeout |
| 7052 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7053 | requires_config_enabled MBEDTLS_RSA_C |
| 7054 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7055 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7056 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7057 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7058 | crt_file=data_files/server7_int-ca.crt \ |
| 7059 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7060 | hs_timeout=10000-60000 \ |
| 7061 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7062 | "$P_CLI dtls=1 debug_level=2 \ |
| 7063 | crt_file=data_files/server8_int-ca2.crt \ |
| 7064 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7065 | hs_timeout=10000-60000 \ |
| 7066 | mtu=1024 nbio=2" \ |
| 7067 | 0 \ |
| 7068 | -S "autoreduction" \ |
| 7069 | -s "found fragmented DTLS handshake message" \ |
| 7070 | -c "found fragmented DTLS handshake message" \ |
| 7071 | -C "error" |
| 7072 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7073 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7074 | not_with_valgrind # spurious autoreduction due to timeout |
| 7075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7076 | requires_config_enabled MBEDTLS_RSA_C |
| 7077 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7078 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7079 | requires_config_enabled MBEDTLS_AES_C |
| 7080 | requires_config_enabled MBEDTLS_GCM_C |
| 7081 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7082 | -p "$P_PXY mtu=512" \ |
| 7083 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7084 | crt_file=data_files/server7_int-ca.crt \ |
| 7085 | key_file=data_files/server7.key \ |
| 7086 | hs_timeout=10000-60000 \ |
| 7087 | mtu=512 nbio=2" \ |
| 7088 | "$P_CLI dtls=1 debug_level=2 \ |
| 7089 | crt_file=data_files/server8_int-ca2.crt \ |
| 7090 | key_file=data_files/server8.key \ |
| 7091 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7092 | hs_timeout=10000-60000 \ |
| 7093 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7094 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7095 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7096 | -s "found fragmented DTLS handshake message" \ |
| 7097 | -c "found fragmented DTLS handshake message" \ |
| 7098 | -C "error" |
| 7099 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7100 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 7101 | # This ensures things still work after session_reset(). |
| 7102 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7103 | # Since we don't support reading fragmented ClientHello yet, |
| 7104 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7105 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7106 | # An autoreduction on the client-side might happen if the server is |
| 7107 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7108 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7109 | # resumed listening, which would result in a spurious autoreduction. |
| 7110 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7111 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7112 | requires_config_enabled MBEDTLS_RSA_C |
| 7113 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7114 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7115 | requires_config_enabled MBEDTLS_AES_C |
| 7116 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7117 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7118 | -p "$P_PXY mtu=1450" \ |
| 7119 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7120 | crt_file=data_files/server7_int-ca.crt \ |
| 7121 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7122 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7123 | mtu=1450" \ |
| 7124 | "$P_CLI dtls=1 debug_level=2 \ |
| 7125 | crt_file=data_files/server8_int-ca2.crt \ |
| 7126 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7127 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7128 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7129 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7130 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7131 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7132 | -s "found fragmented DTLS handshake message" \ |
| 7133 | -c "found fragmented DTLS handshake message" \ |
| 7134 | -C "error" |
| 7135 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7136 | # An autoreduction on the client-side might happen if the server is |
| 7137 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7138 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7140 | requires_config_enabled MBEDTLS_RSA_C |
| 7141 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7142 | requires_config_enabled MBEDTLS_SHA256_C |
| 7143 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7144 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7145 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7146 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7147 | -p "$P_PXY mtu=512" \ |
| 7148 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7149 | crt_file=data_files/server7_int-ca.crt \ |
| 7150 | key_file=data_files/server7.key \ |
| 7151 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7152 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7153 | mtu=512" \ |
| 7154 | "$P_CLI dtls=1 debug_level=2 \ |
| 7155 | crt_file=data_files/server8_int-ca2.crt \ |
| 7156 | key_file=data_files/server8.key \ |
| 7157 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7158 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7159 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7160 | mtu=512" \ |
| 7161 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7162 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7163 | -s "found fragmented DTLS handshake message" \ |
| 7164 | -c "found fragmented DTLS handshake message" \ |
| 7165 | -C "error" |
| 7166 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7167 | # An autoreduction on the client-side might happen if the server is |
| 7168 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7169 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7171 | requires_config_enabled MBEDTLS_RSA_C |
| 7172 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7173 | requires_config_enabled MBEDTLS_SHA256_C |
| 7174 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7175 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7176 | requires_config_enabled MBEDTLS_AES_C |
| 7177 | requires_config_enabled MBEDTLS_GCM_C |
| 7178 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7179 | -p "$P_PXY mtu=512" \ |
| 7180 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7181 | crt_file=data_files/server7_int-ca.crt \ |
| 7182 | key_file=data_files/server7.key \ |
| 7183 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7184 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7185 | mtu=512" \ |
| 7186 | "$P_CLI dtls=1 debug_level=2 \ |
| 7187 | crt_file=data_files/server8_int-ca2.crt \ |
| 7188 | key_file=data_files/server8.key \ |
| 7189 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7190 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7191 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7192 | mtu=512" \ |
| 7193 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7194 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7195 | -s "found fragmented DTLS handshake message" \ |
| 7196 | -c "found fragmented DTLS handshake message" \ |
| 7197 | -C "error" |
| 7198 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7199 | # An autoreduction on the client-side might happen if the server is |
| 7200 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7201 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7203 | requires_config_enabled MBEDTLS_RSA_C |
| 7204 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7205 | requires_config_enabled MBEDTLS_SHA256_C |
| 7206 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7207 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7208 | requires_config_enabled MBEDTLS_AES_C |
| 7209 | requires_config_enabled MBEDTLS_CCM_C |
| 7210 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7211 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7212 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7213 | crt_file=data_files/server7_int-ca.crt \ |
| 7214 | key_file=data_files/server7.key \ |
| 7215 | exchanges=2 renegotiation=1 \ |
| 7216 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7217 | hs_timeout=10000-60000 \ |
| 7218 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7219 | "$P_CLI dtls=1 debug_level=2 \ |
| 7220 | crt_file=data_files/server8_int-ca2.crt \ |
| 7221 | key_file=data_files/server8.key \ |
| 7222 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7223 | hs_timeout=10000-60000 \ |
| 7224 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7225 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7226 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7227 | -s "found fragmented DTLS handshake message" \ |
| 7228 | -c "found fragmented DTLS handshake message" \ |
| 7229 | -C "error" |
| 7230 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7231 | # An autoreduction on the client-side might happen if the server is |
| 7232 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7233 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7234 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7235 | requires_config_enabled MBEDTLS_RSA_C |
| 7236 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7237 | requires_config_enabled MBEDTLS_SHA256_C |
| 7238 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7240 | requires_config_enabled MBEDTLS_AES_C |
| 7241 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7242 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7243 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7244 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7245 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7246 | crt_file=data_files/server7_int-ca.crt \ |
| 7247 | key_file=data_files/server7.key \ |
| 7248 | exchanges=2 renegotiation=1 \ |
| 7249 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7250 | hs_timeout=10000-60000 \ |
| 7251 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7252 | "$P_CLI dtls=1 debug_level=2 \ |
| 7253 | crt_file=data_files/server8_int-ca2.crt \ |
| 7254 | key_file=data_files/server8.key \ |
| 7255 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7256 | hs_timeout=10000-60000 \ |
| 7257 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7258 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7259 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7260 | -s "found fragmented DTLS handshake message" \ |
| 7261 | -c "found fragmented DTLS handshake message" \ |
| 7262 | -C "error" |
| 7263 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7264 | # An autoreduction on the client-side might happen if the server is |
| 7265 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7266 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7267 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7268 | requires_config_enabled MBEDTLS_RSA_C |
| 7269 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7270 | requires_config_enabled MBEDTLS_SHA256_C |
| 7271 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7272 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7273 | requires_config_enabled MBEDTLS_AES_C |
| 7274 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7275 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7276 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7277 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7278 | crt_file=data_files/server7_int-ca.crt \ |
| 7279 | key_file=data_files/server7.key \ |
| 7280 | exchanges=2 renegotiation=1 \ |
| 7281 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7282 | hs_timeout=10000-60000 \ |
| 7283 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7284 | "$P_CLI dtls=1 debug_level=2 \ |
| 7285 | crt_file=data_files/server8_int-ca2.crt \ |
| 7286 | key_file=data_files/server8.key \ |
| 7287 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7288 | hs_timeout=10000-60000 \ |
| 7289 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7290 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7291 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7292 | -s "found fragmented DTLS handshake message" \ |
| 7293 | -c "found fragmented DTLS handshake message" \ |
| 7294 | -C "error" |
| 7295 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7296 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7297 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7298 | requires_config_enabled MBEDTLS_RSA_C |
| 7299 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7300 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7301 | requires_config_enabled MBEDTLS_AES_C |
| 7302 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7303 | client_needs_more_time 2 |
| 7304 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7305 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7306 | "$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] | 7307 | crt_file=data_files/server7_int-ca.crt \ |
| 7308 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7309 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7310 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7311 | crt_file=data_files/server8_int-ca2.crt \ |
| 7312 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7313 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7314 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7315 | 0 \ |
| 7316 | -s "found fragmented DTLS handshake message" \ |
| 7317 | -c "found fragmented DTLS handshake message" \ |
| 7318 | -C "error" |
| 7319 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7320 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7321 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7322 | requires_config_enabled MBEDTLS_RSA_C |
| 7323 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7325 | requires_config_enabled MBEDTLS_AES_C |
| 7326 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7327 | client_needs_more_time 2 |
| 7328 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7329 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7330 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7331 | crt_file=data_files/server7_int-ca.crt \ |
| 7332 | key_file=data_files/server7.key \ |
| 7333 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7334 | "$P_CLI dtls=1 debug_level=2 \ |
| 7335 | crt_file=data_files/server8_int-ca2.crt \ |
| 7336 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7337 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7338 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7339 | 0 \ |
| 7340 | -s "found fragmented DTLS handshake message" \ |
| 7341 | -c "found fragmented DTLS handshake message" \ |
| 7342 | -C "error" |
| 7343 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7344 | # interop tests for DTLS fragmentating with reliable connection |
| 7345 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7346 | # here and below we just want to test that the we fragment in a way that |
| 7347 | # pleases other implementations, so we don't need the peer to fragment |
| 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7349 | requires_config_enabled MBEDTLS_RSA_C |
| 7350 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7352 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7353 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7354 | "$G_SRV -u" \ |
| 7355 | "$P_CLI dtls=1 debug_level=2 \ |
| 7356 | crt_file=data_files/server8_int-ca2.crt \ |
| 7357 | key_file=data_files/server8.key \ |
| 7358 | mtu=512 force_version=dtls1_2" \ |
| 7359 | 0 \ |
| 7360 | -c "fragmenting handshake message" \ |
| 7361 | -C "error" |
| 7362 | |
| 7363 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7364 | requires_config_enabled MBEDTLS_RSA_C |
| 7365 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7367 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7368 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7369 | "$G_SRV -u" \ |
| 7370 | "$P_CLI dtls=1 debug_level=2 \ |
| 7371 | crt_file=data_files/server8_int-ca2.crt \ |
| 7372 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7373 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7374 | 0 \ |
| 7375 | -c "fragmenting handshake message" \ |
| 7376 | -C "error" |
| 7377 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7378 | # We use --insecure for the GnuTLS client because it expects |
| 7379 | # the hostname / IP it connects to to be the name used in the |
| 7380 | # certificate obtained from the server. Here, however, it |
| 7381 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7382 | # as the server name in the certificate. This will make the |
| 7383 | # certifiate validation fail, but passing --insecure makes |
| 7384 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7386 | requires_config_enabled MBEDTLS_RSA_C |
| 7387 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7389 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7390 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7391 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7392 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7393 | crt_file=data_files/server7_int-ca.crt \ |
| 7394 | key_file=data_files/server7.key \ |
| 7395 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7396 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7397 | 0 \ |
| 7398 | -s "fragmenting handshake message" |
| 7399 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7400 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7401 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7402 | requires_config_enabled MBEDTLS_RSA_C |
| 7403 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7404 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7405 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7406 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7407 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7408 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7409 | crt_file=data_files/server7_int-ca.crt \ |
| 7410 | key_file=data_files/server7.key \ |
| 7411 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7412 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7413 | 0 \ |
| 7414 | -s "fragmenting handshake message" |
| 7415 | |
| 7416 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7417 | requires_config_enabled MBEDTLS_RSA_C |
| 7418 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7419 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7420 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7421 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7422 | "$P_CLI dtls=1 debug_level=2 \ |
| 7423 | crt_file=data_files/server8_int-ca2.crt \ |
| 7424 | key_file=data_files/server8.key \ |
| 7425 | mtu=512 force_version=dtls1_2" \ |
| 7426 | 0 \ |
| 7427 | -c "fragmenting handshake message" \ |
| 7428 | -C "error" |
| 7429 | |
| 7430 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7431 | requires_config_enabled MBEDTLS_RSA_C |
| 7432 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7434 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 7435 | "$O_SRV -dtls1 -verify 10" \ |
| 7436 | "$P_CLI dtls=1 debug_level=2 \ |
| 7437 | crt_file=data_files/server8_int-ca2.crt \ |
| 7438 | key_file=data_files/server8.key \ |
| 7439 | mtu=512 force_version=dtls1" \ |
| 7440 | 0 \ |
| 7441 | -c "fragmenting handshake message" \ |
| 7442 | -C "error" |
| 7443 | |
| 7444 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7445 | requires_config_enabled MBEDTLS_RSA_C |
| 7446 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7448 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7449 | "$P_SRV dtls=1 debug_level=2 \ |
| 7450 | crt_file=data_files/server7_int-ca.crt \ |
| 7451 | key_file=data_files/server7.key \ |
| 7452 | mtu=512 force_version=dtls1_2" \ |
| 7453 | "$O_CLI -dtls1_2" \ |
| 7454 | 0 \ |
| 7455 | -s "fragmenting handshake message" |
| 7456 | |
| 7457 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7458 | requires_config_enabled MBEDTLS_RSA_C |
| 7459 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7461 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 7462 | "$P_SRV dtls=1 debug_level=2 \ |
| 7463 | crt_file=data_files/server7_int-ca.crt \ |
| 7464 | key_file=data_files/server7.key \ |
| 7465 | mtu=512 force_version=dtls1" \ |
| 7466 | "$O_CLI -dtls1" \ |
| 7467 | 0 \ |
| 7468 | -s "fragmenting handshake message" |
| 7469 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7470 | # interop tests for DTLS fragmentating with unreliable connection |
| 7471 | # |
| 7472 | # again we just want to test that the we fragment in a way that |
| 7473 | # pleases other implementations, so we don't need the peer to fragment |
| 7474 | requires_gnutls_next |
| 7475 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7476 | requires_config_enabled MBEDTLS_RSA_C |
| 7477 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7479 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7480 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7481 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7482 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7483 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7484 | crt_file=data_files/server8_int-ca2.crt \ |
| 7485 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7486 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7487 | 0 \ |
| 7488 | -c "fragmenting handshake message" \ |
| 7489 | -C "error" |
| 7490 | |
| 7491 | requires_gnutls_next |
| 7492 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7493 | requires_config_enabled MBEDTLS_RSA_C |
| 7494 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7496 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7497 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 7498 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7499 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7500 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7501 | crt_file=data_files/server8_int-ca2.crt \ |
| 7502 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7503 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7504 | 0 \ |
| 7505 | -c "fragmenting handshake message" \ |
| 7506 | -C "error" |
| 7507 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7508 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7509 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7510 | requires_config_enabled MBEDTLS_RSA_C |
| 7511 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7512 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7513 | client_needs_more_time 4 |
| 7514 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7515 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7516 | "$P_SRV dtls=1 debug_level=2 \ |
| 7517 | crt_file=data_files/server7_int-ca.crt \ |
| 7518 | key_file=data_files/server7.key \ |
| 7519 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7520 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7521 | 0 \ |
| 7522 | -s "fragmenting handshake message" |
| 7523 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7524 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7525 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7526 | requires_config_enabled MBEDTLS_RSA_C |
| 7527 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7529 | client_needs_more_time 4 |
| 7530 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7531 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7532 | "$P_SRV dtls=1 debug_level=2 \ |
| 7533 | crt_file=data_files/server7_int-ca.crt \ |
| 7534 | key_file=data_files/server7.key \ |
| 7535 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7536 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7537 | 0 \ |
| 7538 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7539 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7540 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7541 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7542 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7543 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7544 | ## (this should happen in some 1.1.1_ release according to the ticket). |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7545 | skip_next_test |
| 7546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7547 | requires_config_enabled MBEDTLS_RSA_C |
| 7548 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7550 | client_needs_more_time 4 |
| 7551 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7552 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7553 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7554 | "$P_CLI dtls=1 debug_level=2 \ |
| 7555 | crt_file=data_files/server8_int-ca2.crt \ |
| 7556 | key_file=data_files/server8.key \ |
| 7557 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7558 | 0 \ |
| 7559 | -c "fragmenting handshake message" \ |
| 7560 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7561 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7562 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7563 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7564 | requires_config_enabled MBEDTLS_RSA_C |
| 7565 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7567 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7568 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7569 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7570 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7571 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7572 | crt_file=data_files/server8_int-ca2.crt \ |
| 7573 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7574 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7575 | 0 \ |
| 7576 | -c "fragmenting handshake message" \ |
| 7577 | -C "error" |
| 7578 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7579 | skip_next_test |
| 7580 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7581 | requires_config_enabled MBEDTLS_RSA_C |
| 7582 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7583 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7584 | client_needs_more_time 4 |
| 7585 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7586 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7587 | "$P_SRV dtls=1 debug_level=2 \ |
| 7588 | crt_file=data_files/server7_int-ca.crt \ |
| 7589 | key_file=data_files/server7.key \ |
| 7590 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7591 | "$O_CLI -dtls1_2" \ |
| 7592 | 0 \ |
| 7593 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7594 | |
| 7595 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7596 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7597 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7598 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7599 | requires_config_enabled MBEDTLS_RSA_C |
| 7600 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7602 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7603 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7604 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7605 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7606 | crt_file=data_files/server7_int-ca.crt \ |
| 7607 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7608 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7609 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7610 | 0 \ |
| 7611 | -s "fragmenting handshake message" |
| 7612 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7613 | # Tests for specific things with "unreliable" UDP connection |
| 7614 | |
| 7615 | not_with_valgrind # spurious resend due to timeout |
| 7616 | run_test "DTLS proxy: reference" \ |
| 7617 | -p "$P_PXY" \ |
| 7618 | "$P_SRV dtls=1 debug_level=2" \ |
| 7619 | "$P_CLI dtls=1 debug_level=2" \ |
| 7620 | 0 \ |
| 7621 | -C "replayed record" \ |
| 7622 | -S "replayed record" \ |
| 7623 | -C "record from another epoch" \ |
| 7624 | -S "record from another epoch" \ |
| 7625 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7626 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7627 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7628 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7629 | -c "HTTP/1.0 200 OK" |
| 7630 | |
| 7631 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7632 | run_test "DTLS proxy: duplicate every packet" \ |
| 7633 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7634 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7635 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7636 | 0 \ |
| 7637 | -c "replayed record" \ |
| 7638 | -s "replayed record" \ |
| 7639 | -c "record from another epoch" \ |
| 7640 | -s "record from another epoch" \ |
| 7641 | -S "resend" \ |
| 7642 | -s "Extra-header:" \ |
| 7643 | -c "HTTP/1.0 200 OK" |
| 7644 | |
| 7645 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7646 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7647 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7648 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7649 | 0 \ |
| 7650 | -c "replayed record" \ |
| 7651 | -S "replayed record" \ |
| 7652 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7653 | -s "record from another epoch" \ |
| 7654 | -c "resend" \ |
| 7655 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7656 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7657 | -c "HTTP/1.0 200 OK" |
| 7658 | |
| 7659 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7660 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7661 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7662 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7663 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7664 | -c "next record in same datagram" \ |
| 7665 | -s "next record in same datagram" |
| 7666 | |
| 7667 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7668 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7669 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7670 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7671 | 0 \ |
| 7672 | -c "next record in same datagram" \ |
| 7673 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7674 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7675 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7676 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7677 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7678 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7679 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7680 | -c "discarding invalid record (mac)" \ |
| 7681 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7682 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7683 | -c "HTTP/1.0 200 OK" \ |
| 7684 | -S "too many records with bad MAC" \ |
| 7685 | -S "Verification of the message MAC failed" |
| 7686 | |
| 7687 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7688 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7689 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7690 | "$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] | 7691 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7692 | -C "discarding invalid record (mac)" \ |
| 7693 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7694 | -S "Extra-header:" \ |
| 7695 | -C "HTTP/1.0 200 OK" \ |
| 7696 | -s "too many records with bad MAC" \ |
| 7697 | -s "Verification of the message MAC failed" |
| 7698 | |
| 7699 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7700 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7701 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7702 | "$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] | 7703 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7704 | -c "discarding invalid record (mac)" \ |
| 7705 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7706 | -s "Extra-header:" \ |
| 7707 | -c "HTTP/1.0 200 OK" \ |
| 7708 | -S "too many records with bad MAC" \ |
| 7709 | -S "Verification of the message MAC failed" |
| 7710 | |
| 7711 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7712 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7713 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7714 | "$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] | 7715 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7716 | -c "discarding invalid record (mac)" \ |
| 7717 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7718 | -s "Extra-header:" \ |
| 7719 | -c "HTTP/1.0 200 OK" \ |
| 7720 | -s "too many records with bad MAC" \ |
| 7721 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7722 | |
| 7723 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7724 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7725 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7726 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7727 | 0 \ |
| 7728 | -c "record from another epoch" \ |
| 7729 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7730 | -s "Extra-header:" \ |
| 7731 | -c "HTTP/1.0 200 OK" |
| 7732 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7733 | # Tests for reordering support with DTLS |
| 7734 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7735 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7736 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7737 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7738 | hs_timeout=2500-60000" \ |
| 7739 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7740 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7741 | 0 \ |
| 7742 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7743 | -c "Next handshake message has been buffered - load"\ |
| 7744 | -S "Buffering HS message" \ |
| 7745 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7746 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7747 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7748 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7749 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7750 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7751 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7752 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7753 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7754 | hs_timeout=2500-60000" \ |
| 7755 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7756 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7757 | 0 \ |
| 7758 | -c "Buffering HS message" \ |
| 7759 | -c "found fragmented DTLS handshake message"\ |
| 7760 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7761 | -c "Next handshake message has been buffered - load"\ |
| 7762 | -S "Buffering HS message" \ |
| 7763 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7764 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7765 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7766 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7767 | -S "Remember CCS message" |
| 7768 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7769 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7770 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7771 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7772 | # while keeping the ServerKeyExchange. |
| 7773 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7774 | 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] | 7775 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7776 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7777 | hs_timeout=2500-60000" \ |
| 7778 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7779 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7780 | 0 \ |
| 7781 | -c "Buffering HS message" \ |
| 7782 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7783 | -C "attempt to make space by freeing buffered messages" \ |
| 7784 | -S "Buffering HS message" \ |
| 7785 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7786 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7787 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7788 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7789 | -S "Remember CCS message" |
| 7790 | |
| 7791 | # The size constraints ensure that the delayed certificate message can't |
| 7792 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7793 | # when dropping it first. |
| 7794 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7795 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7796 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7797 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7798 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7799 | hs_timeout=2500-60000" \ |
| 7800 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7801 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7802 | 0 \ |
| 7803 | -c "Buffering HS message" \ |
| 7804 | -c "attempt to make space by freeing buffered future messages" \ |
| 7805 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7806 | -S "Buffering HS message" \ |
| 7807 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7808 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7809 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7810 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7811 | -S "Remember CCS message" |
| 7812 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7813 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7814 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7815 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7816 | hs_timeout=2500-60000" \ |
| 7817 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7818 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7819 | 0 \ |
| 7820 | -C "Buffering HS message" \ |
| 7821 | -C "Next handshake message has been buffered - load"\ |
| 7822 | -s "Buffering HS message" \ |
| 7823 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7824 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7825 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7826 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7827 | -S "Remember CCS message" |
| 7828 | |
| 7829 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7830 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7831 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7832 | hs_timeout=2500-60000" \ |
| 7833 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7834 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7835 | 0 \ |
| 7836 | -C "Buffering HS message" \ |
| 7837 | -C "Next handshake message has been buffered - load"\ |
| 7838 | -S "Buffering HS message" \ |
| 7839 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7840 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7841 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7842 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7843 | -S "Remember CCS message" |
| 7844 | |
| 7845 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7846 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7847 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7848 | hs_timeout=2500-60000" \ |
| 7849 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7850 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7851 | 0 \ |
| 7852 | -C "Buffering HS message" \ |
| 7853 | -C "Next handshake message has been buffered - load"\ |
| 7854 | -S "Buffering HS message" \ |
| 7855 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7856 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7857 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7858 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7859 | -s "Remember CCS message" |
| 7860 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7861 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7862 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7863 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7864 | hs_timeout=2500-60000" \ |
| 7865 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7866 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7867 | 0 \ |
| 7868 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7869 | -s "Found buffered record from current epoch - load" \ |
| 7870 | -c "Buffer record from epoch 1" \ |
| 7871 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7872 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7873 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7874 | # from the server are delayed, so that the encrypted Finished message |
| 7875 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7876 | # in afterwards, the encrypted Finished message must be freed in order |
| 7877 | # to make space for the NewSessionTicket to be reassembled. |
| 7878 | # This works only in very particular circumstances: |
| 7879 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7880 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7881 | # the encrypted Finished message. |
| 7882 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7883 | # needs to be fragmented. |
| 7884 | # - All messages sent by the server must be small enough to be either sent |
| 7885 | # without fragmentation or be reassembled within the bounds of |
| 7886 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7887 | # handshake, omitting CRTs. |
| 7888 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7889 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7890 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7891 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7892 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7893 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7894 | 0 \ |
| 7895 | -s "Buffer record from epoch 1" \ |
| 7896 | -s "Found buffered record from current epoch - load" \ |
| 7897 | -c "Buffer record from epoch 1" \ |
| 7898 | -C "Found buffered record from current epoch - load" \ |
| 7899 | -c "Enough space available after freeing future epoch record" |
| 7900 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7901 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7902 | |
| 7903 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7904 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7905 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7906 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7907 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7908 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7909 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7910 | 0 \ |
| 7911 | -s "Extra-header:" \ |
| 7912 | -c "HTTP/1.0 200 OK" |
| 7913 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7914 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7915 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7916 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7917 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7918 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7919 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7920 | 0 \ |
| 7921 | -s "Extra-header:" \ |
| 7922 | -c "HTTP/1.0 200 OK" |
| 7923 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7924 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7925 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7926 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7927 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7928 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7929 | 0 \ |
| 7930 | -s "Extra-header:" \ |
| 7931 | -c "HTTP/1.0 200 OK" |
| 7932 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7933 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7934 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7935 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7936 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7937 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7938 | 0 \ |
| 7939 | -s "Extra-header:" \ |
| 7940 | -c "HTTP/1.0 200 OK" |
| 7941 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7942 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7943 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7944 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7945 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7946 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7947 | 0 \ |
| 7948 | -s "Extra-header:" \ |
| 7949 | -c "HTTP/1.0 200 OK" |
| 7950 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7951 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7952 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7953 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7954 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7955 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7956 | 0 \ |
| 7957 | -s "Extra-header:" \ |
| 7958 | -c "HTTP/1.0 200 OK" |
| 7959 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7960 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7961 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7962 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7963 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 7964 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7965 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7966 | 0 \ |
| 7967 | -s "Extra-header:" \ |
| 7968 | -c "HTTP/1.0 200 OK" |
| 7969 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7970 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7971 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7972 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7973 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7974 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7975 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7976 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7977 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7978 | 0 \ |
| 7979 | -s "a session has been resumed" \ |
| 7980 | -c "a session has been resumed" \ |
| 7981 | -s "Extra-header:" \ |
| 7982 | -c "HTTP/1.0 200 OK" |
| 7983 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7984 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7985 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7986 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7987 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7988 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7989 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7990 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 7991 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7992 | 0 \ |
| 7993 | -s "a session has been resumed" \ |
| 7994 | -c "a session has been resumed" \ |
| 7995 | -s "Extra-header:" \ |
| 7996 | -c "HTTP/1.0 200 OK" |
| 7997 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7998 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8000 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8001 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8002 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8003 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8004 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8005 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8006 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8007 | 0 \ |
| 8008 | -c "=> renegotiate" \ |
| 8009 | -s "=> renegotiate" \ |
| 8010 | -s "Extra-header:" \ |
| 8011 | -c "HTTP/1.0 200 OK" |
| 8012 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8013 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8014 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8015 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8016 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8017 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8018 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8019 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8020 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8021 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8022 | 0 \ |
| 8023 | -c "=> renegotiate" \ |
| 8024 | -s "=> renegotiate" \ |
| 8025 | -s "Extra-header:" \ |
| 8026 | -c "HTTP/1.0 200 OK" |
| 8027 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8028 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8030 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8031 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8032 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8033 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8034 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8035 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8036 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8037 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8038 | 0 \ |
| 8039 | -c "=> renegotiate" \ |
| 8040 | -s "=> renegotiate" \ |
| 8041 | -s "Extra-header:" \ |
| 8042 | -c "HTTP/1.0 200 OK" |
| 8043 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8044 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8046 | 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] | 8047 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8048 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8049 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8050 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8051 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8052 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8053 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8054 | 0 \ |
| 8055 | -c "=> renegotiate" \ |
| 8056 | -s "=> renegotiate" \ |
| 8057 | -s "Extra-header:" \ |
| 8058 | -c "HTTP/1.0 200 OK" |
| 8059 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8060 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8061 | ## all versions installed on the CI machines), reported here: |
| 8062 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8063 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8064 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8065 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8066 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8067 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8068 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8069 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8070 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8071 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8072 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8073 | -c "HTTP/1.0 200 OK" |
| 8074 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8075 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8076 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8077 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8078 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8079 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8080 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8081 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8082 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8083 | -c "HTTP/1.0 200 OK" |
| 8084 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8085 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8086 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8087 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8088 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8089 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8090 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8091 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8092 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8093 | -c "HTTP/1.0 200 OK" |
| 8094 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8095 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8096 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8097 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8098 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8099 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8100 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8101 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8102 | 0 \ |
| 8103 | -s "Extra-header:" \ |
| 8104 | -c "Extra-header:" |
| 8105 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8106 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8107 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8108 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8109 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8111 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8112 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8113 | 0 \ |
| 8114 | -s "Extra-header:" \ |
| 8115 | -c "Extra-header:" |
| 8116 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8117 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8118 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8119 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8120 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8121 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8122 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8123 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8124 | 0 \ |
| 8125 | -s "Extra-header:" \ |
| 8126 | -c "Extra-header:" |
| 8127 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8128 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8129 | run_test "export keys functionality" \ |
| 8130 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8131 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8132 | 0 \ |
| 8133 | -s "exported maclen is " \ |
| 8134 | -s "exported keylen is " \ |
| 8135 | -s "exported ivlen is " \ |
| 8136 | -c "exported maclen is " \ |
| 8137 | -c "exported keylen is " \ |
| 8138 | -c "exported ivlen is " |
| 8139 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8140 | # Final report |
| 8141 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8142 | echo "------------------------------------------------------------------------" |
| 8143 | |
| 8144 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8145 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8146 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8147 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8148 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8149 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8150 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8151 | |
| 8152 | exit $FAILS |