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" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1289 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1290 | -C "found CID extension" \ |
| 1291 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1292 | -C "Copy CIDs into SSL transform" \ |
| 1293 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1294 | |
| 1295 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1296 | run_test "(STUB) Connection ID: Client disabled, server enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1297 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1298 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1299 | 0 \ |
| 1300 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1301 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1302 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1303 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1304 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1305 | -C "found CID extension" \ |
| 1306 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1307 | -C "Copy CIDs into SSL transform" \ |
| 1308 | -s "Use of Connection ID was not offered by the client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1309 | |
| 1310 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1311 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1312 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1313 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1314 | 0 \ |
| 1315 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1316 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1317 | -c "client hello, adding CID extension" \ |
| 1318 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1319 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1320 | -s "server hello, adding CID extension" \ |
| 1321 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1322 | -c "Use of CID extension negotiated" \ |
| 1323 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1324 | -c "Copy CIDs into SSL transform" \ |
| 1325 | -s "Use of Connection ID has been negotiated" \ |
| 1326 | -c "Use of Connection ID has been negotiated" \ |
| 1327 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1328 | -s "Peer CID (length 2 Bytes): be ef" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1329 | |
| 1330 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1331 | run_test "(STUB) Connection ID: Client+Server enabled, Client CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1332 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1333 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1334 | 0 \ |
| 1335 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1336 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1337 | -c "client hello, adding CID extension" \ |
| 1338 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1339 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1340 | -s "server hello, adding CID extension" \ |
| 1341 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1342 | -c "Use of CID extension negotiated" \ |
| 1343 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1344 | -c "Copy CIDs into SSL transform" \ |
| 1345 | -s "Use of Connection ID has been negotiated" \ |
| 1346 | -c "Use of Connection ID has been negotiated" \ |
| 1347 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1348 | -s "Peer CID (length 0 Bytes):" |
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, Server CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1352 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1353 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 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" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1360 | -s "server hello, adding CID extension" \ |
| 1361 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1362 | -c "Use of CID extension negotiated" \ |
| 1363 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1364 | -c "Copy CIDs into SSL transform" \ |
| 1365 | -s "Use of Connection ID has been negotiated" \ |
| 1366 | -c "Use of Connection ID has been negotiated" \ |
| 1367 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1368 | -c "Peer CID (length 0 Bytes):" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1369 | |
| 1370 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1371 | run_test "(STUB) Connection ID: Client+Server enabled, Client+Server CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1372 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1373 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1374 | 0 \ |
| 1375 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1376 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1377 | -c "client hello, adding CID extension" \ |
| 1378 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1379 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1380 | -s "server hello, adding CID extension" \ |
| 1381 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1382 | -c "Use of CID extension negotiated" \ |
| 1383 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1384 | -c "Copy CIDs into SSL transform" \ |
| 1385 | -S "Use of Connection ID has been negotiated" \ |
| 1386 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1387 | |
| 1388 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1389 | 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] | 1390 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1391 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1392 | 0 \ |
| 1393 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1394 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1395 | -c "client hello, adding CID extension" \ |
| 1396 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1397 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1398 | -s "server hello, adding CID extension" \ |
| 1399 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1400 | -c "Use of CID extension negotiated" \ |
| 1401 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1402 | -c "Copy CIDs into SSL transform" \ |
| 1403 | -s "Use of Connection ID has been negotiated" \ |
| 1404 | -c "Use of Connection ID has been negotiated" \ |
| 1405 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1406 | -s "Peer CID (length 2 Bytes): be ef" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1407 | |
| 1408 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1409 | 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] | 1410 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1411 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1412 | 0 \ |
| 1413 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1414 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1415 | -c "client hello, adding CID extension" \ |
| 1416 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1417 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1418 | -s "server hello, adding CID extension" \ |
| 1419 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1420 | -c "Use of CID extension negotiated" \ |
| 1421 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1422 | -c "Copy CIDs into SSL transform" \ |
| 1423 | -s "Use of Connection ID has been negotiated" \ |
| 1424 | -c "Use of Connection ID has been negotiated" \ |
| 1425 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1426 | -s "Peer CID (length 0 Bytes):" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1427 | |
| 1428 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1429 | 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] | 1430 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1431 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1432 | 0 \ |
| 1433 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1434 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1435 | -c "client hello, adding CID extension" \ |
| 1436 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1437 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1438 | -s "server hello, adding CID extension" \ |
| 1439 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1440 | -c "Use of CID extension negotiated" \ |
| 1441 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1442 | -c "Copy CIDs into SSL transform" \ |
| 1443 | -s "Use of Connection ID has been negotiated" \ |
| 1444 | -c "Use of Connection ID has been negotiated" \ |
| 1445 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1446 | -c "Peer CID (length 0 Bytes):" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1447 | |
| 1448 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1449 | 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] | 1450 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1451 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1452 | 0 \ |
| 1453 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1454 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1455 | -c "client hello, adding CID extension" \ |
| 1456 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1457 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1458 | -s "server hello, adding CID extension" \ |
| 1459 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1460 | -c "Use of CID extension negotiated" \ |
| 1461 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1462 | -c "Copy CIDs into SSL transform" \ |
| 1463 | -S "Use of Connection ID has been negotiated" \ |
| 1464 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1465 | |
| 1466 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1467 | 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] | 1468 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1469 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1470 | 0 \ |
| 1471 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1472 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1473 | -c "client hello, adding CID extension" \ |
| 1474 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1475 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1476 | -s "server hello, adding CID extension" \ |
| 1477 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1478 | -c "Use of CID extension negotiated" \ |
| 1479 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1480 | -c "Copy CIDs into SSL transform" \ |
| 1481 | -s "Use of Connection ID has been negotiated" \ |
| 1482 | -c "Use of Connection ID has been negotiated" \ |
| 1483 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1484 | -s "Peer CID (length 2 Bytes): be ef" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1485 | |
| 1486 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1487 | 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] | 1488 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1489 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1490 | 0 \ |
| 1491 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1492 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1493 | -c "client hello, adding CID extension" \ |
| 1494 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1495 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1496 | -s "server hello, adding CID extension" \ |
| 1497 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1498 | -c "Use of CID extension negotiated" \ |
| 1499 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1500 | -c "Copy CIDs into SSL transform" \ |
| 1501 | -s "Use of Connection ID has been negotiated" \ |
| 1502 | -c "Use of Connection ID has been negotiated" \ |
| 1503 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1504 | -s "Peer CID (length 0 Bytes):" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1505 | |
| 1506 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1507 | 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] | 1508 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1509 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1510 | 0 \ |
| 1511 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1512 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1513 | -c "client hello, adding CID extension" \ |
| 1514 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1515 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1516 | -s "server hello, adding CID extension" \ |
| 1517 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1518 | -c "Use of CID extension negotiated" \ |
| 1519 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1520 | -c "Copy CIDs into SSL transform" \ |
| 1521 | -s "Use of Connection ID has been negotiated" \ |
| 1522 | -c "Use of Connection ID has been negotiated" \ |
| 1523 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1524 | -c "Peer CID (length 0 Bytes):" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1525 | |
| 1526 | requires_config_enabled MBEDTLS_SSL_CID |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1527 | 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] | 1528 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1529 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1530 | 0 \ |
| 1531 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1532 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1533 | -c "client hello, adding CID extension" \ |
| 1534 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1535 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1536 | -s "server hello, adding CID extension" \ |
| 1537 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1538 | -c "Use of CID extension negotiated" \ |
| 1539 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1540 | -c "Copy CIDs into SSL transform" \ |
| 1541 | -S "Use of Connection ID has been negotiated" \ |
| 1542 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1543 | |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1544 | requires_config_enabled MBEDTLS_SSL_CID |
| 1545 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 5f925be | 2019-04-23 12:02:34 +0100 | [diff] [blame] | 1546 | run_test "(STUB) Connection ID: Client+Server enabled, renegotiate" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1547 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1548 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1549 | 0 \ |
| 1550 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1551 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1552 | -c "client hello, adding CID extension" \ |
| 1553 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1554 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1555 | -s "server hello, adding CID extension" \ |
| 1556 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1557 | -c "Use of CID extension negotiated" \ |
| 1558 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame^] | 1559 | -c "Copy CIDs into SSL transform" \ |
| 1560 | -s "Use of Connection ID has been negotiated" \ |
| 1561 | -c "Use of Connection ID has been negotiated" \ |
| 1562 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1563 | -s "Peer CID (length 2 Bytes): be ef" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1564 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1565 | # Tests for Encrypt-then-MAC extension |
| 1566 | |
| 1567 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1568 | "$P_SRV debug_level=3 \ |
| 1569 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1570 | "$P_CLI debug_level=3" \ |
| 1571 | 0 \ |
| 1572 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1573 | -s "found encrypt then mac extension" \ |
| 1574 | -s "server hello, adding encrypt then mac extension" \ |
| 1575 | -c "found encrypt_then_mac extension" \ |
| 1576 | -c "using encrypt then mac" \ |
| 1577 | -s "using encrypt then mac" |
| 1578 | |
| 1579 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1580 | "$P_SRV debug_level=3 etm=0 \ |
| 1581 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1582 | "$P_CLI debug_level=3 etm=1" \ |
| 1583 | 0 \ |
| 1584 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1585 | -s "found encrypt then mac extension" \ |
| 1586 | -S "server hello, adding encrypt then mac extension" \ |
| 1587 | -C "found encrypt_then_mac extension" \ |
| 1588 | -C "using encrypt then mac" \ |
| 1589 | -S "using encrypt then mac" |
| 1590 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1591 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1592 | "$P_SRV debug_level=3 etm=1 \ |
| 1593 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1594 | "$P_CLI debug_level=3 etm=1" \ |
| 1595 | 0 \ |
| 1596 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1597 | -s "found encrypt then mac extension" \ |
| 1598 | -S "server hello, adding encrypt then mac extension" \ |
| 1599 | -C "found encrypt_then_mac extension" \ |
| 1600 | -C "using encrypt then mac" \ |
| 1601 | -S "using encrypt then mac" |
| 1602 | |
| 1603 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1604 | "$P_SRV debug_level=3 etm=1 \ |
| 1605 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1606 | "$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] | 1607 | 0 \ |
| 1608 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1609 | -s "found encrypt then mac extension" \ |
| 1610 | -S "server hello, adding encrypt then mac extension" \ |
| 1611 | -C "found encrypt_then_mac extension" \ |
| 1612 | -C "using encrypt then mac" \ |
| 1613 | -S "using encrypt then mac" |
| 1614 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1615 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1616 | "$P_SRV debug_level=3 etm=1 \ |
| 1617 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1618 | "$P_CLI debug_level=3 etm=0" \ |
| 1619 | 0 \ |
| 1620 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1621 | -S "found encrypt then mac extension" \ |
| 1622 | -S "server hello, adding encrypt then mac extension" \ |
| 1623 | -C "found encrypt_then_mac extension" \ |
| 1624 | -C "using encrypt then mac" \ |
| 1625 | -S "using encrypt then mac" |
| 1626 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1627 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1628 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1629 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1630 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1631 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1632 | 0 \ |
| 1633 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1634 | -S "found encrypt then mac extension" \ |
| 1635 | -S "server hello, adding encrypt then mac extension" \ |
| 1636 | -C "found encrypt_then_mac extension" \ |
| 1637 | -C "using encrypt then mac" \ |
| 1638 | -S "using encrypt then mac" |
| 1639 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1640 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1641 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1642 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1643 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1644 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1645 | 0 \ |
| 1646 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1647 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1648 | -S "server hello, adding encrypt then mac extension" \ |
| 1649 | -C "found encrypt_then_mac extension" \ |
| 1650 | -C "using encrypt then mac" \ |
| 1651 | -S "using encrypt then mac" |
| 1652 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1653 | # Tests for Extended Master Secret extension |
| 1654 | |
| 1655 | run_test "Extended Master Secret: default" \ |
| 1656 | "$P_SRV debug_level=3" \ |
| 1657 | "$P_CLI debug_level=3" \ |
| 1658 | 0 \ |
| 1659 | -c "client hello, adding extended_master_secret extension" \ |
| 1660 | -s "found extended master secret extension" \ |
| 1661 | -s "server hello, adding extended master secret extension" \ |
| 1662 | -c "found extended_master_secret extension" \ |
| 1663 | -c "using extended master secret" \ |
| 1664 | -s "using extended master secret" |
| 1665 | |
| 1666 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1667 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1668 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1669 | 0 \ |
| 1670 | -c "client hello, adding extended_master_secret extension" \ |
| 1671 | -s "found extended master secret extension" \ |
| 1672 | -S "server hello, adding extended master secret extension" \ |
| 1673 | -C "found extended_master_secret extension" \ |
| 1674 | -C "using extended master secret" \ |
| 1675 | -S "using extended master secret" |
| 1676 | |
| 1677 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1678 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1679 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1680 | 0 \ |
| 1681 | -C "client hello, adding extended_master_secret extension" \ |
| 1682 | -S "found extended master secret extension" \ |
| 1683 | -S "server hello, adding extended master secret extension" \ |
| 1684 | -C "found extended_master_secret extension" \ |
| 1685 | -C "using extended master secret" \ |
| 1686 | -S "using extended master secret" |
| 1687 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1688 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1689 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1690 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1691 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1692 | 0 \ |
| 1693 | -C "client hello, adding extended_master_secret extension" \ |
| 1694 | -S "found extended master secret extension" \ |
| 1695 | -S "server hello, adding extended master secret extension" \ |
| 1696 | -C "found extended_master_secret extension" \ |
| 1697 | -C "using extended master secret" \ |
| 1698 | -S "using extended master secret" |
| 1699 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1700 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1701 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1702 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1703 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1704 | 0 \ |
| 1705 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1706 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1707 | -S "server hello, adding extended master secret extension" \ |
| 1708 | -C "found extended_master_secret extension" \ |
| 1709 | -C "using extended master secret" \ |
| 1710 | -S "using extended master secret" |
| 1711 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1712 | # Tests for FALLBACK_SCSV |
| 1713 | |
| 1714 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1715 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1716 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1717 | 0 \ |
| 1718 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1719 | -S "received FALLBACK_SCSV" \ |
| 1720 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1721 | -C "is a fatal alert message (msg 86)" |
| 1722 | |
| 1723 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1724 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1725 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1726 | 0 \ |
| 1727 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1728 | -S "received FALLBACK_SCSV" \ |
| 1729 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1730 | -C "is a fatal alert message (msg 86)" |
| 1731 | |
| 1732 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1733 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1734 | "$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] | 1735 | 1 \ |
| 1736 | -c "adding FALLBACK_SCSV" \ |
| 1737 | -s "received FALLBACK_SCSV" \ |
| 1738 | -s "inapropriate fallback" \ |
| 1739 | -c "is a fatal alert message (msg 86)" |
| 1740 | |
| 1741 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1742 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1743 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1744 | 0 \ |
| 1745 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1746 | -s "received FALLBACK_SCSV" \ |
| 1747 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1748 | -C "is a fatal alert message (msg 86)" |
| 1749 | |
| 1750 | requires_openssl_with_fallback_scsv |
| 1751 | run_test "Fallback SCSV: default, openssl server" \ |
| 1752 | "$O_SRV" \ |
| 1753 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1754 | 0 \ |
| 1755 | -C "adding FALLBACK_SCSV" \ |
| 1756 | -C "is a fatal alert message (msg 86)" |
| 1757 | |
| 1758 | requires_openssl_with_fallback_scsv |
| 1759 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1760 | "$O_SRV" \ |
| 1761 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1762 | 1 \ |
| 1763 | -c "adding FALLBACK_SCSV" \ |
| 1764 | -c "is a fatal alert message (msg 86)" |
| 1765 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1766 | requires_openssl_with_fallback_scsv |
| 1767 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1768 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1769 | "$O_CLI -tls1_1" \ |
| 1770 | 0 \ |
| 1771 | -S "received FALLBACK_SCSV" \ |
| 1772 | -S "inapropriate fallback" |
| 1773 | |
| 1774 | requires_openssl_with_fallback_scsv |
| 1775 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1776 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1777 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1778 | 1 \ |
| 1779 | -s "received FALLBACK_SCSV" \ |
| 1780 | -s "inapropriate fallback" |
| 1781 | |
| 1782 | requires_openssl_with_fallback_scsv |
| 1783 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1784 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1785 | "$O_CLI -fallback_scsv" \ |
| 1786 | 0 \ |
| 1787 | -s "received FALLBACK_SCSV" \ |
| 1788 | -S "inapropriate fallback" |
| 1789 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1790 | # Test sending and receiving empty application data records |
| 1791 | |
| 1792 | run_test "Encrypt then MAC: empty application data record" \ |
| 1793 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1794 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1795 | 0 \ |
| 1796 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1797 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1798 | -c "0 bytes written in 1 fragments" |
| 1799 | |
| 1800 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 1801 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1802 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1803 | 0 \ |
| 1804 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1805 | -c "0 bytes written in 1 fragments" |
| 1806 | |
| 1807 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1808 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1809 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1810 | 0 \ |
| 1811 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1812 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1813 | -c "0 bytes written in 1 fragments" |
| 1814 | |
| 1815 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 1816 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1817 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1818 | 0 \ |
| 1819 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1820 | -c "0 bytes written in 1 fragments" |
| 1821 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1822 | ## ClientHello generated with |
| 1823 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1824 | ## then manually twiddling the ciphersuite list. |
| 1825 | ## The ClientHello content is spelled out below as a hex string as |
| 1826 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1827 | ## The expected response is an inappropriate_fallback alert. |
| 1828 | requires_openssl_with_fallback_scsv |
| 1829 | run_test "Fallback SCSV: beginning of list" \ |
| 1830 | "$P_SRV debug_level=2" \ |
| 1831 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1832 | 0 \ |
| 1833 | -s "received FALLBACK_SCSV" \ |
| 1834 | -s "inapropriate fallback" |
| 1835 | |
| 1836 | requires_openssl_with_fallback_scsv |
| 1837 | run_test "Fallback SCSV: end of list" \ |
| 1838 | "$P_SRV debug_level=2" \ |
| 1839 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1840 | 0 \ |
| 1841 | -s "received FALLBACK_SCSV" \ |
| 1842 | -s "inapropriate fallback" |
| 1843 | |
| 1844 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1845 | requires_openssl_with_fallback_scsv |
| 1846 | run_test "Fallback SCSV: not in list" \ |
| 1847 | "$P_SRV debug_level=2" \ |
| 1848 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1849 | 0 \ |
| 1850 | -S "received FALLBACK_SCSV" \ |
| 1851 | -S "inapropriate fallback" |
| 1852 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1853 | # Tests for CBC 1/n-1 record splitting |
| 1854 | |
| 1855 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1856 | "$P_SRV" \ |
| 1857 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1858 | request_size=123 force_version=tls1_2" \ |
| 1859 | 0 \ |
| 1860 | -s "Read from client: 123 bytes read" \ |
| 1861 | -S "Read from client: 1 bytes read" \ |
| 1862 | -S "122 bytes read" |
| 1863 | |
| 1864 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1865 | "$P_SRV" \ |
| 1866 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1867 | request_size=123 force_version=tls1_1" \ |
| 1868 | 0 \ |
| 1869 | -s "Read from client: 123 bytes read" \ |
| 1870 | -S "Read from client: 1 bytes read" \ |
| 1871 | -S "122 bytes read" |
| 1872 | |
| 1873 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1874 | "$P_SRV" \ |
| 1875 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1876 | request_size=123 force_version=tls1" \ |
| 1877 | 0 \ |
| 1878 | -S "Read from client: 123 bytes read" \ |
| 1879 | -s "Read from client: 1 bytes read" \ |
| 1880 | -s "122 bytes read" |
| 1881 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1882 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1883 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1884 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1885 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1886 | request_size=123 force_version=ssl3" \ |
| 1887 | 0 \ |
| 1888 | -S "Read from client: 123 bytes read" \ |
| 1889 | -s "Read from client: 1 bytes read" \ |
| 1890 | -s "122 bytes read" |
| 1891 | |
| 1892 | 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] | 1893 | "$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] | 1894 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1895 | request_size=123 force_version=tls1" \ |
| 1896 | 0 \ |
| 1897 | -s "Read from client: 123 bytes read" \ |
| 1898 | -S "Read from client: 1 bytes read" \ |
| 1899 | -S "122 bytes read" |
| 1900 | |
| 1901 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1902 | "$P_SRV" \ |
| 1903 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1904 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1905 | 0 \ |
| 1906 | -s "Read from client: 123 bytes read" \ |
| 1907 | -S "Read from client: 1 bytes read" \ |
| 1908 | -S "122 bytes read" |
| 1909 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1910 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1911 | "$P_SRV nbio=2" \ |
| 1912 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1913 | request_size=123 force_version=tls1" \ |
| 1914 | 0 \ |
| 1915 | -S "Read from client: 123 bytes read" \ |
| 1916 | -s "Read from client: 1 bytes read" \ |
| 1917 | -s "122 bytes read" |
| 1918 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1919 | # Tests for Session Tickets |
| 1920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1921 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1922 | "$P_SRV debug_level=3 tickets=1" \ |
| 1923 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1924 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1925 | -c "client hello, adding session ticket extension" \ |
| 1926 | -s "found session ticket extension" \ |
| 1927 | -s "server hello, adding session ticket extension" \ |
| 1928 | -c "found session_ticket extension" \ |
| 1929 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1930 | -S "session successfully restored from cache" \ |
| 1931 | -s "session successfully restored from ticket" \ |
| 1932 | -s "a session has been resumed" \ |
| 1933 | -c "a session has been resumed" |
| 1934 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1935 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1936 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1937 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1938 | 0 \ |
| 1939 | -c "client hello, adding session ticket extension" \ |
| 1940 | -s "found session ticket extension" \ |
| 1941 | -s "server hello, adding session ticket extension" \ |
| 1942 | -c "found session_ticket extension" \ |
| 1943 | -c "parse new session ticket" \ |
| 1944 | -S "session successfully restored from cache" \ |
| 1945 | -s "session successfully restored from ticket" \ |
| 1946 | -s "a session has been resumed" \ |
| 1947 | -c "a session has been resumed" |
| 1948 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1949 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1950 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1951 | "$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] | 1952 | 0 \ |
| 1953 | -c "client hello, adding session ticket extension" \ |
| 1954 | -s "found session ticket extension" \ |
| 1955 | -s "server hello, adding session ticket extension" \ |
| 1956 | -c "found session_ticket extension" \ |
| 1957 | -c "parse new session ticket" \ |
| 1958 | -S "session successfully restored from cache" \ |
| 1959 | -S "session successfully restored from ticket" \ |
| 1960 | -S "a session has been resumed" \ |
| 1961 | -C "a session has been resumed" |
| 1962 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1963 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1964 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1965 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1966 | 0 \ |
| 1967 | -c "client hello, adding session ticket extension" \ |
| 1968 | -c "found session_ticket extension" \ |
| 1969 | -c "parse new session ticket" \ |
| 1970 | -c "a session has been resumed" |
| 1971 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1972 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1973 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1974 | "( $O_CLI -sess_out $SESSION; \ |
| 1975 | $O_CLI -sess_in $SESSION; \ |
| 1976 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1977 | 0 \ |
| 1978 | -s "found session ticket extension" \ |
| 1979 | -s "server hello, adding session ticket extension" \ |
| 1980 | -S "session successfully restored from cache" \ |
| 1981 | -s "session successfully restored from ticket" \ |
| 1982 | -s "a session has been resumed" |
| 1983 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1984 | # Tests for Session Tickets with DTLS |
| 1985 | |
| 1986 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1987 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 1988 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 1989 | 0 \ |
| 1990 | -c "client hello, adding session ticket extension" \ |
| 1991 | -s "found session ticket extension" \ |
| 1992 | -s "server hello, adding session ticket extension" \ |
| 1993 | -c "found session_ticket extension" \ |
| 1994 | -c "parse new session ticket" \ |
| 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 | |
| 2000 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2001 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2002 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2003 | 0 \ |
| 2004 | -c "client hello, adding session ticket extension" \ |
| 2005 | -s "found session ticket extension" \ |
| 2006 | -s "server hello, adding session ticket extension" \ |
| 2007 | -c "found session_ticket extension" \ |
| 2008 | -c "parse new session ticket" \ |
| 2009 | -S "session successfully restored from cache" \ |
| 2010 | -s "session successfully restored from ticket" \ |
| 2011 | -s "a session has been resumed" \ |
| 2012 | -c "a session has been resumed" |
| 2013 | |
| 2014 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2015 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2016 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2017 | 0 \ |
| 2018 | -c "client hello, adding session ticket extension" \ |
| 2019 | -s "found session ticket extension" \ |
| 2020 | -s "server hello, adding session ticket extension" \ |
| 2021 | -c "found session_ticket extension" \ |
| 2022 | -c "parse new session ticket" \ |
| 2023 | -S "session successfully restored from cache" \ |
| 2024 | -S "session successfully restored from ticket" \ |
| 2025 | -S "a session has been resumed" \ |
| 2026 | -C "a session has been resumed" |
| 2027 | |
| 2028 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2029 | "$O_SRV -dtls1" \ |
| 2030 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2031 | 0 \ |
| 2032 | -c "client hello, adding session ticket extension" \ |
| 2033 | -c "found session_ticket extension" \ |
| 2034 | -c "parse new session ticket" \ |
| 2035 | -c "a session has been resumed" |
| 2036 | |
| 2037 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2038 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2039 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2040 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2041 | rm -f $SESSION )" \ |
| 2042 | 0 \ |
| 2043 | -s "found session ticket extension" \ |
| 2044 | -s "server hello, adding session ticket extension" \ |
| 2045 | -S "session successfully restored from cache" \ |
| 2046 | -s "session successfully restored from ticket" \ |
| 2047 | -s "a session has been resumed" |
| 2048 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2049 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2050 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2051 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2052 | "$P_SRV debug_level=3 tickets=0" \ |
| 2053 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2054 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2055 | -c "client hello, adding session ticket extension" \ |
| 2056 | -s "found session ticket extension" \ |
| 2057 | -S "server hello, adding session ticket extension" \ |
| 2058 | -C "found session_ticket extension" \ |
| 2059 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2060 | -s "session successfully restored from cache" \ |
| 2061 | -S "session successfully restored from ticket" \ |
| 2062 | -s "a session has been resumed" \ |
| 2063 | -c "a session has been resumed" |
| 2064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2065 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2066 | "$P_SRV debug_level=3 tickets=1" \ |
| 2067 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2068 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2069 | -C "client hello, adding session ticket extension" \ |
| 2070 | -S "found session ticket extension" \ |
| 2071 | -S "server hello, adding session ticket extension" \ |
| 2072 | -C "found session_ticket extension" \ |
| 2073 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2074 | -s "session successfully restored from cache" \ |
| 2075 | -S "session successfully restored from ticket" \ |
| 2076 | -s "a session has been resumed" \ |
| 2077 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2079 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2080 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2081 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2082 | 0 \ |
| 2083 | -S "session successfully restored from cache" \ |
| 2084 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2085 | -S "a session has been resumed" \ |
| 2086 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2088 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2089 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2090 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2091 | 0 \ |
| 2092 | -s "session successfully restored from cache" \ |
| 2093 | -S "session successfully restored from ticket" \ |
| 2094 | -s "a session has been resumed" \ |
| 2095 | -c "a session has been resumed" |
| 2096 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2097 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2098 | "$P_SRV debug_level=3 tickets=0" \ |
| 2099 | "$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] | 2100 | 0 \ |
| 2101 | -s "session successfully restored from cache" \ |
| 2102 | -S "session successfully restored from ticket" \ |
| 2103 | -s "a session has been resumed" \ |
| 2104 | -c "a session has been resumed" |
| 2105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2106 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2107 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2108 | "$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] | 2109 | 0 \ |
| 2110 | -S "session successfully restored from cache" \ |
| 2111 | -S "session successfully restored from ticket" \ |
| 2112 | -S "a session has been resumed" \ |
| 2113 | -C "a session has been resumed" |
| 2114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2115 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2116 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2117 | "$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] | 2118 | 0 \ |
| 2119 | -s "session successfully restored from cache" \ |
| 2120 | -S "session successfully restored from ticket" \ |
| 2121 | -s "a session has been resumed" \ |
| 2122 | -c "a session has been resumed" |
| 2123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2124 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2125 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2126 | "( $O_CLI -sess_out $SESSION; \ |
| 2127 | $O_CLI -sess_in $SESSION; \ |
| 2128 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2129 | 0 \ |
| 2130 | -s "found session ticket extension" \ |
| 2131 | -S "server hello, adding session ticket extension" \ |
| 2132 | -s "session successfully restored from cache" \ |
| 2133 | -S "session successfully restored from ticket" \ |
| 2134 | -s "a session has been resumed" |
| 2135 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2136 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2137 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2138 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2139 | 0 \ |
| 2140 | -C "found session_ticket extension" \ |
| 2141 | -C "parse new session ticket" \ |
| 2142 | -c "a session has been resumed" |
| 2143 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2144 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2145 | |
| 2146 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2147 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2148 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2149 | 0 \ |
| 2150 | -c "client hello, adding session ticket extension" \ |
| 2151 | -s "found session ticket extension" \ |
| 2152 | -S "server hello, adding session ticket extension" \ |
| 2153 | -C "found session_ticket extension" \ |
| 2154 | -C "parse new session ticket" \ |
| 2155 | -s "session successfully restored from cache" \ |
| 2156 | -S "session successfully restored from ticket" \ |
| 2157 | -s "a session has been resumed" \ |
| 2158 | -c "a session has been resumed" |
| 2159 | |
| 2160 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2161 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2162 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2163 | 0 \ |
| 2164 | -C "client hello, adding session ticket extension" \ |
| 2165 | -S "found session ticket extension" \ |
| 2166 | -S "server hello, adding session ticket extension" \ |
| 2167 | -C "found session_ticket extension" \ |
| 2168 | -C "parse new session ticket" \ |
| 2169 | -s "session successfully restored from cache" \ |
| 2170 | -S "session successfully restored from ticket" \ |
| 2171 | -s "a session has been resumed" \ |
| 2172 | -c "a session has been resumed" |
| 2173 | |
| 2174 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2175 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2176 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2177 | 0 \ |
| 2178 | -S "session successfully restored from cache" \ |
| 2179 | -S "session successfully restored from ticket" \ |
| 2180 | -S "a session has been resumed" \ |
| 2181 | -C "a session has been resumed" |
| 2182 | |
| 2183 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2184 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2185 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2186 | 0 \ |
| 2187 | -s "session successfully restored from cache" \ |
| 2188 | -S "session successfully restored from ticket" \ |
| 2189 | -s "a session has been resumed" \ |
| 2190 | -c "a session has been resumed" |
| 2191 | |
| 2192 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2193 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2194 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2195 | 0 \ |
| 2196 | -s "session successfully restored from cache" \ |
| 2197 | -S "session successfully restored from ticket" \ |
| 2198 | -s "a session has been resumed" \ |
| 2199 | -c "a session has been resumed" |
| 2200 | |
| 2201 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2202 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2203 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2204 | 0 \ |
| 2205 | -S "session successfully restored from cache" \ |
| 2206 | -S "session successfully restored from ticket" \ |
| 2207 | -S "a session has been resumed" \ |
| 2208 | -C "a session has been resumed" |
| 2209 | |
| 2210 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2211 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2212 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2213 | 0 \ |
| 2214 | -s "session successfully restored from cache" \ |
| 2215 | -S "session successfully restored from ticket" \ |
| 2216 | -s "a session has been resumed" \ |
| 2217 | -c "a session has been resumed" |
| 2218 | |
| 2219 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2220 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2221 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2222 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2223 | rm -f $SESSION )" \ |
| 2224 | 0 \ |
| 2225 | -s "found session ticket extension" \ |
| 2226 | -S "server hello, adding session ticket extension" \ |
| 2227 | -s "session successfully restored from cache" \ |
| 2228 | -S "session successfully restored from ticket" \ |
| 2229 | -s "a session has been resumed" |
| 2230 | |
| 2231 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2232 | "$O_SRV -dtls1" \ |
| 2233 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2234 | 0 \ |
| 2235 | -C "found session_ticket extension" \ |
| 2236 | -C "parse new session ticket" \ |
| 2237 | -c "a session has been resumed" |
| 2238 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2239 | # Tests for Max Fragment Length extension |
| 2240 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2241 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2242 | 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] | 2243 | exit 1 |
| 2244 | fi |
| 2245 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2246 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2247 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2248 | fi |
| 2249 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2251 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2252 | "$P_SRV debug_level=3" \ |
| 2253 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2254 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2255 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2256 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2257 | -C "client hello, adding max_fragment_length extension" \ |
| 2258 | -S "found max fragment length extension" \ |
| 2259 | -S "server hello, max_fragment_length extension" \ |
| 2260 | -C "found max_fragment_length extension" |
| 2261 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2263 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2264 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2265 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2266 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2267 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2268 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2269 | -C "client hello, adding max_fragment_length extension" \ |
| 2270 | -S "found max fragment length extension" \ |
| 2271 | -S "server hello, max_fragment_length extension" \ |
| 2272 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2273 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2274 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2275 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2276 | |
| 2277 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2278 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2279 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2280 | "$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] | 2281 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2282 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2283 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2284 | -C "client hello, adding max_fragment_length extension" \ |
| 2285 | -S "found max fragment length extension" \ |
| 2286 | -S "server hello, max_fragment_length extension" \ |
| 2287 | -C "found max_fragment_length extension" \ |
| 2288 | -c "fragment larger than.*maximum " |
| 2289 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2290 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2291 | # (session fragment length will be 16384 regardless of mbedtls |
| 2292 | # content length configuration.) |
| 2293 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2294 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2295 | run_test "Max fragment length: disabled, larger message" \ |
| 2296 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2297 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2298 | 0 \ |
| 2299 | -C "Maximum fragment length is 16384" \ |
| 2300 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2301 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2302 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2303 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2304 | |
| 2305 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2306 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2307 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2308 | "$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] | 2309 | 1 \ |
| 2310 | -C "Maximum fragment length is 16384" \ |
| 2311 | -S "Maximum fragment length is 16384" \ |
| 2312 | -c "fragment larger than.*maximum " |
| 2313 | |
| 2314 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2315 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2316 | "$P_SRV debug_level=3" \ |
| 2317 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2318 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2319 | -c "Maximum fragment length is 4096" \ |
| 2320 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2321 | -c "client hello, adding max_fragment_length extension" \ |
| 2322 | -s "found max fragment length extension" \ |
| 2323 | -s "server hello, max_fragment_length extension" \ |
| 2324 | -c "found max_fragment_length extension" |
| 2325 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2326 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2327 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2328 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2329 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2330 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2331 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2332 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2333 | -C "client hello, adding max_fragment_length extension" \ |
| 2334 | -S "found max fragment length extension" \ |
| 2335 | -S "server hello, max_fragment_length extension" \ |
| 2336 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2337 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2339 | requires_gnutls |
| 2340 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2341 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2342 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2343 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2344 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2345 | -c "client hello, adding max_fragment_length extension" \ |
| 2346 | -c "found max_fragment_length extension" |
| 2347 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2348 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2349 | run_test "Max fragment length: client, message just fits" \ |
| 2350 | "$P_SRV debug_level=3" \ |
| 2351 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2352 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2353 | -c "Maximum fragment length is 2048" \ |
| 2354 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2355 | -c "client hello, adding max_fragment_length extension" \ |
| 2356 | -s "found max fragment length extension" \ |
| 2357 | -s "server hello, max_fragment_length extension" \ |
| 2358 | -c "found max_fragment_length extension" \ |
| 2359 | -c "2048 bytes written in 1 fragments" \ |
| 2360 | -s "2048 bytes read" |
| 2361 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2363 | run_test "Max fragment length: client, larger message" \ |
| 2364 | "$P_SRV debug_level=3" \ |
| 2365 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2366 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2367 | -c "Maximum fragment length is 2048" \ |
| 2368 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2369 | -c "client hello, adding max_fragment_length extension" \ |
| 2370 | -s "found max fragment length extension" \ |
| 2371 | -s "server hello, max_fragment_length extension" \ |
| 2372 | -c "found max_fragment_length extension" \ |
| 2373 | -c "2345 bytes written in 2 fragments" \ |
| 2374 | -s "2048 bytes read" \ |
| 2375 | -s "297 bytes read" |
| 2376 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2378 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2379 | "$P_SRV debug_level=3 dtls=1" \ |
| 2380 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2381 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2382 | -c "Maximum fragment length is 2048" \ |
| 2383 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2384 | -c "client hello, adding max_fragment_length extension" \ |
| 2385 | -s "found max fragment length extension" \ |
| 2386 | -s "server hello, max_fragment_length extension" \ |
| 2387 | -c "found max_fragment_length extension" \ |
| 2388 | -c "fragment larger than.*maximum" |
| 2389 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2390 | # Tests for renegotiation |
| 2391 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2392 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2393 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2394 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2395 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2396 | 0 \ |
| 2397 | -C "client hello, adding renegotiation extension" \ |
| 2398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2399 | -S "found renegotiation extension" \ |
| 2400 | -s "server hello, secure renegotiation extension" \ |
| 2401 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2402 | -C "=> renegotiate" \ |
| 2403 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2404 | -S "write hello request" |
| 2405 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2407 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2408 | "$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] | 2409 | "$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] | 2410 | 0 \ |
| 2411 | -c "client hello, adding renegotiation extension" \ |
| 2412 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2413 | -s "found renegotiation extension" \ |
| 2414 | -s "server hello, secure renegotiation extension" \ |
| 2415 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2416 | -c "=> renegotiate" \ |
| 2417 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2418 | -S "write hello request" |
| 2419 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2421 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2422 | "$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] | 2423 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2424 | 0 \ |
| 2425 | -c "client hello, adding renegotiation extension" \ |
| 2426 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2427 | -s "found renegotiation extension" \ |
| 2428 | -s "server hello, secure renegotiation extension" \ |
| 2429 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2430 | -c "=> renegotiate" \ |
| 2431 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2432 | -s "write hello request" |
| 2433 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2434 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2435 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2436 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2438 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2439 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2440 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2441 | 0 \ |
| 2442 | -c "client hello, adding renegotiation extension" \ |
| 2443 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2444 | -s "found renegotiation extension" \ |
| 2445 | -s "server hello, secure renegotiation extension" \ |
| 2446 | -c "found renegotiation extension" \ |
| 2447 | -c "=> renegotiate" \ |
| 2448 | -s "=> renegotiate" \ |
| 2449 | -S "write hello request" \ |
| 2450 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2451 | |
| 2452 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2453 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2454 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2456 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2457 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2458 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2459 | 0 \ |
| 2460 | -c "client hello, adding renegotiation extension" \ |
| 2461 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2462 | -s "found renegotiation extension" \ |
| 2463 | -s "server hello, secure renegotiation extension" \ |
| 2464 | -c "found renegotiation extension" \ |
| 2465 | -c "=> renegotiate" \ |
| 2466 | -s "=> renegotiate" \ |
| 2467 | -s "write hello request" \ |
| 2468 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2469 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2471 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2472 | "$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] | 2473 | "$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] | 2474 | 0 \ |
| 2475 | -c "client hello, adding renegotiation extension" \ |
| 2476 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2477 | -s "found renegotiation extension" \ |
| 2478 | -s "server hello, secure renegotiation extension" \ |
| 2479 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2480 | -c "=> renegotiate" \ |
| 2481 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2482 | -s "write hello request" |
| 2483 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2485 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2486 | "$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] | 2487 | "$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] | 2488 | 1 \ |
| 2489 | -c "client hello, adding renegotiation extension" \ |
| 2490 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2491 | -S "found renegotiation extension" \ |
| 2492 | -s "server hello, secure renegotiation extension" \ |
| 2493 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2494 | -c "=> renegotiate" \ |
| 2495 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2496 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2497 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2498 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2499 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2501 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2502 | "$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] | 2503 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2504 | 0 \ |
| 2505 | -C "client hello, adding renegotiation extension" \ |
| 2506 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2507 | -S "found renegotiation extension" \ |
| 2508 | -s "server hello, secure renegotiation extension" \ |
| 2509 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2510 | -C "=> renegotiate" \ |
| 2511 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2512 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2513 | -S "SSL - An unexpected message was received from our peer" \ |
| 2514 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2515 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2516 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2517 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2518 | "$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] | 2519 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2520 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2521 | 0 \ |
| 2522 | -C "client hello, adding renegotiation extension" \ |
| 2523 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2524 | -S "found renegotiation extension" \ |
| 2525 | -s "server hello, secure renegotiation extension" \ |
| 2526 | -c "found renegotiation extension" \ |
| 2527 | -C "=> renegotiate" \ |
| 2528 | -S "=> renegotiate" \ |
| 2529 | -s "write hello request" \ |
| 2530 | -S "SSL - An unexpected message was received from our peer" \ |
| 2531 | -S "failed" |
| 2532 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2533 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2535 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2536 | "$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] | 2537 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2538 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2539 | 0 \ |
| 2540 | -C "client hello, adding renegotiation extension" \ |
| 2541 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2542 | -S "found renegotiation extension" \ |
| 2543 | -s "server hello, secure renegotiation extension" \ |
| 2544 | -c "found renegotiation extension" \ |
| 2545 | -C "=> renegotiate" \ |
| 2546 | -S "=> renegotiate" \ |
| 2547 | -s "write hello request" \ |
| 2548 | -S "SSL - An unexpected message was received from our peer" \ |
| 2549 | -S "failed" |
| 2550 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2552 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2553 | "$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] | 2554 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2555 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2556 | 0 \ |
| 2557 | -C "client hello, adding renegotiation extension" \ |
| 2558 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2559 | -S "found renegotiation extension" \ |
| 2560 | -s "server hello, secure renegotiation extension" \ |
| 2561 | -c "found renegotiation extension" \ |
| 2562 | -C "=> renegotiate" \ |
| 2563 | -S "=> renegotiate" \ |
| 2564 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2565 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2566 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2568 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2569 | "$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] | 2570 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2571 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2572 | 0 \ |
| 2573 | -c "client hello, adding renegotiation extension" \ |
| 2574 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2575 | -s "found renegotiation extension" \ |
| 2576 | -s "server hello, secure renegotiation extension" \ |
| 2577 | -c "found renegotiation extension" \ |
| 2578 | -c "=> renegotiate" \ |
| 2579 | -s "=> renegotiate" \ |
| 2580 | -s "write hello request" \ |
| 2581 | -S "SSL - An unexpected message was received from our peer" \ |
| 2582 | -S "failed" |
| 2583 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2584 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2585 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2586 | "$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] | 2587 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2588 | 0 \ |
| 2589 | -C "client hello, adding renegotiation extension" \ |
| 2590 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2591 | -S "found renegotiation extension" \ |
| 2592 | -s "server hello, secure renegotiation extension" \ |
| 2593 | -c "found renegotiation extension" \ |
| 2594 | -S "record counter limit reached: renegotiate" \ |
| 2595 | -C "=> renegotiate" \ |
| 2596 | -S "=> renegotiate" \ |
| 2597 | -S "write hello request" \ |
| 2598 | -S "SSL - An unexpected message was received from our peer" \ |
| 2599 | -S "failed" |
| 2600 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2601 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2603 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2604 | "$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] | 2605 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2606 | 0 \ |
| 2607 | -c "client hello, adding renegotiation extension" \ |
| 2608 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2609 | -s "found renegotiation extension" \ |
| 2610 | -s "server hello, secure renegotiation extension" \ |
| 2611 | -c "found renegotiation extension" \ |
| 2612 | -s "record counter limit reached: renegotiate" \ |
| 2613 | -c "=> renegotiate" \ |
| 2614 | -s "=> renegotiate" \ |
| 2615 | -s "write hello request" \ |
| 2616 | -S "SSL - An unexpected message was received from our peer" \ |
| 2617 | -S "failed" |
| 2618 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2619 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2620 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2621 | "$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] | 2622 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2623 | 0 \ |
| 2624 | -c "client hello, adding renegotiation extension" \ |
| 2625 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2626 | -s "found renegotiation extension" \ |
| 2627 | -s "server hello, secure renegotiation extension" \ |
| 2628 | -c "found renegotiation extension" \ |
| 2629 | -s "record counter limit reached: renegotiate" \ |
| 2630 | -c "=> renegotiate" \ |
| 2631 | -s "=> renegotiate" \ |
| 2632 | -s "write hello request" \ |
| 2633 | -S "SSL - An unexpected message was received from our peer" \ |
| 2634 | -S "failed" |
| 2635 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2636 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2637 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2638 | "$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] | 2639 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2640 | 0 \ |
| 2641 | -C "client hello, adding renegotiation extension" \ |
| 2642 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2643 | -S "found renegotiation extension" \ |
| 2644 | -s "server hello, secure renegotiation extension" \ |
| 2645 | -c "found renegotiation extension" \ |
| 2646 | -S "record counter limit reached: renegotiate" \ |
| 2647 | -C "=> renegotiate" \ |
| 2648 | -S "=> renegotiate" \ |
| 2649 | -S "write hello request" \ |
| 2650 | -S "SSL - An unexpected message was received from our peer" \ |
| 2651 | -S "failed" |
| 2652 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2653 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2654 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2655 | "$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] | 2656 | "$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] | 2657 | 0 \ |
| 2658 | -c "client hello, adding renegotiation extension" \ |
| 2659 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2660 | -s "found renegotiation extension" \ |
| 2661 | -s "server hello, secure renegotiation extension" \ |
| 2662 | -c "found renegotiation extension" \ |
| 2663 | -c "=> renegotiate" \ |
| 2664 | -s "=> renegotiate" \ |
| 2665 | -S "write hello request" |
| 2666 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2668 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2669 | "$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] | 2670 | "$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] | 2671 | 0 \ |
| 2672 | -c "client hello, adding renegotiation extension" \ |
| 2673 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2674 | -s "found renegotiation extension" \ |
| 2675 | -s "server hello, secure renegotiation extension" \ |
| 2676 | -c "found renegotiation extension" \ |
| 2677 | -c "=> renegotiate" \ |
| 2678 | -s "=> renegotiate" \ |
| 2679 | -s "write hello request" |
| 2680 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2682 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2683 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2684 | "$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] | 2685 | 0 \ |
| 2686 | -c "client hello, adding renegotiation extension" \ |
| 2687 | -c "found renegotiation extension" \ |
| 2688 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2689 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2690 | -C "error" \ |
| 2691 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2692 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2693 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2695 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2696 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2697 | "$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] | 2698 | 0 \ |
| 2699 | -c "client hello, adding renegotiation extension" \ |
| 2700 | -c "found renegotiation extension" \ |
| 2701 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2702 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2703 | -C "error" \ |
| 2704 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2705 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2706 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2707 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2708 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2709 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2710 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2711 | 1 \ |
| 2712 | -c "client hello, adding renegotiation extension" \ |
| 2713 | -C "found renegotiation extension" \ |
| 2714 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2715 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2716 | -c "error" \ |
| 2717 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2718 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2719 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2721 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2722 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2723 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2724 | allow_legacy=0" \ |
| 2725 | 1 \ |
| 2726 | -c "client hello, adding renegotiation extension" \ |
| 2727 | -C "found renegotiation extension" \ |
| 2728 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2729 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2730 | -c "error" \ |
| 2731 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2732 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2733 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2734 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2735 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2736 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2737 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2738 | allow_legacy=1" \ |
| 2739 | 0 \ |
| 2740 | -c "client hello, adding renegotiation extension" \ |
| 2741 | -C "found renegotiation extension" \ |
| 2742 | -c "=> renegotiate" \ |
| 2743 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2744 | -C "error" \ |
| 2745 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2746 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2747 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2748 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2749 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2750 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2751 | 0 \ |
| 2752 | -c "client hello, adding renegotiation extension" \ |
| 2753 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2754 | -s "found renegotiation extension" \ |
| 2755 | -s "server hello, secure renegotiation extension" \ |
| 2756 | -c "found renegotiation extension" \ |
| 2757 | -c "=> renegotiate" \ |
| 2758 | -s "=> renegotiate" \ |
| 2759 | -S "write hello request" |
| 2760 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2761 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2762 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2763 | "$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] | 2764 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2765 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2766 | 0 \ |
| 2767 | -c "client hello, adding renegotiation extension" \ |
| 2768 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2769 | -s "found renegotiation extension" \ |
| 2770 | -s "server hello, secure renegotiation extension" \ |
| 2771 | -c "found renegotiation extension" \ |
| 2772 | -c "=> renegotiate" \ |
| 2773 | -s "=> renegotiate" \ |
| 2774 | -s "write hello request" |
| 2775 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2776 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2777 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2778 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2779 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2780 | 0 \ |
| 2781 | -c "client hello, adding renegotiation extension" \ |
| 2782 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2783 | -s "found renegotiation extension" \ |
| 2784 | -s "server hello, secure renegotiation extension" \ |
| 2785 | -s "record counter limit reached: renegotiate" \ |
| 2786 | -c "=> renegotiate" \ |
| 2787 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2788 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2789 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2790 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2791 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2792 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2793 | "$G_SRV -u --mtu 4096" \ |
| 2794 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2795 | 0 \ |
| 2796 | -c "client hello, adding renegotiation extension" \ |
| 2797 | -c "found renegotiation extension" \ |
| 2798 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2799 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2800 | -C "error" \ |
| 2801 | -s "Extra-header:" |
| 2802 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2803 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2804 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2805 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2806 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2807 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2808 | "$P_CLI debug_level=3" \ |
| 2809 | 0 \ |
| 2810 | -c "found renegotiation extension" \ |
| 2811 | -C "error" \ |
| 2812 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2813 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2814 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2815 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2816 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2817 | "$P_CLI debug_level=3" \ |
| 2818 | 0 \ |
| 2819 | -C "found renegotiation extension" \ |
| 2820 | -C "error" \ |
| 2821 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2822 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2823 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2824 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2825 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2826 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2827 | 1 \ |
| 2828 | -C "found renegotiation extension" \ |
| 2829 | -c "error" \ |
| 2830 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2831 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2832 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2833 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2834 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2835 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2836 | 0 \ |
| 2837 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2838 | -s "server hello, secure renegotiation extension" |
| 2839 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2840 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2841 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2842 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2843 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2844 | 0 \ |
| 2845 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2846 | -S "server hello, secure renegotiation extension" |
| 2847 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2848 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2849 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2850 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2851 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2852 | 1 \ |
| 2853 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2854 | -S "server hello, secure renegotiation extension" |
| 2855 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2856 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2857 | |
| 2858 | requires_gnutls |
| 2859 | run_test "DER format: no trailing bytes" \ |
| 2860 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2861 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2862 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2863 | 0 \ |
| 2864 | -c "Handshake was completed" \ |
| 2865 | |
| 2866 | requires_gnutls |
| 2867 | run_test "DER format: with a trailing zero byte" \ |
| 2868 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2869 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2870 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2871 | 0 \ |
| 2872 | -c "Handshake was completed" \ |
| 2873 | |
| 2874 | requires_gnutls |
| 2875 | run_test "DER format: with a trailing random byte" \ |
| 2876 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2877 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2878 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2879 | 0 \ |
| 2880 | -c "Handshake was completed" \ |
| 2881 | |
| 2882 | requires_gnutls |
| 2883 | run_test "DER format: with 2 trailing random bytes" \ |
| 2884 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2885 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2886 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2887 | 0 \ |
| 2888 | -c "Handshake was completed" \ |
| 2889 | |
| 2890 | requires_gnutls |
| 2891 | run_test "DER format: with 4 trailing random bytes" \ |
| 2892 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2893 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2894 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2895 | 0 \ |
| 2896 | -c "Handshake was completed" \ |
| 2897 | |
| 2898 | requires_gnutls |
| 2899 | run_test "DER format: with 8 trailing random bytes" \ |
| 2900 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2901 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2902 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2903 | 0 \ |
| 2904 | -c "Handshake was completed" \ |
| 2905 | |
| 2906 | requires_gnutls |
| 2907 | run_test "DER format: with 9 trailing random bytes" \ |
| 2908 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2909 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2910 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2911 | 0 \ |
| 2912 | -c "Handshake was completed" \ |
| 2913 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 2914 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 2915 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2916 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2917 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2918 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2919 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2920 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2921 | 1 \ |
| 2922 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2923 | -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] | 2924 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2925 | -c "X509 - Certificate verification failed" |
| 2926 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2927 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2928 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2929 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2931 | 0 \ |
| 2932 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2933 | -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] | 2934 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2935 | -C "X509 - Certificate verification failed" |
| 2936 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2937 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2938 | "$P_SRV" \ |
| 2939 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2940 | 0 \ |
| 2941 | -c "x509_verify_cert() returned" \ |
| 2942 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2943 | -c "! Certificate verification flags"\ |
| 2944 | -C "! mbedtls_ssl_handshake returned" \ |
| 2945 | -C "X509 - Certificate verification failed" \ |
| 2946 | -C "SSL - No CA Chain is set, but required to operate" |
| 2947 | |
| 2948 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2949 | "$P_SRV" \ |
| 2950 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2951 | 1 \ |
| 2952 | -c "x509_verify_cert() returned" \ |
| 2953 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2954 | -c "! Certificate verification flags"\ |
| 2955 | -c "! mbedtls_ssl_handshake returned" \ |
| 2956 | -c "SSL - No CA Chain is set, but required to operate" |
| 2957 | |
| 2958 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2959 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2960 | # the client informs the server about the supported curves - it does, though, in the |
| 2961 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2962 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2963 | # different means to have the server ignoring the client's supported curve list. |
| 2964 | |
| 2965 | requires_config_enabled MBEDTLS_ECP_C |
| 2966 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2967 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2968 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2969 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2970 | 1 \ |
| 2971 | -c "bad certificate (EC key curve)"\ |
| 2972 | -c "! Certificate verification flags"\ |
| 2973 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2974 | |
| 2975 | requires_config_enabled MBEDTLS_ECP_C |
| 2976 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2977 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2978 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2979 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2980 | 1 \ |
| 2981 | -c "bad certificate (EC key curve)"\ |
| 2982 | -c "! Certificate verification flags"\ |
| 2983 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2984 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2985 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2986 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2987 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2988 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2989 | 0 \ |
| 2990 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2991 | -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] | 2992 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2993 | -C "X509 - Certificate verification failed" |
| 2994 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2995 | run_test "Authentication: client SHA256, server required" \ |
| 2996 | "$P_SRV auth_mode=required" \ |
| 2997 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2998 | key_file=data_files/server6.key \ |
| 2999 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3000 | 0 \ |
| 3001 | -c "Supported Signature Algorithm found: 4," \ |
| 3002 | -c "Supported Signature Algorithm found: 5," |
| 3003 | |
| 3004 | run_test "Authentication: client SHA384, server required" \ |
| 3005 | "$P_SRV auth_mode=required" \ |
| 3006 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3007 | key_file=data_files/server6.key \ |
| 3008 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3009 | 0 \ |
| 3010 | -c "Supported Signature Algorithm found: 4," \ |
| 3011 | -c "Supported Signature Algorithm found: 5," |
| 3012 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3013 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3014 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3015 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3016 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3017 | key_file=data_files/server5.key" \ |
| 3018 | 1 \ |
| 3019 | -S "skip write certificate request" \ |
| 3020 | -C "skip parse certificate request" \ |
| 3021 | -c "got a certificate request" \ |
| 3022 | -c "got no certificate to send" \ |
| 3023 | -S "x509_verify_cert() returned" \ |
| 3024 | -s "client has no certificate" \ |
| 3025 | -s "! mbedtls_ssl_handshake returned" \ |
| 3026 | -c "! mbedtls_ssl_handshake returned" \ |
| 3027 | -s "No client certification received from the client, but required by the authentication mode" |
| 3028 | |
| 3029 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3030 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3031 | "$P_CLI debug_level=3 crt_file=none \ |
| 3032 | key_file=data_files/server5.key" \ |
| 3033 | 1 \ |
| 3034 | -S "skip write certificate request" \ |
| 3035 | -C "skip parse certificate request" \ |
| 3036 | -c "got a certificate request" \ |
| 3037 | -c "= write certificate$" \ |
| 3038 | -C "skip write certificate$" \ |
| 3039 | -S "x509_verify_cert() returned" \ |
| 3040 | -s "client has no certificate" \ |
| 3041 | -s "! mbedtls_ssl_handshake returned" \ |
| 3042 | -c "! mbedtls_ssl_handshake returned" \ |
| 3043 | -s "No client certification received from the client, but required by the authentication mode" |
| 3044 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3045 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3046 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3047 | "$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] | 3048 | key_file=data_files/server5.key" \ |
| 3049 | 1 \ |
| 3050 | -S "skip write certificate request" \ |
| 3051 | -C "skip parse certificate request" \ |
| 3052 | -c "got a certificate request" \ |
| 3053 | -C "skip write certificate" \ |
| 3054 | -C "skip write certificate verify" \ |
| 3055 | -S "skip parse certificate verify" \ |
| 3056 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3057 | -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] | 3058 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3059 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3060 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3061 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3062 | # We don't check that the client receives the alert because it might |
| 3063 | # detect that its write end of the connection is closed and abort |
| 3064 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3065 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3066 | run_test "Authentication: client cert not trusted, server required" \ |
| 3067 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3068 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3069 | key_file=data_files/server5.key" \ |
| 3070 | 1 \ |
| 3071 | -S "skip write certificate request" \ |
| 3072 | -C "skip parse certificate request" \ |
| 3073 | -c "got a certificate request" \ |
| 3074 | -C "skip write certificate" \ |
| 3075 | -C "skip write certificate verify" \ |
| 3076 | -S "skip parse certificate verify" \ |
| 3077 | -s "x509_verify_cert() returned" \ |
| 3078 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3079 | -s "! mbedtls_ssl_handshake returned" \ |
| 3080 | -c "! mbedtls_ssl_handshake returned" \ |
| 3081 | -s "X509 - Certificate verification failed" |
| 3082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3083 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3084 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3085 | "$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] | 3086 | key_file=data_files/server5.key" \ |
| 3087 | 0 \ |
| 3088 | -S "skip write certificate request" \ |
| 3089 | -C "skip parse certificate request" \ |
| 3090 | -c "got a certificate request" \ |
| 3091 | -C "skip write certificate" \ |
| 3092 | -C "skip write certificate verify" \ |
| 3093 | -S "skip parse certificate verify" \ |
| 3094 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3095 | -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] | 3096 | -S "! mbedtls_ssl_handshake returned" \ |
| 3097 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3098 | -S "X509 - Certificate verification failed" |
| 3099 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3100 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3101 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3102 | "$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] | 3103 | key_file=data_files/server5.key" \ |
| 3104 | 0 \ |
| 3105 | -s "skip write certificate request" \ |
| 3106 | -C "skip parse certificate request" \ |
| 3107 | -c "got no certificate request" \ |
| 3108 | -c "skip write certificate" \ |
| 3109 | -c "skip write certificate verify" \ |
| 3110 | -s "skip parse certificate verify" \ |
| 3111 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3112 | -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] | 3113 | -S "! mbedtls_ssl_handshake returned" \ |
| 3114 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3115 | -S "X509 - Certificate verification failed" |
| 3116 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3117 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3118 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3119 | "$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] | 3120 | 0 \ |
| 3121 | -S "skip write certificate request" \ |
| 3122 | -C "skip parse certificate request" \ |
| 3123 | -c "got a certificate request" \ |
| 3124 | -C "skip write certificate$" \ |
| 3125 | -C "got no certificate to send" \ |
| 3126 | -S "SSLv3 client has no certificate" \ |
| 3127 | -c "skip write certificate verify" \ |
| 3128 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3129 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3130 | -S "! mbedtls_ssl_handshake returned" \ |
| 3131 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3132 | -S "X509 - Certificate verification failed" |
| 3133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3135 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3136 | "$O_CLI" \ |
| 3137 | 0 \ |
| 3138 | -S "skip write certificate request" \ |
| 3139 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3140 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3141 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3142 | -S "X509 - Certificate verification failed" |
| 3143 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3144 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3145 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3146 | "$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] | 3147 | 0 \ |
| 3148 | -C "skip parse certificate request" \ |
| 3149 | -c "got a certificate request" \ |
| 3150 | -C "skip write certificate$" \ |
| 3151 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3152 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3153 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3154 | run_test "Authentication: client no cert, openssl server required" \ |
| 3155 | "$O_SRV -Verify 10" \ |
| 3156 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3157 | 1 \ |
| 3158 | -C "skip parse certificate request" \ |
| 3159 | -c "got a certificate request" \ |
| 3160 | -C "skip write certificate$" \ |
| 3161 | -c "skip write certificate verify" \ |
| 3162 | -c "! mbedtls_ssl_handshake returned" |
| 3163 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3164 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3165 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3166 | "$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] | 3167 | "$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] | 3168 | 0 \ |
| 3169 | -S "skip write certificate request" \ |
| 3170 | -C "skip parse certificate request" \ |
| 3171 | -c "got a certificate request" \ |
| 3172 | -C "skip write certificate$" \ |
| 3173 | -c "skip write certificate verify" \ |
| 3174 | -c "got no certificate to send" \ |
| 3175 | -s "SSLv3 client has no certificate" \ |
| 3176 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3177 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3178 | -S "! mbedtls_ssl_handshake returned" \ |
| 3179 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3180 | -S "X509 - Certificate verification failed" |
| 3181 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3182 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3183 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3184 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3185 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3186 | 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] | 3187 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3188 | 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] | 3189 | 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] | 3190 | 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] | 3191 | printf "test value of ${MAX_IM_CA}. \n" |
| 3192 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3193 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3194 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3195 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3196 | |
| 3197 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3198 | fi |
| 3199 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3200 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3201 | run_test "Authentication: server max_int chain, client default" \ |
| 3202 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3203 | key_file=data_files/dir-maxpath/09.key" \ |
| 3204 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3205 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3206 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3207 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3208 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3209 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3210 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3211 | key_file=data_files/dir-maxpath/10.key" \ |
| 3212 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3213 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3214 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3215 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3216 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3217 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3218 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3219 | key_file=data_files/dir-maxpath/10.key" \ |
| 3220 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3221 | auth_mode=optional" \ |
| 3222 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3223 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3224 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3225 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3226 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3227 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3228 | key_file=data_files/dir-maxpath/10.key" \ |
| 3229 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3230 | auth_mode=none" \ |
| 3231 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3232 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3233 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3234 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3235 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3236 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3237 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3238 | key_file=data_files/dir-maxpath/10.key" \ |
| 3239 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3240 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3241 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3242 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3243 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3244 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3245 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3246 | key_file=data_files/dir-maxpath/10.key" \ |
| 3247 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3248 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3249 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3250 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3251 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3252 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3253 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3254 | key_file=data_files/dir-maxpath/10.key" \ |
| 3255 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3256 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3257 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3258 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3259 | run_test "Authentication: client max_int chain, server required" \ |
| 3260 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3261 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3262 | key_file=data_files/dir-maxpath/09.key" \ |
| 3263 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3264 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3265 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3266 | # Tests for CA list in CertificateRequest messages |
| 3267 | |
| 3268 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3269 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3270 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3271 | key_file=data_files/server6.key" \ |
| 3272 | 0 \ |
| 3273 | -s "requested DN" |
| 3274 | |
| 3275 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3276 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3277 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3278 | key_file=data_files/server6.key" \ |
| 3279 | 0 \ |
| 3280 | -S "requested DN" |
| 3281 | |
| 3282 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3283 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3284 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3285 | key_file=data_files/server5.key" \ |
| 3286 | 1 \ |
| 3287 | -S "requested DN" \ |
| 3288 | -s "x509_verify_cert() returned" \ |
| 3289 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3290 | -s "! mbedtls_ssl_handshake returned" \ |
| 3291 | -c "! mbedtls_ssl_handshake returned" \ |
| 3292 | -s "X509 - Certificate verification failed" |
| 3293 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3294 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3295 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3296 | |
| 3297 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3298 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3299 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3300 | key_file=data_files/server5.key" \ |
| 3301 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3302 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3303 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3304 | -c "x509_verify_cert() returned" \ |
| 3305 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3306 | -c "! mbedtls_ssl_handshake returned" \ |
| 3307 | -c "X509 - Certificate verification failed" |
| 3308 | |
| 3309 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3310 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3311 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3312 | key_file=data_files/server5.key" \ |
| 3313 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3314 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3315 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3316 | -c "x509_verify_cert() returned" \ |
| 3317 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3318 | -C "! mbedtls_ssl_handshake returned" \ |
| 3319 | -C "X509 - Certificate verification failed" |
| 3320 | |
| 3321 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3322 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3323 | # the client informs the server about the supported curves - it does, though, in the |
| 3324 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3325 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3326 | # different means to have the server ignoring the client's supported curve list. |
| 3327 | |
| 3328 | requires_config_enabled MBEDTLS_ECP_C |
| 3329 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3330 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3331 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3332 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3333 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3334 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3335 | -c "use CA callback for X.509 CRT verification" \ |
| 3336 | -c "bad certificate (EC key curve)" \ |
| 3337 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3338 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3339 | |
| 3340 | requires_config_enabled MBEDTLS_ECP_C |
| 3341 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3342 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3343 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3344 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3345 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3346 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3347 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3348 | -c "bad certificate (EC key curve)"\ |
| 3349 | -c "! Certificate verification flags"\ |
| 3350 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3351 | |
| 3352 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3353 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 3354 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3355 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3356 | key_file=data_files/server6.key \ |
| 3357 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3358 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3359 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3360 | -c "Supported Signature Algorithm found: 4," \ |
| 3361 | -c "Supported Signature Algorithm found: 5," |
| 3362 | |
| 3363 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3364 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 3365 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3366 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3367 | key_file=data_files/server6.key \ |
| 3368 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3369 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3370 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3371 | -c "Supported Signature Algorithm found: 4," \ |
| 3372 | -c "Supported Signature Algorithm found: 5," |
| 3373 | |
| 3374 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3375 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 3376 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3377 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3378 | key_file=data_files/server5.key" \ |
| 3379 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3380 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3381 | -S "skip write certificate request" \ |
| 3382 | -C "skip parse certificate request" \ |
| 3383 | -c "got a certificate request" \ |
| 3384 | -C "skip write certificate" \ |
| 3385 | -C "skip write certificate verify" \ |
| 3386 | -S "skip parse certificate verify" \ |
| 3387 | -s "x509_verify_cert() returned" \ |
| 3388 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3389 | -s "! mbedtls_ssl_handshake returned" \ |
| 3390 | -s "send alert level=2 message=48" \ |
| 3391 | -c "! mbedtls_ssl_handshake returned" \ |
| 3392 | -s "X509 - Certificate verification failed" |
| 3393 | # We don't check that the client receives the alert because it might |
| 3394 | # detect that its write end of the connection is closed and abort |
| 3395 | # before reading the alert message. |
| 3396 | |
| 3397 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3398 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 3399 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3400 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3401 | key_file=data_files/server5.key" \ |
| 3402 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3403 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3404 | -S "skip write certificate request" \ |
| 3405 | -C "skip parse certificate request" \ |
| 3406 | -c "got a certificate request" \ |
| 3407 | -C "skip write certificate" \ |
| 3408 | -C "skip write certificate verify" \ |
| 3409 | -S "skip parse certificate verify" \ |
| 3410 | -s "x509_verify_cert() returned" \ |
| 3411 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3412 | -s "! mbedtls_ssl_handshake returned" \ |
| 3413 | -c "! mbedtls_ssl_handshake returned" \ |
| 3414 | -s "X509 - Certificate verification failed" |
| 3415 | |
| 3416 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3417 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 3418 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3419 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3420 | key_file=data_files/server5.key" \ |
| 3421 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3422 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3423 | -S "skip write certificate request" \ |
| 3424 | -C "skip parse certificate request" \ |
| 3425 | -c "got a certificate request" \ |
| 3426 | -C "skip write certificate" \ |
| 3427 | -C "skip write certificate verify" \ |
| 3428 | -S "skip parse certificate verify" \ |
| 3429 | -s "x509_verify_cert() returned" \ |
| 3430 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3431 | -S "! mbedtls_ssl_handshake returned" \ |
| 3432 | -C "! mbedtls_ssl_handshake returned" \ |
| 3433 | -S "X509 - Certificate verification failed" |
| 3434 | |
| 3435 | requires_full_size_output_buffer |
| 3436 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3437 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 3438 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3439 | key_file=data_files/dir-maxpath/09.key" \ |
| 3440 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3441 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3442 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3443 | -C "X509 - A fatal error occurred" |
| 3444 | |
| 3445 | requires_full_size_output_buffer |
| 3446 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3447 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 3448 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3449 | key_file=data_files/dir-maxpath/10.key" \ |
| 3450 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3451 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3452 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3453 | -c "X509 - A fatal error occurred" |
| 3454 | |
| 3455 | requires_full_size_output_buffer |
| 3456 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3457 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 3458 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3459 | key_file=data_files/dir-maxpath/10.key" \ |
| 3460 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3461 | debug_level=3 auth_mode=optional" \ |
| 3462 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3463 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3464 | -c "X509 - A fatal error occurred" |
| 3465 | |
| 3466 | requires_full_size_output_buffer |
| 3467 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3468 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 3469 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3470 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3471 | key_file=data_files/dir-maxpath/10.key" \ |
| 3472 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3473 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3474 | -s "X509 - A fatal error occurred" |
| 3475 | |
| 3476 | requires_full_size_output_buffer |
| 3477 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3478 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 3479 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3480 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3481 | key_file=data_files/dir-maxpath/10.key" \ |
| 3482 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3483 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3484 | -s "X509 - A fatal error occurred" |
| 3485 | |
| 3486 | requires_full_size_output_buffer |
| 3487 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3488 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 3489 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3490 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3491 | key_file=data_files/dir-maxpath/09.key" \ |
| 3492 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3493 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3494 | -S "X509 - A fatal error occurred" |
| 3495 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3496 | # Tests for certificate selection based on SHA verson |
| 3497 | |
| 3498 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3499 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3500 | key_file=data_files/server5.key \ |
| 3501 | crt_file2=data_files/server5-sha1.crt \ |
| 3502 | key_file2=data_files/server5.key" \ |
| 3503 | "$P_CLI force_version=tls1_2" \ |
| 3504 | 0 \ |
| 3505 | -c "signed using.*ECDSA with SHA256" \ |
| 3506 | -C "signed using.*ECDSA with SHA1" |
| 3507 | |
| 3508 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3509 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3510 | key_file=data_files/server5.key \ |
| 3511 | crt_file2=data_files/server5-sha1.crt \ |
| 3512 | key_file2=data_files/server5.key" \ |
| 3513 | "$P_CLI force_version=tls1_1" \ |
| 3514 | 0 \ |
| 3515 | -C "signed using.*ECDSA with SHA256" \ |
| 3516 | -c "signed using.*ECDSA with SHA1" |
| 3517 | |
| 3518 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3519 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3520 | key_file=data_files/server5.key \ |
| 3521 | crt_file2=data_files/server5-sha1.crt \ |
| 3522 | key_file2=data_files/server5.key" \ |
| 3523 | "$P_CLI force_version=tls1" \ |
| 3524 | 0 \ |
| 3525 | -C "signed using.*ECDSA with SHA256" \ |
| 3526 | -c "signed using.*ECDSA with SHA1" |
| 3527 | |
| 3528 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3529 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3530 | key_file=data_files/server5.key \ |
| 3531 | crt_file2=data_files/server6.crt \ |
| 3532 | key_file2=data_files/server6.key" \ |
| 3533 | "$P_CLI force_version=tls1_1" \ |
| 3534 | 0 \ |
| 3535 | -c "serial number.*09" \ |
| 3536 | -c "signed using.*ECDSA with SHA256" \ |
| 3537 | -C "signed using.*ECDSA with SHA1" |
| 3538 | |
| 3539 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3540 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3541 | key_file=data_files/server6.key \ |
| 3542 | crt_file2=data_files/server5.crt \ |
| 3543 | key_file2=data_files/server5.key" \ |
| 3544 | "$P_CLI force_version=tls1_1" \ |
| 3545 | 0 \ |
| 3546 | -c "serial number.*0A" \ |
| 3547 | -c "signed using.*ECDSA with SHA256" \ |
| 3548 | -C "signed using.*ECDSA with SHA1" |
| 3549 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3550 | # tests for SNI |
| 3551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3552 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3553 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3554 | 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] | 3555 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3556 | 0 \ |
| 3557 | -S "parse ServerName extension" \ |
| 3558 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3559 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3561 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3562 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3563 | 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] | 3564 | 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] | 3565 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3566 | 0 \ |
| 3567 | -s "parse ServerName extension" \ |
| 3568 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3569 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3570 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3571 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3572 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3573 | 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] | 3574 | 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] | 3575 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3576 | 0 \ |
| 3577 | -s "parse ServerName extension" \ |
| 3578 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3579 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3581 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3582 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3583 | 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] | 3584 | 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] | 3585 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3586 | 1 \ |
| 3587 | -s "parse ServerName extension" \ |
| 3588 | -s "ssl_sni_wrapper() returned" \ |
| 3589 | -s "mbedtls_ssl_handshake returned" \ |
| 3590 | -c "mbedtls_ssl_handshake returned" \ |
| 3591 | -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] | 3592 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3593 | run_test "SNI: client auth no override: optional" \ |
| 3594 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3595 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3596 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3597 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3598 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3599 | -S "skip write certificate request" \ |
| 3600 | -C "skip parse certificate request" \ |
| 3601 | -c "got a certificate request" \ |
| 3602 | -C "skip write certificate" \ |
| 3603 | -C "skip write certificate verify" \ |
| 3604 | -S "skip parse certificate verify" |
| 3605 | |
| 3606 | run_test "SNI: client auth override: none -> optional" \ |
| 3607 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3608 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3609 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3610 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3611 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3612 | -S "skip write certificate request" \ |
| 3613 | -C "skip parse certificate request" \ |
| 3614 | -c "got a certificate request" \ |
| 3615 | -C "skip write certificate" \ |
| 3616 | -C "skip write certificate verify" \ |
| 3617 | -S "skip parse certificate verify" |
| 3618 | |
| 3619 | run_test "SNI: client auth override: optional -> none" \ |
| 3620 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3621 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3622 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3623 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3624 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3625 | -s "skip write certificate request" \ |
| 3626 | -C "skip parse certificate request" \ |
| 3627 | -c "got no certificate request" \ |
| 3628 | -c "skip write certificate" \ |
| 3629 | -c "skip write certificate verify" \ |
| 3630 | -s "skip parse certificate verify" |
| 3631 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3632 | run_test "SNI: CA no override" \ |
| 3633 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3634 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3635 | ca_file=data_files/test-ca.crt \ |
| 3636 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3637 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3638 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3639 | 1 \ |
| 3640 | -S "skip write certificate request" \ |
| 3641 | -C "skip parse certificate request" \ |
| 3642 | -c "got a certificate request" \ |
| 3643 | -C "skip write certificate" \ |
| 3644 | -C "skip write certificate verify" \ |
| 3645 | -S "skip parse certificate verify" \ |
| 3646 | -s "x509_verify_cert() returned" \ |
| 3647 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3648 | -S "The certificate has been revoked (is on a CRL)" |
| 3649 | |
| 3650 | run_test "SNI: CA override" \ |
| 3651 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3652 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3653 | ca_file=data_files/test-ca.crt \ |
| 3654 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3655 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3656 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3657 | 0 \ |
| 3658 | -S "skip write certificate request" \ |
| 3659 | -C "skip parse certificate request" \ |
| 3660 | -c "got a certificate request" \ |
| 3661 | -C "skip write certificate" \ |
| 3662 | -C "skip write certificate verify" \ |
| 3663 | -S "skip parse certificate verify" \ |
| 3664 | -S "x509_verify_cert() returned" \ |
| 3665 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3666 | -S "The certificate has been revoked (is on a CRL)" |
| 3667 | |
| 3668 | run_test "SNI: CA override with CRL" \ |
| 3669 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3670 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3671 | ca_file=data_files/test-ca.crt \ |
| 3672 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3673 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3674 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3675 | 1 \ |
| 3676 | -S "skip write certificate request" \ |
| 3677 | -C "skip parse certificate request" \ |
| 3678 | -c "got a certificate request" \ |
| 3679 | -C "skip write certificate" \ |
| 3680 | -C "skip write certificate verify" \ |
| 3681 | -S "skip parse certificate verify" \ |
| 3682 | -s "x509_verify_cert() returned" \ |
| 3683 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3684 | -s "The certificate has been revoked (is on a CRL)" |
| 3685 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3686 | # Tests for SNI and DTLS |
| 3687 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3688 | run_test "SNI: DTLS, no SNI callback" \ |
| 3689 | "$P_SRV debug_level=3 dtls=1 \ |
| 3690 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3691 | "$P_CLI server_name=localhost dtls=1" \ |
| 3692 | 0 \ |
| 3693 | -S "parse ServerName extension" \ |
| 3694 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3695 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3696 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3697 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3698 | "$P_SRV debug_level=3 dtls=1 \ |
| 3699 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3700 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3701 | "$P_CLI server_name=localhost dtls=1" \ |
| 3702 | 0 \ |
| 3703 | -s "parse ServerName extension" \ |
| 3704 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3705 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3706 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3707 | run_test "SNI: DTLS, matching cert 2" \ |
| 3708 | "$P_SRV debug_level=3 dtls=1 \ |
| 3709 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3710 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3711 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3712 | 0 \ |
| 3713 | -s "parse ServerName extension" \ |
| 3714 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3715 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3716 | |
| 3717 | run_test "SNI: DTLS, no matching cert" \ |
| 3718 | "$P_SRV debug_level=3 dtls=1 \ |
| 3719 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3720 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3721 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3722 | 1 \ |
| 3723 | -s "parse ServerName extension" \ |
| 3724 | -s "ssl_sni_wrapper() returned" \ |
| 3725 | -s "mbedtls_ssl_handshake returned" \ |
| 3726 | -c "mbedtls_ssl_handshake returned" \ |
| 3727 | -c "SSL - A fatal alert message was received from our peer" |
| 3728 | |
| 3729 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3730 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3731 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3732 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3733 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3734 | 0 \ |
| 3735 | -S "skip write certificate request" \ |
| 3736 | -C "skip parse certificate request" \ |
| 3737 | -c "got a certificate request" \ |
| 3738 | -C "skip write certificate" \ |
| 3739 | -C "skip write certificate verify" \ |
| 3740 | -S "skip parse certificate verify" |
| 3741 | |
| 3742 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3743 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3744 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3745 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3746 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3747 | 0 \ |
| 3748 | -S "skip write certificate request" \ |
| 3749 | -C "skip parse certificate request" \ |
| 3750 | -c "got a certificate request" \ |
| 3751 | -C "skip write certificate" \ |
| 3752 | -C "skip write certificate verify" \ |
| 3753 | -S "skip parse certificate verify" |
| 3754 | |
| 3755 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3756 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3757 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3758 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3759 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3760 | 0 \ |
| 3761 | -s "skip write certificate request" \ |
| 3762 | -C "skip parse certificate request" \ |
| 3763 | -c "got no certificate request" \ |
| 3764 | -c "skip write certificate" \ |
| 3765 | -c "skip write certificate verify" \ |
| 3766 | -s "skip parse certificate verify" |
| 3767 | |
| 3768 | run_test "SNI: DTLS, CA no override" \ |
| 3769 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3770 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3771 | ca_file=data_files/test-ca.crt \ |
| 3772 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3773 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3774 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3775 | 1 \ |
| 3776 | -S "skip write certificate request" \ |
| 3777 | -C "skip parse certificate request" \ |
| 3778 | -c "got a certificate request" \ |
| 3779 | -C "skip write certificate" \ |
| 3780 | -C "skip write certificate verify" \ |
| 3781 | -S "skip parse certificate verify" \ |
| 3782 | -s "x509_verify_cert() returned" \ |
| 3783 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3784 | -S "The certificate has been revoked (is on a CRL)" |
| 3785 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3786 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3787 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3788 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3789 | ca_file=data_files/test-ca.crt \ |
| 3790 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3791 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3792 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3793 | 0 \ |
| 3794 | -S "skip write certificate request" \ |
| 3795 | -C "skip parse certificate request" \ |
| 3796 | -c "got a certificate request" \ |
| 3797 | -C "skip write certificate" \ |
| 3798 | -C "skip write certificate verify" \ |
| 3799 | -S "skip parse certificate verify" \ |
| 3800 | -S "x509_verify_cert() returned" \ |
| 3801 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3802 | -S "The certificate has been revoked (is on a CRL)" |
| 3803 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3804 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3805 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3806 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3807 | ca_file=data_files/test-ca.crt \ |
| 3808 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3809 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3810 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3811 | 1 \ |
| 3812 | -S "skip write certificate request" \ |
| 3813 | -C "skip parse certificate request" \ |
| 3814 | -c "got a certificate request" \ |
| 3815 | -C "skip write certificate" \ |
| 3816 | -C "skip write certificate verify" \ |
| 3817 | -S "skip parse certificate verify" \ |
| 3818 | -s "x509_verify_cert() returned" \ |
| 3819 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3820 | -s "The certificate has been revoked (is on a CRL)" |
| 3821 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3822 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3824 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3825 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3826 | "$P_CLI nbio=2 tickets=0" \ |
| 3827 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3828 | -S "mbedtls_ssl_handshake returned" \ |
| 3829 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3830 | -c "Read from server: .* bytes read" |
| 3831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3832 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3833 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3834 | "$P_CLI nbio=2 tickets=0" \ |
| 3835 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3836 | -S "mbedtls_ssl_handshake returned" \ |
| 3837 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3838 | -c "Read from server: .* bytes read" |
| 3839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3840 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3841 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3842 | "$P_CLI nbio=2 tickets=1" \ |
| 3843 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3844 | -S "mbedtls_ssl_handshake returned" \ |
| 3845 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3846 | -c "Read from server: .* bytes read" |
| 3847 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3848 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3849 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3850 | "$P_CLI nbio=2 tickets=1" \ |
| 3851 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3852 | -S "mbedtls_ssl_handshake returned" \ |
| 3853 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3854 | -c "Read from server: .* bytes read" |
| 3855 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3856 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3857 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3858 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3859 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3860 | -S "mbedtls_ssl_handshake returned" \ |
| 3861 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3862 | -c "Read from server: .* bytes read" |
| 3863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3864 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3865 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3866 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3867 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3868 | -S "mbedtls_ssl_handshake returned" \ |
| 3869 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3870 | -c "Read from server: .* bytes read" |
| 3871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3872 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3873 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3874 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3875 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3876 | -S "mbedtls_ssl_handshake returned" \ |
| 3877 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3878 | -c "Read from server: .* bytes read" |
| 3879 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3880 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3881 | |
| 3882 | run_test "Event-driven I/O: basic handshake" \ |
| 3883 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3884 | "$P_CLI event=1 tickets=0" \ |
| 3885 | 0 \ |
| 3886 | -S "mbedtls_ssl_handshake returned" \ |
| 3887 | -C "mbedtls_ssl_handshake returned" \ |
| 3888 | -c "Read from server: .* bytes read" |
| 3889 | |
| 3890 | run_test "Event-driven I/O: client auth" \ |
| 3891 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3892 | "$P_CLI event=1 tickets=0" \ |
| 3893 | 0 \ |
| 3894 | -S "mbedtls_ssl_handshake returned" \ |
| 3895 | -C "mbedtls_ssl_handshake returned" \ |
| 3896 | -c "Read from server: .* bytes read" |
| 3897 | |
| 3898 | run_test "Event-driven I/O: ticket" \ |
| 3899 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3900 | "$P_CLI event=1 tickets=1" \ |
| 3901 | 0 \ |
| 3902 | -S "mbedtls_ssl_handshake returned" \ |
| 3903 | -C "mbedtls_ssl_handshake returned" \ |
| 3904 | -c "Read from server: .* bytes read" |
| 3905 | |
| 3906 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3907 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3908 | "$P_CLI event=1 tickets=1" \ |
| 3909 | 0 \ |
| 3910 | -S "mbedtls_ssl_handshake returned" \ |
| 3911 | -C "mbedtls_ssl_handshake returned" \ |
| 3912 | -c "Read from server: .* bytes read" |
| 3913 | |
| 3914 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3915 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3916 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3917 | 0 \ |
| 3918 | -S "mbedtls_ssl_handshake returned" \ |
| 3919 | -C "mbedtls_ssl_handshake returned" \ |
| 3920 | -c "Read from server: .* bytes read" |
| 3921 | |
| 3922 | run_test "Event-driven I/O: ticket + resume" \ |
| 3923 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3924 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3925 | 0 \ |
| 3926 | -S "mbedtls_ssl_handshake returned" \ |
| 3927 | -C "mbedtls_ssl_handshake returned" \ |
| 3928 | -c "Read from server: .* bytes read" |
| 3929 | |
| 3930 | run_test "Event-driven I/O: session-id resume" \ |
| 3931 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3932 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3933 | 0 \ |
| 3934 | -S "mbedtls_ssl_handshake returned" \ |
| 3935 | -C "mbedtls_ssl_handshake returned" \ |
| 3936 | -c "Read from server: .* bytes read" |
| 3937 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3938 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3939 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3940 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3941 | 0 \ |
| 3942 | -c "Read from server: .* bytes read" |
| 3943 | |
| 3944 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3945 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3946 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3947 | 0 \ |
| 3948 | -c "Read from server: .* bytes read" |
| 3949 | |
| 3950 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3951 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3952 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3953 | 0 \ |
| 3954 | -c "Read from server: .* bytes read" |
| 3955 | |
| 3956 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3957 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3958 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3959 | 0 \ |
| 3960 | -c "Read from server: .* bytes read" |
| 3961 | |
| 3962 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3963 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3964 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3965 | 0 \ |
| 3966 | -c "Read from server: .* bytes read" |
| 3967 | |
| 3968 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3969 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3970 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 3971 | 0 \ |
| 3972 | -c "Read from server: .* bytes read" |
| 3973 | |
| 3974 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3975 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3976 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3977 | 0 \ |
| 3978 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3979 | |
| 3980 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3981 | # During session resumption, the client will send its ApplicationData record |
| 3982 | # within the same datagram as the Finished messages. In this situation, the |
| 3983 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3984 | # because the ApplicationData request has already been queued internally. |
| 3985 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3986 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3987 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3988 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 3989 | 0 \ |
| 3990 | -c "Read from server: .* bytes read" |
| 3991 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3992 | # Tests for version negotiation |
| 3993 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3994 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3995 | "$P_SRV" \ |
| 3996 | "$P_CLI" \ |
| 3997 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3998 | -S "mbedtls_ssl_handshake returned" \ |
| 3999 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4000 | -s "Protocol is TLSv1.2" \ |
| 4001 | -c "Protocol is TLSv1.2" |
| 4002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4003 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4004 | "$P_SRV" \ |
| 4005 | "$P_CLI max_version=tls1_1" \ |
| 4006 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4007 | -S "mbedtls_ssl_handshake returned" \ |
| 4008 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4009 | -s "Protocol is TLSv1.1" \ |
| 4010 | -c "Protocol is TLSv1.1" |
| 4011 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4012 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4013 | "$P_SRV max_version=tls1_1" \ |
| 4014 | "$P_CLI" \ |
| 4015 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4016 | -S "mbedtls_ssl_handshake returned" \ |
| 4017 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4018 | -s "Protocol is TLSv1.1" \ |
| 4019 | -c "Protocol is TLSv1.1" |
| 4020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4021 | 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] | 4022 | "$P_SRV max_version=tls1_1" \ |
| 4023 | "$P_CLI max_version=tls1_1" \ |
| 4024 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4025 | -S "mbedtls_ssl_handshake returned" \ |
| 4026 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4027 | -s "Protocol is TLSv1.1" \ |
| 4028 | -c "Protocol is TLSv1.1" |
| 4029 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4030 | 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] | 4031 | "$P_SRV min_version=tls1_1" \ |
| 4032 | "$P_CLI max_version=tls1_1" \ |
| 4033 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4034 | -S "mbedtls_ssl_handshake returned" \ |
| 4035 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4036 | -s "Protocol is TLSv1.1" \ |
| 4037 | -c "Protocol is TLSv1.1" |
| 4038 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4039 | 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] | 4040 | "$P_SRV max_version=tls1_1" \ |
| 4041 | "$P_CLI min_version=tls1_1" \ |
| 4042 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4043 | -S "mbedtls_ssl_handshake returned" \ |
| 4044 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4045 | -s "Protocol is TLSv1.1" \ |
| 4046 | -c "Protocol is TLSv1.1" |
| 4047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4048 | 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] | 4049 | "$P_SRV max_version=tls1_1" \ |
| 4050 | "$P_CLI min_version=tls1_2" \ |
| 4051 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4052 | -s "mbedtls_ssl_handshake returned" \ |
| 4053 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4054 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4056 | 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] | 4057 | "$P_SRV min_version=tls1_2" \ |
| 4058 | "$P_CLI max_version=tls1_1" \ |
| 4059 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4060 | -s "mbedtls_ssl_handshake returned" \ |
| 4061 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4062 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4063 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4064 | # Tests for ALPN extension |
| 4065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4066 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4067 | "$P_SRV debug_level=3" \ |
| 4068 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4069 | 0 \ |
| 4070 | -C "client hello, adding alpn extension" \ |
| 4071 | -S "found alpn extension" \ |
| 4072 | -C "got an alert message, type: \\[2:120]" \ |
| 4073 | -S "server hello, adding alpn extension" \ |
| 4074 | -C "found alpn extension " \ |
| 4075 | -C "Application Layer Protocol is" \ |
| 4076 | -S "Application Layer Protocol is" |
| 4077 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4078 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4079 | "$P_SRV debug_level=3" \ |
| 4080 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4081 | 0 \ |
| 4082 | -c "client hello, adding alpn extension" \ |
| 4083 | -s "found alpn extension" \ |
| 4084 | -C "got an alert message, type: \\[2:120]" \ |
| 4085 | -S "server hello, adding alpn extension" \ |
| 4086 | -C "found alpn extension " \ |
| 4087 | -c "Application Layer Protocol is (none)" \ |
| 4088 | -S "Application Layer Protocol is" |
| 4089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4090 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4091 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4092 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4093 | 0 \ |
| 4094 | -C "client hello, adding alpn extension" \ |
| 4095 | -S "found alpn extension" \ |
| 4096 | -C "got an alert message, type: \\[2:120]" \ |
| 4097 | -S "server hello, adding alpn extension" \ |
| 4098 | -C "found alpn extension " \ |
| 4099 | -C "Application Layer Protocol is" \ |
| 4100 | -s "Application Layer Protocol is (none)" |
| 4101 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4102 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4103 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4104 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4105 | 0 \ |
| 4106 | -c "client hello, adding alpn extension" \ |
| 4107 | -s "found alpn extension" \ |
| 4108 | -C "got an alert message, type: \\[2:120]" \ |
| 4109 | -s "server hello, adding alpn extension" \ |
| 4110 | -c "found alpn extension" \ |
| 4111 | -c "Application Layer Protocol is abc" \ |
| 4112 | -s "Application Layer Protocol is abc" |
| 4113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4114 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4115 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4116 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4117 | 0 \ |
| 4118 | -c "client hello, adding alpn extension" \ |
| 4119 | -s "found alpn extension" \ |
| 4120 | -C "got an alert message, type: \\[2:120]" \ |
| 4121 | -s "server hello, adding alpn extension" \ |
| 4122 | -c "found alpn extension" \ |
| 4123 | -c "Application Layer Protocol is abc" \ |
| 4124 | -s "Application Layer Protocol is abc" |
| 4125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4126 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4127 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4128 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4129 | 0 \ |
| 4130 | -c "client hello, adding alpn extension" \ |
| 4131 | -s "found alpn extension" \ |
| 4132 | -C "got an alert message, type: \\[2:120]" \ |
| 4133 | -s "server hello, adding alpn extension" \ |
| 4134 | -c "found alpn extension" \ |
| 4135 | -c "Application Layer Protocol is 1234" \ |
| 4136 | -s "Application Layer Protocol is 1234" |
| 4137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4138 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4139 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4140 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4141 | 1 \ |
| 4142 | -c "client hello, adding alpn extension" \ |
| 4143 | -s "found alpn extension" \ |
| 4144 | -c "got an alert message, type: \\[2:120]" \ |
| 4145 | -S "server hello, adding alpn extension" \ |
| 4146 | -C "found alpn extension" \ |
| 4147 | -C "Application Layer Protocol is 1234" \ |
| 4148 | -S "Application Layer Protocol is 1234" |
| 4149 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4150 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4151 | # Tests for keyUsage in leaf certificates, part 1: |
| 4152 | # server-side certificate/suite selection |
| 4153 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4154 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4155 | "$P_SRV key_file=data_files/server2.key \ |
| 4156 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4157 | "$P_CLI" \ |
| 4158 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4159 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4160 | |
| 4161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4162 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4163 | "$P_SRV key_file=data_files/server2.key \ |
| 4164 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4165 | "$P_CLI" \ |
| 4166 | 0 \ |
| 4167 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4169 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4170 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4171 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4172 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4173 | 1 \ |
| 4174 | -C "Ciphersuite is " |
| 4175 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4176 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4177 | "$P_SRV key_file=data_files/server5.key \ |
| 4178 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4179 | "$P_CLI" \ |
| 4180 | 0 \ |
| 4181 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4182 | |
| 4183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4184 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4185 | "$P_SRV key_file=data_files/server5.key \ |
| 4186 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4187 | "$P_CLI" \ |
| 4188 | 0 \ |
| 4189 | -c "Ciphersuite is TLS-ECDH-" |
| 4190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4191 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4192 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4193 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4194 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4195 | 1 \ |
| 4196 | -C "Ciphersuite is " |
| 4197 | |
| 4198 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4199 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4200 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4201 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4202 | "$O_SRV -key data_files/server2.key \ |
| 4203 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4204 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4205 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4206 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4207 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4208 | -C "Processing of the Certificate handshake message failed" \ |
| 4209 | -c "Ciphersuite is TLS-" |
| 4210 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4211 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4212 | "$O_SRV -key data_files/server2.key \ |
| 4213 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4214 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4215 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4216 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4217 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4218 | -C "Processing of the Certificate handshake message failed" \ |
| 4219 | -c "Ciphersuite is TLS-" |
| 4220 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4221 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4222 | "$O_SRV -key data_files/server2.key \ |
| 4223 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4224 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4225 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4226 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4227 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4228 | -C "Processing of the Certificate handshake message failed" \ |
| 4229 | -c "Ciphersuite is TLS-" |
| 4230 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4231 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4232 | "$O_SRV -key data_files/server2.key \ |
| 4233 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4234 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4235 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4236 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4237 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4238 | -c "Processing of the Certificate handshake message failed" \ |
| 4239 | -C "Ciphersuite is TLS-" |
| 4240 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4241 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4242 | "$O_SRV -key data_files/server2.key \ |
| 4243 | -cert data_files/server2.ku-ke.crt" \ |
| 4244 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4245 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4246 | 0 \ |
| 4247 | -c "bad certificate (usage extensions)" \ |
| 4248 | -C "Processing of the Certificate handshake message failed" \ |
| 4249 | -c "Ciphersuite is TLS-" \ |
| 4250 | -c "! Usage does not match the keyUsage extension" |
| 4251 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4252 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4253 | "$O_SRV -key data_files/server2.key \ |
| 4254 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4255 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4256 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4257 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4258 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4259 | -C "Processing of the Certificate handshake message failed" \ |
| 4260 | -c "Ciphersuite is TLS-" |
| 4261 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4262 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4263 | "$O_SRV -key data_files/server2.key \ |
| 4264 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4265 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4266 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4267 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4268 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4269 | -c "Processing of the Certificate handshake message failed" \ |
| 4270 | -C "Ciphersuite is TLS-" |
| 4271 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4272 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4273 | "$O_SRV -key data_files/server2.key \ |
| 4274 | -cert data_files/server2.ku-ds.crt" \ |
| 4275 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4276 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4277 | 0 \ |
| 4278 | -c "bad certificate (usage extensions)" \ |
| 4279 | -C "Processing of the Certificate handshake message failed" \ |
| 4280 | -c "Ciphersuite is TLS-" \ |
| 4281 | -c "! Usage does not match the keyUsage extension" |
| 4282 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4283 | # Tests for keyUsage in leaf certificates, part 3: |
| 4284 | # server-side checking of client cert |
| 4285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4286 | run_test "keyUsage cli-auth: RSA, DigitalSignature: 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 | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4288 | "$O_CLI -key data_files/server2.key \ |
| 4289 | -cert data_files/server2.ku-ds.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 "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
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 | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4296 | "$O_CLI -key data_files/server2.key \ |
| 4297 | -cert data_files/server2.ku-ke.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 "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4304 | "$O_CLI -key data_files/server2.key \ |
| 4305 | -cert data_files/server2.ku-ke.crt" \ |
| 4306 | 1 \ |
| 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 "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
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 | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4312 | "$O_CLI -key data_files/server5.key \ |
| 4313 | -cert data_files/server5.ku-ds.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 "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4319 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4320 | "$O_CLI -key data_files/server5.key \ |
| 4321 | -cert data_files/server5.ku-ka.crt" \ |
| 4322 | 0 \ |
| 4323 | -s "bad certificate (usage extensions)" \ |
| 4324 | -S "Processing of the Certificate handshake message failed" |
| 4325 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4326 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4327 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4328 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4329 | "$P_SRV key_file=data_files/server5.key \ |
| 4330 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4331 | "$P_CLI" \ |
| 4332 | 0 |
| 4333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4334 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4335 | "$P_SRV key_file=data_files/server5.key \ |
| 4336 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4337 | "$P_CLI" \ |
| 4338 | 0 |
| 4339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4340 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4341 | "$P_SRV key_file=data_files/server5.key \ |
| 4342 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4343 | "$P_CLI" \ |
| 4344 | 0 |
| 4345 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4346 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4347 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4348 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4349 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4350 | 1 |
| 4351 | |
| 4352 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4353 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4354 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4355 | "$O_SRV -key data_files/server5.key \ |
| 4356 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4357 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4358 | 0 \ |
| 4359 | -C "bad certificate (usage extensions)" \ |
| 4360 | -C "Processing of the Certificate handshake message failed" \ |
| 4361 | -c "Ciphersuite is TLS-" |
| 4362 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4363 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4364 | "$O_SRV -key data_files/server5.key \ |
| 4365 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4366 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4367 | 0 \ |
| 4368 | -C "bad certificate (usage extensions)" \ |
| 4369 | -C "Processing of the Certificate handshake message failed" \ |
| 4370 | -c "Ciphersuite is TLS-" |
| 4371 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4372 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4373 | "$O_SRV -key data_files/server5.key \ |
| 4374 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4375 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4376 | 0 \ |
| 4377 | -C "bad certificate (usage extensions)" \ |
| 4378 | -C "Processing of the Certificate handshake message failed" \ |
| 4379 | -c "Ciphersuite is TLS-" |
| 4380 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4381 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4382 | "$O_SRV -key data_files/server5.key \ |
| 4383 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4384 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4385 | 1 \ |
| 4386 | -c "bad certificate (usage extensions)" \ |
| 4387 | -c "Processing of the Certificate handshake message failed" \ |
| 4388 | -C "Ciphersuite is TLS-" |
| 4389 | |
| 4390 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4391 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4392 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4393 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4394 | "$O_CLI -key data_files/server5.key \ |
| 4395 | -cert data_files/server5.eku-cli.crt" \ |
| 4396 | 0 \ |
| 4397 | -S "bad certificate (usage extensions)" \ |
| 4398 | -S "Processing of the Certificate handshake message failed" |
| 4399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4400 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4401 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4402 | "$O_CLI -key data_files/server5.key \ |
| 4403 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4404 | 0 \ |
| 4405 | -S "bad certificate (usage extensions)" \ |
| 4406 | -S "Processing of the Certificate handshake message failed" |
| 4407 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4408 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4409 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4410 | "$O_CLI -key data_files/server5.key \ |
| 4411 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4412 | 0 \ |
| 4413 | -S "bad certificate (usage extensions)" \ |
| 4414 | -S "Processing of the Certificate handshake message failed" |
| 4415 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4416 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4417 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4418 | "$O_CLI -key data_files/server5.key \ |
| 4419 | -cert data_files/server5.eku-cs.crt" \ |
| 4420 | 0 \ |
| 4421 | -s "bad certificate (usage extensions)" \ |
| 4422 | -S "Processing of the Certificate handshake message failed" |
| 4423 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4424 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4425 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4426 | "$O_CLI -key data_files/server5.key \ |
| 4427 | -cert data_files/server5.eku-cs.crt" \ |
| 4428 | 1 \ |
| 4429 | -s "bad certificate (usage extensions)" \ |
| 4430 | -s "Processing of the Certificate handshake message failed" |
| 4431 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4432 | # Tests for DHM parameters loading |
| 4433 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4434 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4435 | "$P_SRV" \ |
| 4436 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4437 | debug_level=3" \ |
| 4438 | 0 \ |
| 4439 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 4440 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4442 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4443 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4444 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4445 | debug_level=3" \ |
| 4446 | 0 \ |
| 4447 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4448 | -c "value of 'DHM: G ' (2 bits)" |
| 4449 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4450 | # Tests for DHM client-side size checking |
| 4451 | |
| 4452 | run_test "DHM size: server default, client default, OK" \ |
| 4453 | "$P_SRV" \ |
| 4454 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4455 | debug_level=1" \ |
| 4456 | 0 \ |
| 4457 | -C "DHM prime too short:" |
| 4458 | |
| 4459 | run_test "DHM size: server default, client 2048, OK" \ |
| 4460 | "$P_SRV" \ |
| 4461 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4462 | debug_level=1 dhmlen=2048" \ |
| 4463 | 0 \ |
| 4464 | -C "DHM prime too short:" |
| 4465 | |
| 4466 | run_test "DHM size: server 1024, client default, OK" \ |
| 4467 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4468 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4469 | debug_level=1" \ |
| 4470 | 0 \ |
| 4471 | -C "DHM prime too short:" |
| 4472 | |
| 4473 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4474 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4475 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4476 | debug_level=1" \ |
| 4477 | 1 \ |
| 4478 | -c "DHM prime too short:" |
| 4479 | |
| 4480 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4481 | "$P_SRV" \ |
| 4482 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4483 | debug_level=1 dhmlen=2049" \ |
| 4484 | 1 \ |
| 4485 | -c "DHM prime too short:" |
| 4486 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4487 | # Tests for PSK callback |
| 4488 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4489 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4490 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4491 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4492 | psk_identity=foo psk=abc123" \ |
| 4493 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4494 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4495 | -S "SSL - Unknown identity received" \ |
| 4496 | -S "SSL - Verification of the message MAC failed" |
| 4497 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4499 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 4500 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4501 | "$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] | 4502 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4503 | 0 \ |
| 4504 | -c "skip PMS generation for opaque PSK"\ |
| 4505 | -S "skip PMS generation for opaque PSK"\ |
| 4506 | -C "using extended master secret"\ |
| 4507 | -S "using extended master secret"\ |
| 4508 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4509 | -S "SSL - Unknown identity received" \ |
| 4510 | -S "SSL - Verification of the message MAC failed" |
| 4511 | |
| 4512 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4513 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 4514 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 4515 | "$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] | 4516 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4517 | 0 \ |
| 4518 | -c "skip PMS generation for opaque PSK"\ |
| 4519 | -S "skip PMS generation for opaque PSK"\ |
| 4520 | -C "using extended master secret"\ |
| 4521 | -S "using extended master secret"\ |
| 4522 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4523 | -S "SSL - Unknown identity received" \ |
| 4524 | -S "SSL - Verification of the message MAC failed" |
| 4525 | |
| 4526 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4527 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 4528 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4529 | "$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] | 4530 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4531 | 0 \ |
| 4532 | -c "skip PMS generation for opaque PSK"\ |
| 4533 | -S "skip PMS generation for opaque PSK"\ |
| 4534 | -c "using extended master secret"\ |
| 4535 | -s "using extended master secret"\ |
| 4536 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4537 | -S "SSL - Unknown identity received" \ |
| 4538 | -S "SSL - Verification of the message MAC failed" |
| 4539 | |
| 4540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4541 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 4542 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 4543 | "$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] | 4544 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 4545 | 0 \ |
| 4546 | -c "skip PMS generation for opaque PSK"\ |
| 4547 | -S "skip PMS generation for opaque PSK"\ |
| 4548 | -c "using extended master secret"\ |
| 4549 | -s "using extended master secret"\ |
| 4550 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4551 | -S "SSL - Unknown identity received" \ |
| 4552 | -S "SSL - Verification of the message MAC failed" |
| 4553 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 4554 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4555 | 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] | 4556 | "$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] | 4557 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4558 | psk_identity=foo psk=abc123" \ |
| 4559 | 0 \ |
| 4560 | -C "skip PMS generation for opaque PSK"\ |
| 4561 | -s "skip PMS generation for opaque PSK"\ |
| 4562 | -C "using extended master secret"\ |
| 4563 | -S "using extended master secret"\ |
| 4564 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4565 | -S "SSL - Unknown identity received" \ |
| 4566 | -S "SSL - Verification of the message MAC failed" |
| 4567 | |
| 4568 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4569 | 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] | 4570 | "$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] | 4571 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4572 | psk_identity=foo psk=abc123" \ |
| 4573 | 0 \ |
| 4574 | -C "skip PMS generation for opaque PSK"\ |
| 4575 | -s "skip PMS generation for opaque PSK"\ |
| 4576 | -C "using extended master secret"\ |
| 4577 | -S "using extended master secret"\ |
| 4578 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4579 | -S "SSL - Unknown identity received" \ |
| 4580 | -S "SSL - Verification of the message MAC failed" |
| 4581 | |
| 4582 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4583 | 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] | 4584 | "$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] | 4585 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4586 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4587 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4588 | 0 \ |
| 4589 | -c "using extended master secret"\ |
| 4590 | -s "using extended master secret"\ |
| 4591 | -C "skip PMS generation for opaque PSK"\ |
| 4592 | -s "skip PMS generation for opaque PSK"\ |
| 4593 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4594 | -S "SSL - Unknown identity received" \ |
| 4595 | -S "SSL - Verification of the message MAC failed" |
| 4596 | |
| 4597 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4598 | 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] | 4599 | "$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] | 4600 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4601 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4602 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 4603 | 0 \ |
| 4604 | -c "using extended master secret"\ |
| 4605 | -s "using extended master secret"\ |
| 4606 | -C "skip PMS generation for opaque PSK"\ |
| 4607 | -s "skip PMS generation for opaque PSK"\ |
| 4608 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4609 | -S "SSL - Unknown identity received" \ |
| 4610 | -S "SSL - Verification of the message MAC failed" |
| 4611 | |
| 4612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4613 | 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] | 4614 | "$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] | 4615 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4616 | psk_identity=def psk=beef" \ |
| 4617 | 0 \ |
| 4618 | -C "skip PMS generation for opaque PSK"\ |
| 4619 | -s "skip PMS generation for opaque PSK"\ |
| 4620 | -C "using extended master secret"\ |
| 4621 | -S "using extended master secret"\ |
| 4622 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4623 | -S "SSL - Unknown identity received" \ |
| 4624 | -S "SSL - Verification of the message MAC failed" |
| 4625 | |
| 4626 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4627 | 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] | 4628 | "$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] | 4629 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4630 | psk_identity=def psk=beef" \ |
| 4631 | 0 \ |
| 4632 | -C "skip PMS generation for opaque PSK"\ |
| 4633 | -s "skip PMS generation for opaque PSK"\ |
| 4634 | -C "using extended master secret"\ |
| 4635 | -S "using extended master secret"\ |
| 4636 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4637 | -S "SSL - Unknown identity received" \ |
| 4638 | -S "SSL - Verification of the message MAC failed" |
| 4639 | |
| 4640 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4641 | 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] | 4642 | "$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] | 4643 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 4644 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4645 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4646 | 0 \ |
| 4647 | -c "using extended master secret"\ |
| 4648 | -s "using extended master secret"\ |
| 4649 | -C "skip PMS generation for opaque PSK"\ |
| 4650 | -s "skip PMS generation for opaque PSK"\ |
| 4651 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4652 | -S "SSL - Unknown identity received" \ |
| 4653 | -S "SSL - Verification of the message MAC failed" |
| 4654 | |
| 4655 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4656 | 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] | 4657 | "$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] | 4658 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 4659 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 4660 | psk_identity=abc psk=dead extended_ms=1" \ |
| 4661 | 0 \ |
| 4662 | -c "using extended master secret"\ |
| 4663 | -s "using extended master secret"\ |
| 4664 | -C "skip PMS generation for opaque PSK"\ |
| 4665 | -s "skip PMS generation for opaque PSK"\ |
| 4666 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4667 | -S "SSL - Unknown identity received" \ |
| 4668 | -S "SSL - Verification of the message MAC failed" |
| 4669 | |
| 4670 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4671 | 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] | 4672 | "$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] | 4673 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4674 | psk_identity=def psk=beef" \ |
| 4675 | 0 \ |
| 4676 | -C "skip PMS generation for opaque PSK"\ |
| 4677 | -s "skip PMS generation for opaque PSK"\ |
| 4678 | -C "using extended master secret"\ |
| 4679 | -S "using extended master secret"\ |
| 4680 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4681 | -S "SSL - Unknown identity received" \ |
| 4682 | -S "SSL - Verification of the message MAC failed" |
| 4683 | |
| 4684 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4685 | 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] | 4686 | "$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] | 4687 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4688 | psk_identity=def psk=beef" \ |
| 4689 | 0 \ |
| 4690 | -C "skip PMS generation for opaque PSK"\ |
| 4691 | -s "skip PMS generation for opaque PSK"\ |
| 4692 | -C "using extended master secret"\ |
| 4693 | -S "using extended master secret"\ |
| 4694 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4695 | -S "SSL - Unknown identity received" \ |
| 4696 | -S "SSL - Verification of the message MAC failed" |
| 4697 | |
| 4698 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4699 | 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] | 4700 | "$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] | 4701 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4702 | psk_identity=def psk=beef" \ |
| 4703 | 0 \ |
| 4704 | -C "skip PMS generation for opaque PSK"\ |
| 4705 | -C "using extended master secret"\ |
| 4706 | -S "using extended master secret"\ |
| 4707 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4708 | -S "SSL - Unknown identity received" \ |
| 4709 | -S "SSL - Verification of the message MAC failed" |
| 4710 | |
| 4711 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4712 | 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] | 4713 | "$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] | 4714 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4715 | psk_identity=def psk=beef" \ |
| 4716 | 0 \ |
| 4717 | -C "skip PMS generation for opaque PSK"\ |
| 4718 | -C "using extended master secret"\ |
| 4719 | -S "using extended master secret"\ |
| 4720 | -S "SSL - None of the common ciphersuites is usable" \ |
| 4721 | -S "SSL - Unknown identity received" \ |
| 4722 | -S "SSL - Verification of the message MAC failed" |
| 4723 | |
| 4724 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 4725 | 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] | 4726 | "$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] | 4727 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4728 | psk_identity=def psk=beef" \ |
| 4729 | 1 \ |
| 4730 | -s "SSL - Verification of the message MAC failed" |
| 4731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4732 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4733 | "$P_SRV" \ |
| 4734 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4735 | psk_identity=foo psk=abc123" \ |
| 4736 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4737 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4738 | -S "SSL - Unknown identity received" \ |
| 4739 | -S "SSL - Verification of the message MAC failed" |
| 4740 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4741 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4742 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4743 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4744 | psk_identity=foo psk=abc123" \ |
| 4745 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4746 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4747 | -s "SSL - Unknown identity received" \ |
| 4748 | -S "SSL - Verification of the message MAC failed" |
| 4749 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4750 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4751 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4752 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4753 | psk_identity=abc psk=dead" \ |
| 4754 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4755 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4756 | -S "SSL - Unknown identity received" \ |
| 4757 | -S "SSL - Verification of the message MAC failed" |
| 4758 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4759 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4760 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4761 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4762 | psk_identity=def psk=beef" \ |
| 4763 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4764 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4765 | -S "SSL - Unknown identity received" \ |
| 4766 | -S "SSL - Verification of the message MAC failed" |
| 4767 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4768 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4769 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4770 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4771 | psk_identity=ghi psk=beef" \ |
| 4772 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4773 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4774 | -s "SSL - Unknown identity received" \ |
| 4775 | -S "SSL - Verification of the message MAC failed" |
| 4776 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4777 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4778 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4779 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4780 | psk_identity=abc psk=beef" \ |
| 4781 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4782 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4783 | -S "SSL - Unknown identity received" \ |
| 4784 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4785 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4786 | # Tests for EC J-PAKE |
| 4787 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4788 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4789 | run_test "ECJPAKE: client not configured" \ |
| 4790 | "$P_SRV debug_level=3" \ |
| 4791 | "$P_CLI debug_level=3" \ |
| 4792 | 0 \ |
| 4793 | -C "add ciphersuite: c0ff" \ |
| 4794 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4795 | -S "found ecjpake kkpp extension" \ |
| 4796 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4797 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4798 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4799 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4800 | -S "None of the common ciphersuites is usable" |
| 4801 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4802 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4803 | run_test "ECJPAKE: server not configured" \ |
| 4804 | "$P_SRV debug_level=3" \ |
| 4805 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4806 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4807 | 1 \ |
| 4808 | -c "add ciphersuite: c0ff" \ |
| 4809 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4810 | -s "found ecjpake kkpp extension" \ |
| 4811 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4812 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4813 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4814 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4815 | -s "None of the common ciphersuites is usable" |
| 4816 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4817 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4818 | run_test "ECJPAKE: working, TLS" \ |
| 4819 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4820 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4821 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4822 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4823 | -c "add ciphersuite: c0ff" \ |
| 4824 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4825 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4826 | -s "found ecjpake kkpp extension" \ |
| 4827 | -S "skip ecjpake kkpp extension" \ |
| 4828 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4829 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4830 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4831 | -S "None of the common ciphersuites is usable" \ |
| 4832 | -S "SSL - Verification of the message MAC failed" |
| 4833 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4834 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4835 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4836 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4837 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4838 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4839 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4840 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4841 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4842 | -s "SSL - Verification of the message MAC failed" |
| 4843 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4844 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4845 | run_test "ECJPAKE: working, DTLS" \ |
| 4846 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4847 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4848 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4849 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4850 | -c "re-using cached ecjpake parameters" \ |
| 4851 | -S "SSL - Verification of the message MAC failed" |
| 4852 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4853 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4854 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4855 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4856 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4857 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4858 | 0 \ |
| 4859 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4860 | -S "SSL - Verification of the message MAC failed" |
| 4861 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4862 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4863 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4864 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4865 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4866 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4867 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4868 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4869 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4870 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4871 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4872 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4873 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4874 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4875 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4876 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4877 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4878 | 0 |
| 4879 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4880 | # Tests for ciphersuites per version |
| 4881 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4882 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4883 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4884 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4885 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4886 | "$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] | 4887 | "$P_CLI force_version=ssl3" \ |
| 4888 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4889 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4890 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4892 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4893 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4894 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4895 | "$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] | 4896 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4897 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4898 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4899 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4900 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4901 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4902 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4903 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4904 | "$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] | 4905 | "$P_CLI force_version=tls1_1" \ |
| 4906 | 0 \ |
| 4907 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4908 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4909 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4910 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4911 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4912 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4913 | "$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] | 4914 | "$P_CLI force_version=tls1_2" \ |
| 4915 | 0 \ |
| 4916 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4917 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4918 | # Test for ClientHello without extensions |
| 4919 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4920 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4921 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | 574ac57 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 4922 | "$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] | 4923 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4924 | 0 \ |
| 4925 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4926 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4927 | requires_gnutls |
| 4928 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 4929 | "$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] | 4930 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4931 | 0 \ |
| 4932 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4933 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4934 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4935 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4936 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4937 | "$P_SRV" \ |
| 4938 | "$P_CLI request_size=100" \ |
| 4939 | 0 \ |
| 4940 | -s "Read from client: 100 bytes read$" |
| 4941 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4942 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4943 | "$P_SRV" \ |
| 4944 | "$P_CLI request_size=500" \ |
| 4945 | 0 \ |
| 4946 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4947 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4948 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4949 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4950 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4951 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4952 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4953 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4954 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4955 | 0 \ |
| 4956 | -s "Read from client: 1 bytes read" |
| 4957 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4958 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4959 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4960 | "$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] | 4961 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4962 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4963 | 0 \ |
| 4964 | -s "Read from client: 1 bytes read" |
| 4965 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4966 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4967 | "$P_SRV" \ |
| 4968 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4969 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4970 | 0 \ |
| 4971 | -s "Read from client: 1 bytes read" |
| 4972 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4973 | 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] | 4974 | "$P_SRV" \ |
| 4975 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4977 | 0 \ |
| 4978 | -s "Read from client: 1 bytes read" |
| 4979 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4980 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4981 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4982 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4983 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4984 | 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] | 4985 | 0 \ |
| 4986 | -s "Read from client: 1 bytes read" |
| 4987 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4988 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4989 | 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] | 4990 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4991 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4992 | 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] | 4993 | 0 \ |
| 4994 | -s "Read from client: 1 bytes read" |
| 4995 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4996 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4997 | "$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] | 4998 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4999 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5000 | 0 \ |
| 5001 | -s "Read from client: 1 bytes read" |
| 5002 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5003 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5004 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5005 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5006 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5007 | 0 \ |
| 5008 | -s "Read from client: 1 bytes read" |
| 5009 | |
| 5010 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5011 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5012 | "$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] | 5013 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5014 | 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] | 5015 | 0 \ |
| 5016 | -s "Read from client: 1 bytes read" |
| 5017 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5019 | 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] | 5020 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5021 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5022 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5023 | 0 \ |
| 5024 | -s "Read from client: 1 bytes read" |
| 5025 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5026 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5027 | "$P_SRV" \ |
| 5028 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5029 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5030 | 0 \ |
| 5031 | -s "Read from client: 1 bytes read" |
| 5032 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5033 | 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] | 5034 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5035 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5036 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5037 | 0 \ |
| 5038 | -s "Read from client: 1 bytes read" |
| 5039 | |
| 5040 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5041 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5042 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5043 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5044 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5045 | 0 \ |
| 5046 | -s "Read from client: 1 bytes read" |
| 5047 | |
| 5048 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5049 | 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] | 5050 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5051 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5052 | 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] | 5053 | 0 \ |
| 5054 | -s "Read from client: 1 bytes read" |
| 5055 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5056 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5057 | "$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] | 5058 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5059 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5060 | 0 \ |
| 5061 | -s "Read from client: 1 bytes read" |
| 5062 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5063 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5064 | "$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] | 5065 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5066 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5067 | 0 \ |
| 5068 | -s "Read from client: 1 bytes read" |
| 5069 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5070 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5071 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5072 | "$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] | 5073 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5074 | 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] | 5075 | 0 \ |
| 5076 | -s "Read from client: 1 bytes read" |
| 5077 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5078 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5079 | 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] | 5080 | "$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] | 5081 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5082 | 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] | 5083 | 0 \ |
| 5084 | -s "Read from client: 1 bytes read" |
| 5085 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5086 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5087 | "$P_SRV" \ |
| 5088 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5089 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5090 | 0 \ |
| 5091 | -s "Read from client: 1 bytes read" |
| 5092 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5093 | 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] | 5094 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5095 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5096 | 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] | 5097 | 0 \ |
| 5098 | -s "Read from client: 1 bytes read" |
| 5099 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5100 | 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] | 5101 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5102 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5103 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5104 | 0 \ |
| 5105 | -s "Read from client: 1 bytes read" |
| 5106 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5107 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5108 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5109 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5110 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5111 | 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] | 5112 | 0 \ |
| 5113 | -s "Read from client: 1 bytes read" |
| 5114 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5115 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5116 | 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] | 5117 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5118 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5119 | 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] | 5120 | 0 \ |
| 5121 | -s "Read from client: 1 bytes read" |
| 5122 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5123 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5124 | "$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] | 5125 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5126 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5127 | 0 \ |
| 5128 | -s "Read from client: 1 bytes read" |
| 5129 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5130 | 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] | 5131 | "$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] | 5132 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5133 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5134 | 0 \ |
| 5135 | -s "Read from client: 1 bytes read" |
| 5136 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5137 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5138 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5139 | "$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] | 5140 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5141 | 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] | 5142 | 0 \ |
| 5143 | -s "Read from client: 1 bytes read" |
| 5144 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5145 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5146 | 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] | 5147 | "$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] | 5148 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5149 | 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] | 5150 | 0 \ |
| 5151 | -s "Read from client: 1 bytes read" |
| 5152 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5153 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5154 | "$P_SRV" \ |
| 5155 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5156 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5157 | 0 \ |
| 5158 | -s "Read from client: 1 bytes read" |
| 5159 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5160 | 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] | 5161 | "$P_SRV" \ |
| 5162 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5163 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5164 | 0 \ |
| 5165 | -s "Read from client: 1 bytes read" |
| 5166 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5167 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5168 | |
| 5169 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5170 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5171 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5172 | "$P_CLI dtls=1 request_size=1 \ |
| 5173 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5174 | 0 \ |
| 5175 | -s "Read from client: 1 bytes read" |
| 5176 | |
| 5177 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5178 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5179 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5180 | "$P_CLI dtls=1 request_size=1 \ |
| 5181 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5182 | 0 \ |
| 5183 | -s "Read from client: 1 bytes read" |
| 5184 | |
| 5185 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5186 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5187 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5188 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5189 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5190 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5191 | 0 \ |
| 5192 | -s "Read from client: 1 bytes read" |
| 5193 | |
| 5194 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5195 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5196 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5197 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5198 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5199 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5200 | 0 \ |
| 5201 | -s "Read from client: 1 bytes read" |
| 5202 | |
| 5203 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5204 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5205 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5206 | "$P_CLI dtls=1 request_size=1 \ |
| 5207 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5208 | 0 \ |
| 5209 | -s "Read from client: 1 bytes read" |
| 5210 | |
| 5211 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5212 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5213 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5214 | "$P_CLI dtls=1 request_size=1 \ |
| 5215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5216 | 0 \ |
| 5217 | -s "Read from client: 1 bytes read" |
| 5218 | |
| 5219 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5220 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5221 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5222 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5223 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5224 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5225 | 0 \ |
| 5226 | -s "Read from client: 1 bytes read" |
| 5227 | |
| 5228 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5229 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5230 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5231 | "$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] | 5232 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5233 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5234 | 0 \ |
| 5235 | -s "Read from client: 1 bytes read" |
| 5236 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5237 | # Tests for small server packets |
| 5238 | |
| 5239 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5240 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5241 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5242 | "$P_CLI force_version=ssl3 \ |
| 5243 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5244 | 0 \ |
| 5245 | -c "Read from server: 1 bytes read" |
| 5246 | |
| 5247 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5248 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5249 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5250 | "$P_CLI force_version=ssl3 \ |
| 5251 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5252 | 0 \ |
| 5253 | -c "Read from server: 1 bytes read" |
| 5254 | |
| 5255 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5256 | "$P_SRV response_size=1" \ |
| 5257 | "$P_CLI force_version=tls1 \ |
| 5258 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5259 | 0 \ |
| 5260 | -c "Read from server: 1 bytes read" |
| 5261 | |
| 5262 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5263 | "$P_SRV response_size=1" \ |
| 5264 | "$P_CLI force_version=tls1 etm=0 \ |
| 5265 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5266 | 0 \ |
| 5267 | -c "Read from server: 1 bytes read" |
| 5268 | |
| 5269 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5270 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5271 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5272 | "$P_CLI force_version=tls1 \ |
| 5273 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5274 | 0 \ |
| 5275 | -c "Read from server: 1 bytes read" |
| 5276 | |
| 5277 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5278 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5279 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5280 | "$P_CLI force_version=tls1 \ |
| 5281 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5282 | 0 \ |
| 5283 | -c "Read from server: 1 bytes read" |
| 5284 | |
| 5285 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5286 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5287 | "$P_CLI force_version=tls1 \ |
| 5288 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5289 | 0 \ |
| 5290 | -c "Read from server: 1 bytes read" |
| 5291 | |
| 5292 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5293 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5294 | "$P_CLI force_version=tls1 \ |
| 5295 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5296 | 0 \ |
| 5297 | -c "Read from server: 1 bytes read" |
| 5298 | |
| 5299 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5300 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5301 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5302 | "$P_CLI force_version=tls1 \ |
| 5303 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5304 | 0 \ |
| 5305 | -c "Read from server: 1 bytes read" |
| 5306 | |
| 5307 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5308 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5309 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5310 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5311 | trunc_hmac=1 etm=0" \ |
| 5312 | 0 \ |
| 5313 | -c "Read from server: 1 bytes read" |
| 5314 | |
| 5315 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5316 | "$P_SRV response_size=1" \ |
| 5317 | "$P_CLI force_version=tls1_1 \ |
| 5318 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5319 | 0 \ |
| 5320 | -c "Read from server: 1 bytes read" |
| 5321 | |
| 5322 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5323 | "$P_SRV response_size=1" \ |
| 5324 | "$P_CLI force_version=tls1_1 \ |
| 5325 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5326 | 0 \ |
| 5327 | -c "Read from server: 1 bytes read" |
| 5328 | |
| 5329 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5330 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5331 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5332 | "$P_CLI force_version=tls1_1 \ |
| 5333 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5334 | 0 \ |
| 5335 | -c "Read from server: 1 bytes read" |
| 5336 | |
| 5337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5338 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5339 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5340 | "$P_CLI force_version=tls1_1 \ |
| 5341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5342 | 0 \ |
| 5343 | -c "Read from server: 1 bytes read" |
| 5344 | |
| 5345 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5346 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5347 | "$P_CLI force_version=tls1_1 \ |
| 5348 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5349 | 0 \ |
| 5350 | -c "Read from server: 1 bytes read" |
| 5351 | |
| 5352 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5353 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5354 | "$P_CLI force_version=tls1_1 \ |
| 5355 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5356 | 0 \ |
| 5357 | -c "Read from server: 1 bytes read" |
| 5358 | |
| 5359 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5360 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5361 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5362 | "$P_CLI force_version=tls1_1 \ |
| 5363 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5364 | 0 \ |
| 5365 | -c "Read from server: 1 bytes read" |
| 5366 | |
| 5367 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5368 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5369 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5370 | "$P_CLI force_version=tls1_1 \ |
| 5371 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5372 | 0 \ |
| 5373 | -c "Read from server: 1 bytes read" |
| 5374 | |
| 5375 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5376 | "$P_SRV response_size=1" \ |
| 5377 | "$P_CLI force_version=tls1_2 \ |
| 5378 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5379 | 0 \ |
| 5380 | -c "Read from server: 1 bytes read" |
| 5381 | |
| 5382 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5383 | "$P_SRV response_size=1" \ |
| 5384 | "$P_CLI force_version=tls1_2 \ |
| 5385 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5386 | 0 \ |
| 5387 | -c "Read from server: 1 bytes read" |
| 5388 | |
| 5389 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5390 | "$P_SRV response_size=1" \ |
| 5391 | "$P_CLI force_version=tls1_2 \ |
| 5392 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5393 | 0 \ |
| 5394 | -c "Read from server: 1 bytes read" |
| 5395 | |
| 5396 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5397 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5398 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5399 | "$P_CLI force_version=tls1_2 \ |
| 5400 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5401 | 0 \ |
| 5402 | -c "Read from server: 1 bytes read" |
| 5403 | |
| 5404 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5405 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5406 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5407 | "$P_CLI force_version=tls1_2 \ |
| 5408 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5409 | 0 \ |
| 5410 | -c "Read from server: 1 bytes read" |
| 5411 | |
| 5412 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5413 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5414 | "$P_CLI force_version=tls1_2 \ |
| 5415 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5416 | 0 \ |
| 5417 | -c "Read from server: 1 bytes read" |
| 5418 | |
| 5419 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5420 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5421 | "$P_CLI force_version=tls1_2 \ |
| 5422 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5423 | 0 \ |
| 5424 | -c "Read from server: 1 bytes read" |
| 5425 | |
| 5426 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5427 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5428 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5429 | "$P_CLI force_version=tls1_2 \ |
| 5430 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5431 | 0 \ |
| 5432 | -c "Read from server: 1 bytes read" |
| 5433 | |
| 5434 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5435 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5436 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5437 | "$P_CLI force_version=tls1_2 \ |
| 5438 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5439 | 0 \ |
| 5440 | -c "Read from server: 1 bytes read" |
| 5441 | |
| 5442 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5443 | "$P_SRV response_size=1" \ |
| 5444 | "$P_CLI force_version=tls1_2 \ |
| 5445 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5446 | 0 \ |
| 5447 | -c "Read from server: 1 bytes read" |
| 5448 | |
| 5449 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5450 | "$P_SRV response_size=1" \ |
| 5451 | "$P_CLI force_version=tls1_2 \ |
| 5452 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5453 | 0 \ |
| 5454 | -c "Read from server: 1 bytes read" |
| 5455 | |
| 5456 | # Tests for small server packets in DTLS |
| 5457 | |
| 5458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5459 | run_test "Small server packet DTLS 1.0" \ |
| 5460 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5461 | "$P_CLI dtls=1 \ |
| 5462 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5463 | 0 \ |
| 5464 | -c "Read from server: 1 bytes read" |
| 5465 | |
| 5466 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5467 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 5468 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 5469 | "$P_CLI dtls=1 \ |
| 5470 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5471 | 0 \ |
| 5472 | -c "Read from server: 1 bytes read" |
| 5473 | |
| 5474 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5475 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5476 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 5477 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 5478 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 5479 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5480 | 0 \ |
| 5481 | -c "Read from server: 1 bytes read" |
| 5482 | |
| 5483 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5484 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5485 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 5486 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 5487 | "$P_CLI dtls=1 \ |
| 5488 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5489 | 0 \ |
| 5490 | -c "Read from server: 1 bytes read" |
| 5491 | |
| 5492 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5493 | run_test "Small server packet DTLS 1.2" \ |
| 5494 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5495 | "$P_CLI dtls=1 \ |
| 5496 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5497 | 0 \ |
| 5498 | -c "Read from server: 1 bytes read" |
| 5499 | |
| 5500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5501 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5502 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5503 | "$P_CLI dtls=1 \ |
| 5504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5505 | 0 \ |
| 5506 | -c "Read from server: 1 bytes read" |
| 5507 | |
| 5508 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5509 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5510 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 5511 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 5512 | "$P_CLI dtls=1 \ |
| 5513 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5514 | 0 \ |
| 5515 | -c "Read from server: 1 bytes read" |
| 5516 | |
| 5517 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5518 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5519 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 5520 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 5521 | "$P_CLI dtls=1 \ |
| 5522 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 5523 | 0 \ |
| 5524 | -c "Read from server: 1 bytes read" |
| 5525 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 5526 | # A test for extensions in SSLv3 |
| 5527 | |
| 5528 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5529 | run_test "SSLv3 with extensions, server side" \ |
| 5530 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 5531 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 5532 | 0 \ |
| 5533 | -S "dumping 'client hello extensions'" \ |
| 5534 | -S "server hello, total extension length:" |
| 5535 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5536 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5537 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5538 | # How many fragments do we expect to write $1 bytes? |
| 5539 | fragments_for_write() { |
| 5540 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5541 | } |
| 5542 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5543 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5544 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5545 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5546 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5547 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5548 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5549 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5550 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5551 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5553 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5554 | "$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] | 5555 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 5556 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5557 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5558 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5559 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5560 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5561 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5562 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5563 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5565 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5566 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5567 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5568 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5569 | 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] | 5570 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5571 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 5572 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5573 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5574 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5575 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5577 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5578 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5579 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5580 | 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] | 5581 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5582 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5583 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5584 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5585 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5586 | 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] | 5587 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5588 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5589 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5590 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5591 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5592 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5593 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5594 | "$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] | 5595 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5596 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5597 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5598 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5599 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5600 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5601 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5602 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5603 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5604 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5605 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5606 | |
| 5607 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5608 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5609 | "$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] | 5610 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5611 | 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] | 5612 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5613 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5614 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5615 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5616 | 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] | 5617 | "$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] | 5618 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5619 | 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] | 5620 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5621 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5622 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5623 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5624 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5625 | "$P_SRV" \ |
| 5626 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5627 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5628 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5629 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5630 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5631 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5632 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5633 | "$P_SRV" \ |
| 5634 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 5635 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5636 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5637 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5638 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5639 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5640 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5641 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5642 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5643 | 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] | 5644 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5645 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5646 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5647 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5648 | 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] | 5649 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5650 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5651 | 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] | 5652 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5653 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5654 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5655 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5656 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5657 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5658 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5659 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5660 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5661 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5662 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5663 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5664 | "$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] | 5665 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5666 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5667 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5668 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5669 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5670 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5671 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5672 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5673 | "$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] | 5674 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5675 | 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] | 5676 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5678 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5680 | 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] | 5681 | "$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] | 5682 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5683 | 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] | 5684 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5685 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5686 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5687 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5688 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5689 | "$P_SRV" \ |
| 5690 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5691 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5692 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5693 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5694 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5695 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5696 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5697 | "$P_SRV" \ |
| 5698 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5700 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5701 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5702 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5703 | 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] | 5704 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5705 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5706 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5707 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5708 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5709 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5710 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5711 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5712 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5713 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5714 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5715 | 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] | 5716 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5718 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5719 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5720 | 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] | 5721 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5722 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5723 | 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] | 5724 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5725 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5726 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5727 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5728 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5729 | "$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] | 5730 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5731 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5732 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5733 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5734 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5735 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5736 | 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] | 5737 | "$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] | 5738 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5739 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5740 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5741 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5742 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5743 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5744 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5745 | "$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] | 5746 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5747 | 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] | 5748 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5749 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5750 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5751 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5752 | 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] | 5753 | "$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] | 5754 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5755 | 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] | 5756 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5757 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5758 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5759 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5760 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5761 | "$P_SRV" \ |
| 5762 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5763 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5764 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5765 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5766 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5767 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5768 | 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] | 5769 | "$P_SRV" \ |
| 5770 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5771 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5772 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5773 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5774 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5775 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5776 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5777 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5778 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5779 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5780 | "$P_CLI force_version=ssl3 \ |
| 5781 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5782 | 0 \ |
| 5783 | -c "Read from server: 16384 bytes read" |
| 5784 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5785 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5786 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5787 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5788 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5789 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5790 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5791 | 0 \ |
| 5792 | -c "Read from server: 1 bytes read"\ |
| 5793 | -c "16383 bytes read"\ |
| 5794 | -C "Read from server: 16384 bytes read" |
| 5795 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5796 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5797 | "$P_SRV response_size=16384" \ |
| 5798 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5800 | 0 \ |
| 5801 | -c "Read from server: 1 bytes read"\ |
| 5802 | -c "16383 bytes read"\ |
| 5803 | -C "Read from server: 16384 bytes read" |
| 5804 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5805 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5806 | "$P_SRV response_size=16384" \ |
| 5807 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5809 | 0 \ |
| 5810 | -c "Read from server: 1 bytes read"\ |
| 5811 | -c "16383 bytes read"\ |
| 5812 | -C "Read from server: 16384 bytes read" |
| 5813 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5814 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5815 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5816 | "$P_SRV response_size=16384" \ |
| 5817 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5818 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5819 | trunc_hmac=1" \ |
| 5820 | 0 \ |
| 5821 | -c "Read from server: 1 bytes read"\ |
| 5822 | -c "16383 bytes read"\ |
| 5823 | -C "Read from server: 16384 bytes read" |
| 5824 | |
| 5825 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5826 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5827 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5828 | "$P_CLI force_version=tls1 \ |
| 5829 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5830 | trunc_hmac=1" \ |
| 5831 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5832 | -s "16384 bytes written in 1 fragments" \ |
| 5833 | -c "Read from server: 16384 bytes read" |
| 5834 | |
| 5835 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5836 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5837 | "$P_CLI force_version=tls1 \ |
| 5838 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5839 | 0 \ |
| 5840 | -s "16384 bytes written in 1 fragments" \ |
| 5841 | -c "Read from server: 16384 bytes read" |
| 5842 | |
| 5843 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5844 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5845 | "$P_CLI force_version=tls1 \ |
| 5846 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5847 | 0 \ |
| 5848 | -s "16384 bytes written in 1 fragments" \ |
| 5849 | -c "Read from server: 16384 bytes read" |
| 5850 | |
| 5851 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5852 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5853 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5854 | "$P_CLI force_version=tls1 \ |
| 5855 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5856 | 0 \ |
| 5857 | -s "16384 bytes written in 1 fragments" \ |
| 5858 | -c "Read from server: 16384 bytes read" |
| 5859 | |
| 5860 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5861 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5862 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5863 | "$P_CLI force_version=tls1 \ |
| 5864 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5865 | 0 \ |
| 5866 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5867 | -c "Read from server: 16384 bytes read" |
| 5868 | |
| 5869 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5870 | "$P_SRV response_size=16384" \ |
| 5871 | "$P_CLI force_version=tls1_1 \ |
| 5872 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5873 | 0 \ |
| 5874 | -c "Read from server: 16384 bytes read" |
| 5875 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5876 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5877 | "$P_SRV response_size=16384" \ |
| 5878 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5879 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5880 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5881 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5882 | -c "Read from server: 16384 bytes read" |
| 5883 | |
| 5884 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5885 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5886 | "$P_SRV response_size=16384" \ |
| 5887 | "$P_CLI force_version=tls1_1 \ |
| 5888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5889 | trunc_hmac=1" \ |
| 5890 | 0 \ |
| 5891 | -c "Read from server: 16384 bytes read" |
| 5892 | |
| 5893 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5894 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5895 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5896 | "$P_CLI force_version=tls1_1 \ |
| 5897 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5898 | 0 \ |
| 5899 | -s "16384 bytes written in 1 fragments" \ |
| 5900 | -c "Read from server: 16384 bytes read" |
| 5901 | |
| 5902 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5903 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5904 | "$P_CLI force_version=tls1_1 \ |
| 5905 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5906 | 0 \ |
| 5907 | -c "Read from server: 16384 bytes read" |
| 5908 | |
| 5909 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5910 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5911 | "$P_CLI force_version=tls1_1 \ |
| 5912 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5913 | 0 \ |
| 5914 | -s "16384 bytes written in 1 fragments" \ |
| 5915 | -c "Read from server: 16384 bytes read" |
| 5916 | |
| 5917 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5918 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5919 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5920 | "$P_CLI force_version=tls1_1 \ |
| 5921 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5922 | trunc_hmac=1" \ |
| 5923 | 0 \ |
| 5924 | -c "Read from server: 16384 bytes read" |
| 5925 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5926 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5927 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5928 | "$P_CLI force_version=tls1_1 \ |
| 5929 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5930 | 0 \ |
| 5931 | -s "16384 bytes written in 1 fragments" \ |
| 5932 | -c "Read from server: 16384 bytes read" |
| 5933 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5934 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5935 | "$P_SRV response_size=16384" \ |
| 5936 | "$P_CLI force_version=tls1_2 \ |
| 5937 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5938 | 0 \ |
| 5939 | -c "Read from server: 16384 bytes read" |
| 5940 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5941 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5942 | "$P_SRV response_size=16384" \ |
| 5943 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5944 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5945 | 0 \ |
| 5946 | -s "16384 bytes written in 1 fragments" \ |
| 5947 | -c "Read from server: 16384 bytes read" |
| 5948 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5949 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5950 | "$P_SRV response_size=16384" \ |
| 5951 | "$P_CLI force_version=tls1_2 \ |
| 5952 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5953 | 0 \ |
| 5954 | -c "Read from server: 16384 bytes read" |
| 5955 | |
| 5956 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5957 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5958 | "$P_SRV response_size=16384" \ |
| 5959 | "$P_CLI force_version=tls1_2 \ |
| 5960 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5961 | trunc_hmac=1" \ |
| 5962 | 0 \ |
| 5963 | -c "Read from server: 16384 bytes read" |
| 5964 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5965 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5966 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5967 | "$P_CLI force_version=tls1_2 \ |
| 5968 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5969 | 0 \ |
| 5970 | -s "16384 bytes written in 1 fragments" \ |
| 5971 | -c "Read from server: 16384 bytes read" |
| 5972 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5973 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5974 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5975 | "$P_CLI force_version=tls1_2 \ |
| 5976 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5977 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5978 | -s "16384 bytes written in 1 fragments" \ |
| 5979 | -c "Read from server: 16384 bytes read" |
| 5980 | |
| 5981 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5982 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5983 | "$P_CLI force_version=tls1_2 \ |
| 5984 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5985 | 0 \ |
| 5986 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5987 | -c "Read from server: 16384 bytes read" |
| 5988 | |
| 5989 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5990 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5991 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5992 | "$P_CLI force_version=tls1_2 \ |
| 5993 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5994 | trunc_hmac=1" \ |
| 5995 | 0 \ |
| 5996 | -c "Read from server: 16384 bytes read" |
| 5997 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5998 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5999 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6000 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6001 | "$P_CLI force_version=tls1_2 \ |
| 6002 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6003 | 0 \ |
| 6004 | -s "16384 bytes written in 1 fragments" \ |
| 6005 | -c "Read from server: 16384 bytes read" |
| 6006 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6007 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6008 | "$P_SRV response_size=16384" \ |
| 6009 | "$P_CLI force_version=tls1_2 \ |
| 6010 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6011 | 0 \ |
| 6012 | -c "Read from server: 16384 bytes read" |
| 6013 | |
| 6014 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6015 | "$P_SRV response_size=16384" \ |
| 6016 | "$P_CLI force_version=tls1_2 \ |
| 6017 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6018 | 0 \ |
| 6019 | -c "Read from server: 16384 bytes read" |
| 6020 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6021 | # Tests for restartable ECC |
| 6022 | |
| 6023 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6024 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6025 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6026 | "$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] | 6027 | 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] | 6028 | debug_level=1" \ |
| 6029 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6030 | -C "x509_verify_cert.*4b00" \ |
| 6031 | -C "mbedtls_pk_verify.*4b00" \ |
| 6032 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6033 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6034 | |
| 6035 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6036 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6037 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6038 | "$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] | 6039 | 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] | 6040 | debug_level=1 ec_max_ops=0" \ |
| 6041 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6042 | -C "x509_verify_cert.*4b00" \ |
| 6043 | -C "mbedtls_pk_verify.*4b00" \ |
| 6044 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6045 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6046 | |
| 6047 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6048 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6049 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6050 | "$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] | 6051 | 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] | 6052 | debug_level=1 ec_max_ops=65535" \ |
| 6053 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6054 | -C "x509_verify_cert.*4b00" \ |
| 6055 | -C "mbedtls_pk_verify.*4b00" \ |
| 6056 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6057 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6058 | |
| 6059 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6060 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6061 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6062 | "$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] | 6063 | 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] | 6064 | debug_level=1 ec_max_ops=1000" \ |
| 6065 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6066 | -c "x509_verify_cert.*4b00" \ |
| 6067 | -c "mbedtls_pk_verify.*4b00" \ |
| 6068 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6069 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6070 | |
| 6071 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6072 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6073 | "$P_SRV auth_mode=required \ |
| 6074 | crt_file=data_files/server5-badsign.crt \ |
| 6075 | key_file=data_files/server5.key" \ |
| 6076 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6077 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6078 | debug_level=1 ec_max_ops=1000" \ |
| 6079 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6080 | -c "x509_verify_cert.*4b00" \ |
| 6081 | -C "mbedtls_pk_verify.*4b00" \ |
| 6082 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6083 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6084 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6085 | -c "! mbedtls_ssl_handshake returned" \ |
| 6086 | -c "X509 - Certificate verification failed" |
| 6087 | |
| 6088 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6089 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6090 | "$P_SRV auth_mode=required \ |
| 6091 | crt_file=data_files/server5-badsign.crt \ |
| 6092 | key_file=data_files/server5.key" \ |
| 6093 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6094 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6095 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6096 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6097 | -c "x509_verify_cert.*4b00" \ |
| 6098 | -c "mbedtls_pk_verify.*4b00" \ |
| 6099 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6100 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6101 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6102 | -C "! mbedtls_ssl_handshake returned" \ |
| 6103 | -C "X509 - Certificate verification failed" |
| 6104 | |
| 6105 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6106 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6107 | "$P_SRV auth_mode=required \ |
| 6108 | crt_file=data_files/server5-badsign.crt \ |
| 6109 | key_file=data_files/server5.key" \ |
| 6110 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6111 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6112 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6113 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6114 | -C "x509_verify_cert.*4b00" \ |
| 6115 | -c "mbedtls_pk_verify.*4b00" \ |
| 6116 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6117 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6118 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6119 | -C "! mbedtls_ssl_handshake returned" \ |
| 6120 | -C "X509 - Certificate verification failed" |
| 6121 | |
| 6122 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6123 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6124 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6125 | "$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] | 6126 | 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] | 6127 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6128 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6129 | -c "x509_verify_cert.*4b00" \ |
| 6130 | -c "mbedtls_pk_verify.*4b00" \ |
| 6131 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6132 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6133 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6134 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6135 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6136 | "$P_SRV" \ |
| 6137 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6138 | debug_level=1 ec_max_ops=1000" \ |
| 6139 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6140 | -c "x509_verify_cert.*4b00" \ |
| 6141 | -c "mbedtls_pk_verify.*4b00" \ |
| 6142 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6143 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6144 | |
| 6145 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6146 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6147 | "$P_SRV psk=abc123" \ |
| 6148 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6149 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6150 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6151 | -C "x509_verify_cert.*4b00" \ |
| 6152 | -C "mbedtls_pk_verify.*4b00" \ |
| 6153 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6154 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6155 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6156 | # Tests of asynchronous private key support in SSL |
| 6157 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6159 | run_test "SSL async private: sign, delay=0" \ |
| 6160 | "$P_SRV \ |
| 6161 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6162 | "$P_CLI" \ |
| 6163 | 0 \ |
| 6164 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6165 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6166 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6167 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6168 | run_test "SSL async private: sign, delay=1" \ |
| 6169 | "$P_SRV \ |
| 6170 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6171 | "$P_CLI" \ |
| 6172 | 0 \ |
| 6173 | -s "Async sign callback: using key slot " \ |
| 6174 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6175 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6176 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6177 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6178 | run_test "SSL async private: sign, delay=2" \ |
| 6179 | "$P_SRV \ |
| 6180 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6181 | "$P_CLI" \ |
| 6182 | 0 \ |
| 6183 | -s "Async sign callback: using key slot " \ |
| 6184 | -U "Async sign callback: using key slot " \ |
| 6185 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6186 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6187 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6188 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6189 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6190 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6191 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6193 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6194 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6195 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6196 | "$P_CLI force_version=tls1_1" \ |
| 6197 | 0 \ |
| 6198 | -s "Async sign callback: using key slot " \ |
| 6199 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6200 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6201 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6202 | run_test "SSL async private: sign, SNI" \ |
| 6203 | "$P_SRV debug_level=3 \ |
| 6204 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6205 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6206 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6207 | "$P_CLI server_name=polarssl.example" \ |
| 6208 | 0 \ |
| 6209 | -s "Async sign callback: using key slot " \ |
| 6210 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6211 | -s "parse ServerName extension" \ |
| 6212 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6213 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6214 | |
| 6215 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6216 | run_test "SSL async private: decrypt, delay=0" \ |
| 6217 | "$P_SRV \ |
| 6218 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6219 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6220 | 0 \ |
| 6221 | -s "Async decrypt callback: using key slot " \ |
| 6222 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6223 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6224 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6225 | run_test "SSL async private: decrypt, delay=1" \ |
| 6226 | "$P_SRV \ |
| 6227 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6228 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6229 | 0 \ |
| 6230 | -s "Async decrypt callback: using key slot " \ |
| 6231 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6232 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6233 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6234 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6235 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6236 | "$P_SRV psk=abc123 \ |
| 6237 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6238 | "$P_CLI psk=abc123 \ |
| 6239 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6240 | 0 \ |
| 6241 | -s "Async decrypt callback: using key slot " \ |
| 6242 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6243 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6244 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6245 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6246 | "$P_SRV psk=abc123 \ |
| 6247 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6248 | "$P_CLI psk=abc123 \ |
| 6249 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6250 | 0 \ |
| 6251 | -s "Async decrypt callback: using key slot " \ |
| 6252 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6253 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6254 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6255 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6256 | run_test "SSL async private: sign callback not present" \ |
| 6257 | "$P_SRV \ |
| 6258 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6259 | "$P_CLI; [ \$? -eq 1 ] && |
| 6260 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6261 | 0 \ |
| 6262 | -S "Async sign callback" \ |
| 6263 | -s "! mbedtls_ssl_handshake returned" \ |
| 6264 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6265 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6266 | -s "Successful connection" |
| 6267 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6268 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6269 | run_test "SSL async private: decrypt callback not present" \ |
| 6270 | "$P_SRV debug_level=1 \ |
| 6271 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6272 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6273 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6274 | 0 \ |
| 6275 | -S "Async decrypt callback" \ |
| 6276 | -s "! mbedtls_ssl_handshake returned" \ |
| 6277 | -s "got no RSA private key" \ |
| 6278 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6279 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6280 | |
| 6281 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6282 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6283 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6284 | "$P_SRV \ |
| 6285 | async_operations=s async_private_delay1=1 \ |
| 6286 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6287 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6288 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6289 | 0 \ |
| 6290 | -s "Async sign callback: using key slot 0," \ |
| 6291 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6292 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6293 | |
| 6294 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6295 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6296 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6297 | "$P_SRV \ |
| 6298 | async_operations=s async_private_delay2=1 \ |
| 6299 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6300 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6301 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6302 | 0 \ |
| 6303 | -s "Async sign callback: using key slot 0," \ |
| 6304 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6305 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6306 | |
| 6307 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6308 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6309 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6310 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6311 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6312 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6313 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6314 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6315 | 0 \ |
| 6316 | -s "Async sign callback: using key slot 1," \ |
| 6317 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6318 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6319 | |
| 6320 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6321 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6322 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6323 | "$P_SRV \ |
| 6324 | async_operations=s async_private_delay1=1 \ |
| 6325 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6326 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6327 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6328 | 0 \ |
| 6329 | -s "Async sign callback: no key matches this certificate." |
| 6330 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6331 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6332 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6333 | "$P_SRV \ |
| 6334 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6335 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6336 | "$P_CLI" \ |
| 6337 | 1 \ |
| 6338 | -s "Async sign callback: injected error" \ |
| 6339 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6340 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6341 | -s "! mbedtls_ssl_handshake returned" |
| 6342 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6343 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6344 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6345 | "$P_SRV \ |
| 6346 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6347 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6348 | "$P_CLI" \ |
| 6349 | 1 \ |
| 6350 | -s "Async sign callback: using key slot " \ |
| 6351 | -S "Async resume" \ |
| 6352 | -s "Async cancel" |
| 6353 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6354 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6355 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6356 | "$P_SRV \ |
| 6357 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6358 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6359 | "$P_CLI" \ |
| 6360 | 1 \ |
| 6361 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6362 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6363 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6364 | -s "! mbedtls_ssl_handshake returned" |
| 6365 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6366 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6367 | run_test "SSL async private: decrypt, error in start" \ |
| 6368 | "$P_SRV \ |
| 6369 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6370 | async_private_error=1" \ |
| 6371 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6372 | 1 \ |
| 6373 | -s "Async decrypt callback: injected error" \ |
| 6374 | -S "Async resume" \ |
| 6375 | -S "Async cancel" \ |
| 6376 | -s "! mbedtls_ssl_handshake returned" |
| 6377 | |
| 6378 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6379 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6380 | "$P_SRV \ |
| 6381 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6382 | async_private_error=2" \ |
| 6383 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6384 | 1 \ |
| 6385 | -s "Async decrypt callback: using key slot " \ |
| 6386 | -S "Async resume" \ |
| 6387 | -s "Async cancel" |
| 6388 | |
| 6389 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6390 | run_test "SSL async private: decrypt, error in resume" \ |
| 6391 | "$P_SRV \ |
| 6392 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6393 | async_private_error=3" \ |
| 6394 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6395 | 1 \ |
| 6396 | -s "Async decrypt callback: using key slot " \ |
| 6397 | -s "Async resume callback: decrypt done but injected error" \ |
| 6398 | -S "Async cancel" \ |
| 6399 | -s "! mbedtls_ssl_handshake returned" |
| 6400 | |
| 6401 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6402 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6403 | "$P_SRV \ |
| 6404 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6405 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6406 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6407 | 0 \ |
| 6408 | -s "Async cancel" \ |
| 6409 | -s "! mbedtls_ssl_handshake returned" \ |
| 6410 | -s "Async resume" \ |
| 6411 | -s "Successful connection" |
| 6412 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6414 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6415 | "$P_SRV \ |
| 6416 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6417 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6418 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6419 | 0 \ |
| 6420 | -s "! mbedtls_ssl_handshake returned" \ |
| 6421 | -s "Async resume" \ |
| 6422 | -s "Successful connection" |
| 6423 | |
| 6424 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6425 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6426 | 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] | 6427 | "$P_SRV \ |
| 6428 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6429 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6430 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6431 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6432 | [ \$? -eq 1 ] && |
| 6433 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6434 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6435 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6436 | -S "Async resume" \ |
| 6437 | -s "Async cancel" \ |
| 6438 | -s "! mbedtls_ssl_handshake returned" \ |
| 6439 | -s "Async sign callback: no key matches this certificate." \ |
| 6440 | -s "Successful connection" |
| 6441 | |
| 6442 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6444 | 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] | 6445 | "$P_SRV \ |
| 6446 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6447 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6448 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6449 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6450 | [ \$? -eq 1 ] && |
| 6451 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6452 | 0 \ |
| 6453 | -s "Async resume" \ |
| 6454 | -s "! mbedtls_ssl_handshake returned" \ |
| 6455 | -s "Async sign callback: no key matches this certificate." \ |
| 6456 | -s "Successful connection" |
| 6457 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6458 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6460 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6461 | "$P_SRV \ |
| 6462 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6463 | exchanges=2 renegotiation=1" \ |
| 6464 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6465 | 0 \ |
| 6466 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6467 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6468 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6469 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6471 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 6472 | "$P_SRV \ |
| 6473 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6474 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6475 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6476 | 0 \ |
| 6477 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6478 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6479 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6481 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6482 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 6483 | "$P_SRV \ |
| 6484 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6485 | exchanges=2 renegotiation=1" \ |
| 6486 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6487 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6488 | 0 \ |
| 6489 | -s "Async decrypt callback: using key slot " \ |
| 6490 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6491 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6492 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6493 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6494 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 6495 | "$P_SRV \ |
| 6496 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6497 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6498 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6499 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6500 | 0 \ |
| 6501 | -s "Async decrypt callback: using key slot " \ |
| 6502 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6503 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6504 | # Tests for ECC extensions (rfc 4492) |
| 6505 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6506 | requires_config_enabled MBEDTLS_AES_C |
| 6507 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6508 | requires_config_enabled MBEDTLS_SHA256_C |
| 6509 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6510 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6511 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6512 | "$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] | 6513 | 0 \ |
| 6514 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6515 | -C "client hello, adding supported_point_formats extension" \ |
| 6516 | -S "found supported elliptic curves extension" \ |
| 6517 | -S "found supported point formats extension" |
| 6518 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6519 | requires_config_enabled MBEDTLS_AES_C |
| 6520 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6521 | requires_config_enabled MBEDTLS_SHA256_C |
| 6522 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6523 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6524 | "$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] | 6525 | "$P_CLI debug_level=3" \ |
| 6526 | 0 \ |
| 6527 | -C "found supported_point_formats extension" \ |
| 6528 | -S "server hello, supported_point_formats extension" |
| 6529 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6530 | requires_config_enabled MBEDTLS_AES_C |
| 6531 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6532 | requires_config_enabled MBEDTLS_SHA256_C |
| 6533 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6534 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6535 | "$P_SRV debug_level=3" \ |
| 6536 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6537 | 0 \ |
| 6538 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6539 | -c "client hello, adding supported_point_formats extension" \ |
| 6540 | -s "found supported elliptic curves extension" \ |
| 6541 | -s "found supported point formats extension" |
| 6542 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6543 | requires_config_enabled MBEDTLS_AES_C |
| 6544 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6545 | requires_config_enabled MBEDTLS_SHA256_C |
| 6546 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6547 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6548 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6549 | "$P_CLI debug_level=3" \ |
| 6550 | 0 \ |
| 6551 | -c "found supported_point_formats extension" \ |
| 6552 | -s "server hello, supported_point_formats extension" |
| 6553 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6554 | # Tests for DTLS HelloVerifyRequest |
| 6555 | |
| 6556 | run_test "DTLS cookie: enabled" \ |
| 6557 | "$P_SRV dtls=1 debug_level=2" \ |
| 6558 | "$P_CLI dtls=1 debug_level=2" \ |
| 6559 | 0 \ |
| 6560 | -s "cookie verification failed" \ |
| 6561 | -s "cookie verification passed" \ |
| 6562 | -S "cookie verification skipped" \ |
| 6563 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6564 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6565 | -S "SSL - The requested feature is not available" |
| 6566 | |
| 6567 | run_test "DTLS cookie: disabled" \ |
| 6568 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6569 | "$P_CLI dtls=1 debug_level=2" \ |
| 6570 | 0 \ |
| 6571 | -S "cookie verification failed" \ |
| 6572 | -S "cookie verification passed" \ |
| 6573 | -s "cookie verification skipped" \ |
| 6574 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6575 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6576 | -S "SSL - The requested feature is not available" |
| 6577 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6578 | run_test "DTLS cookie: default (failing)" \ |
| 6579 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6580 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6581 | 1 \ |
| 6582 | -s "cookie verification failed" \ |
| 6583 | -S "cookie verification passed" \ |
| 6584 | -S "cookie verification skipped" \ |
| 6585 | -C "received hello verify request" \ |
| 6586 | -S "hello verification requested" \ |
| 6587 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6588 | |
| 6589 | requires_ipv6 |
| 6590 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6591 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6592 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6593 | 0 \ |
| 6594 | -s "cookie verification failed" \ |
| 6595 | -s "cookie verification passed" \ |
| 6596 | -S "cookie verification skipped" \ |
| 6597 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6598 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6599 | -S "SSL - The requested feature is not available" |
| 6600 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6601 | run_test "DTLS cookie: enabled, nbio" \ |
| 6602 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6603 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6604 | 0 \ |
| 6605 | -s "cookie verification failed" \ |
| 6606 | -s "cookie verification passed" \ |
| 6607 | -S "cookie verification skipped" \ |
| 6608 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6609 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6610 | -S "SSL - The requested feature is not available" |
| 6611 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6612 | # Tests for client reconnecting from the same port with DTLS |
| 6613 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6614 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6615 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6616 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6617 | "$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] | 6618 | 0 \ |
| 6619 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6620 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6621 | -S "Client initiated reconnection from same port" |
| 6622 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6623 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6624 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6625 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 6626 | "$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] | 6627 | 0 \ |
| 6628 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6629 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6630 | -s "Client initiated reconnection from same port" |
| 6631 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6632 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6633 | 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] | 6634 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6635 | "$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] | 6636 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6637 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6638 | -s "Client initiated reconnection from same port" |
| 6639 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6640 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6641 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6642 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6643 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6644 | 0 \ |
| 6645 | -S "The operation timed out" \ |
| 6646 | -s "Client initiated reconnection from same port" |
| 6647 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6648 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6649 | "$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] | 6650 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6651 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6652 | -s "The operation timed out" \ |
| 6653 | -S "Client initiated reconnection from same port" |
| 6654 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6655 | # Tests for various cases of client authentication with DTLS |
| 6656 | # (focused on handshake flows and message parsing) |
| 6657 | |
| 6658 | run_test "DTLS client auth: required" \ |
| 6659 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6660 | "$P_CLI dtls=1" \ |
| 6661 | 0 \ |
| 6662 | -s "Verifying peer X.509 certificate... ok" |
| 6663 | |
| 6664 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6665 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6666 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6667 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6668 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6669 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6670 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6671 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6672 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6673 | 0 \ |
| 6674 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6675 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6676 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6677 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6678 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6679 | "$P_CLI dtls=1 psk=abc124" \ |
| 6680 | 1 \ |
| 6681 | -s "SSL - Verification of the message MAC failed" \ |
| 6682 | -c "SSL - A fatal alert message was received from our peer" |
| 6683 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6684 | # Tests for receiving fragmented handshake messages with DTLS |
| 6685 | |
| 6686 | requires_gnutls |
| 6687 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6688 | "$G_SRV -u --mtu 2048 -a" \ |
| 6689 | "$P_CLI dtls=1 debug_level=2" \ |
| 6690 | 0 \ |
| 6691 | -C "found fragmented DTLS handshake message" \ |
| 6692 | -C "error" |
| 6693 | |
| 6694 | requires_gnutls |
| 6695 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6696 | "$G_SRV -u --mtu 512" \ |
| 6697 | "$P_CLI dtls=1 debug_level=2" \ |
| 6698 | 0 \ |
| 6699 | -c "found fragmented DTLS handshake message" \ |
| 6700 | -C "error" |
| 6701 | |
| 6702 | requires_gnutls |
| 6703 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6704 | "$G_SRV -u --mtu 128" \ |
| 6705 | "$P_CLI dtls=1 debug_level=2" \ |
| 6706 | 0 \ |
| 6707 | -c "found fragmented DTLS handshake message" \ |
| 6708 | -C "error" |
| 6709 | |
| 6710 | requires_gnutls |
| 6711 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6712 | "$G_SRV -u --mtu 128" \ |
| 6713 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6714 | 0 \ |
| 6715 | -c "found fragmented DTLS handshake message" \ |
| 6716 | -C "error" |
| 6717 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6718 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6719 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6720 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6721 | "$G_SRV -u --mtu 256" \ |
| 6722 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6723 | 0 \ |
| 6724 | -c "found fragmented DTLS handshake message" \ |
| 6725 | -c "client hello, adding renegotiation extension" \ |
| 6726 | -c "found renegotiation extension" \ |
| 6727 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6728 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6729 | -C "error" \ |
| 6730 | -s "Extra-header:" |
| 6731 | |
| 6732 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6733 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6734 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6735 | "$G_SRV -u --mtu 256" \ |
| 6736 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6737 | 0 \ |
| 6738 | -c "found fragmented DTLS handshake message" \ |
| 6739 | -c "client hello, adding renegotiation extension" \ |
| 6740 | -c "found renegotiation extension" \ |
| 6741 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6742 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6743 | -C "error" \ |
| 6744 | -s "Extra-header:" |
| 6745 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6746 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6747 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6748 | "$P_CLI dtls=1 debug_level=2" \ |
| 6749 | 0 \ |
| 6750 | -C "found fragmented DTLS handshake message" \ |
| 6751 | -C "error" |
| 6752 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6753 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6754 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6755 | "$P_CLI dtls=1 debug_level=2" \ |
| 6756 | 0 \ |
| 6757 | -c "found fragmented DTLS handshake message" \ |
| 6758 | -C "error" |
| 6759 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6760 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6761 | "$O_SRV -dtls1 -mtu 256" \ |
| 6762 | "$P_CLI dtls=1 debug_level=2" \ |
| 6763 | 0 \ |
| 6764 | -c "found fragmented DTLS handshake message" \ |
| 6765 | -C "error" |
| 6766 | |
| 6767 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6768 | "$O_SRV -dtls1 -mtu 256" \ |
| 6769 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6770 | 0 \ |
| 6771 | -c "found fragmented DTLS handshake message" \ |
| 6772 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6773 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6774 | # Tests for sending fragmented handshake messages with DTLS |
| 6775 | # |
| 6776 | # Use client auth when we need the client to send large messages, |
| 6777 | # and use large cert chains on both sides too (the long chains we have all use |
| 6778 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6779 | # Sizes reached (UDP payload): |
| 6780 | # - 2037B for server certificate |
| 6781 | # - 1542B for client certificate |
| 6782 | # - 1013B for newsessionticket |
| 6783 | # - all others below 512B |
| 6784 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6785 | |
| 6786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6787 | requires_config_enabled MBEDTLS_RSA_C |
| 6788 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6789 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6790 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6791 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6792 | crt_file=data_files/server7_int-ca.crt \ |
| 6793 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6794 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6795 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6796 | "$P_CLI dtls=1 debug_level=2 \ |
| 6797 | crt_file=data_files/server8_int-ca2.crt \ |
| 6798 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6799 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6800 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6801 | 0 \ |
| 6802 | -S "found fragmented DTLS handshake message" \ |
| 6803 | -C "found fragmented DTLS handshake message" \ |
| 6804 | -C "error" |
| 6805 | |
| 6806 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6807 | requires_config_enabled MBEDTLS_RSA_C |
| 6808 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6809 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6810 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6811 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6812 | crt_file=data_files/server7_int-ca.crt \ |
| 6813 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6814 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6815 | max_frag_len=1024" \ |
| 6816 | "$P_CLI dtls=1 debug_level=2 \ |
| 6817 | crt_file=data_files/server8_int-ca2.crt \ |
| 6818 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6819 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6820 | max_frag_len=2048" \ |
| 6821 | 0 \ |
| 6822 | -S "found fragmented DTLS handshake message" \ |
| 6823 | -c "found fragmented DTLS handshake message" \ |
| 6824 | -C "error" |
| 6825 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6826 | # With the MFL extension, the server has no way of forcing |
| 6827 | # the client to not exceed a certain MTU; hence, the following |
| 6828 | # test can't be replicated with an MTU proxy such as the one |
| 6829 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6831 | requires_config_enabled MBEDTLS_RSA_C |
| 6832 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6833 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6834 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6835 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6836 | crt_file=data_files/server7_int-ca.crt \ |
| 6837 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6838 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6839 | max_frag_len=512" \ |
| 6840 | "$P_CLI dtls=1 debug_level=2 \ |
| 6841 | crt_file=data_files/server8_int-ca2.crt \ |
| 6842 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6843 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6844 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6845 | 0 \ |
| 6846 | -S "found fragmented DTLS handshake message" \ |
| 6847 | -c "found fragmented DTLS handshake message" \ |
| 6848 | -C "error" |
| 6849 | |
| 6850 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6851 | requires_config_enabled MBEDTLS_RSA_C |
| 6852 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6853 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6854 | 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] | 6855 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6856 | crt_file=data_files/server7_int-ca.crt \ |
| 6857 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6858 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6859 | max_frag_len=2048" \ |
| 6860 | "$P_CLI dtls=1 debug_level=2 \ |
| 6861 | crt_file=data_files/server8_int-ca2.crt \ |
| 6862 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6863 | hs_timeout=2500-60000 \ |
| 6864 | max_frag_len=1024" \ |
| 6865 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6866 | -S "found fragmented DTLS handshake message" \ |
| 6867 | -c "found fragmented DTLS handshake message" \ |
| 6868 | -C "error" |
| 6869 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6870 | # While not required by the standard defining the MFL extension |
| 6871 | # (according to which it only applies to records, not to datagrams), |
| 6872 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6873 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6874 | # to the peer. |
| 6875 | # The next test checks that no datagrams significantly larger than the |
| 6876 | # negotiated MFL are sent. |
| 6877 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6878 | requires_config_enabled MBEDTLS_RSA_C |
| 6879 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6880 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6881 | 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] | 6882 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6883 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6884 | crt_file=data_files/server7_int-ca.crt \ |
| 6885 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6886 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6887 | max_frag_len=2048" \ |
| 6888 | "$P_CLI dtls=1 debug_level=2 \ |
| 6889 | crt_file=data_files/server8_int-ca2.crt \ |
| 6890 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6891 | hs_timeout=2500-60000 \ |
| 6892 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6893 | 0 \ |
| 6894 | -S "found fragmented DTLS handshake message" \ |
| 6895 | -c "found fragmented DTLS handshake message" \ |
| 6896 | -C "error" |
| 6897 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6898 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6899 | requires_config_enabled MBEDTLS_RSA_C |
| 6900 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6901 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6902 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6903 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6904 | crt_file=data_files/server7_int-ca.crt \ |
| 6905 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6906 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6907 | max_frag_len=2048" \ |
| 6908 | "$P_CLI dtls=1 debug_level=2 \ |
| 6909 | crt_file=data_files/server8_int-ca2.crt \ |
| 6910 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6911 | hs_timeout=2500-60000 \ |
| 6912 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6913 | 0 \ |
| 6914 | -s "found fragmented DTLS handshake message" \ |
| 6915 | -c "found fragmented DTLS handshake message" \ |
| 6916 | -C "error" |
| 6917 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6918 | # While not required by the standard defining the MFL extension |
| 6919 | # (according to which it only applies to records, not to datagrams), |
| 6920 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6921 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6922 | # to the peer. |
| 6923 | # The next test checks that no datagrams significantly larger than the |
| 6924 | # negotiated MFL are sent. |
| 6925 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6926 | requires_config_enabled MBEDTLS_RSA_C |
| 6927 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6928 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6929 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6930 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6931 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6932 | crt_file=data_files/server7_int-ca.crt \ |
| 6933 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6934 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6935 | max_frag_len=2048" \ |
| 6936 | "$P_CLI dtls=1 debug_level=2 \ |
| 6937 | crt_file=data_files/server8_int-ca2.crt \ |
| 6938 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6939 | hs_timeout=2500-60000 \ |
| 6940 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6941 | 0 \ |
| 6942 | -s "found fragmented DTLS handshake message" \ |
| 6943 | -c "found fragmented DTLS handshake message" \ |
| 6944 | -C "error" |
| 6945 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6946 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6947 | requires_config_enabled MBEDTLS_RSA_C |
| 6948 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6949 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6950 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6951 | crt_file=data_files/server7_int-ca.crt \ |
| 6952 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6953 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6954 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6955 | "$P_CLI dtls=1 debug_level=2 \ |
| 6956 | crt_file=data_files/server8_int-ca2.crt \ |
| 6957 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6958 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6959 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6960 | 0 \ |
| 6961 | -S "found fragmented DTLS handshake message" \ |
| 6962 | -C "found fragmented DTLS handshake message" \ |
| 6963 | -C "error" |
| 6964 | |
| 6965 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6966 | requires_config_enabled MBEDTLS_RSA_C |
| 6967 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6968 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6969 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6970 | crt_file=data_files/server7_int-ca.crt \ |
| 6971 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6972 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6973 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6974 | "$P_CLI dtls=1 debug_level=2 \ |
| 6975 | crt_file=data_files/server8_int-ca2.crt \ |
| 6976 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6977 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6978 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6979 | 0 \ |
| 6980 | -s "found fragmented DTLS handshake message" \ |
| 6981 | -C "found fragmented DTLS handshake message" \ |
| 6982 | -C "error" |
| 6983 | |
| 6984 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6985 | requires_config_enabled MBEDTLS_RSA_C |
| 6986 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6987 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6988 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6989 | crt_file=data_files/server7_int-ca.crt \ |
| 6990 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6991 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6992 | mtu=512" \ |
| 6993 | "$P_CLI dtls=1 debug_level=2 \ |
| 6994 | crt_file=data_files/server8_int-ca2.crt \ |
| 6995 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6996 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6997 | mtu=2048" \ |
| 6998 | 0 \ |
| 6999 | -S "found fragmented DTLS handshake message" \ |
| 7000 | -c "found fragmented DTLS handshake message" \ |
| 7001 | -C "error" |
| 7002 | |
| 7003 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7004 | requires_config_enabled MBEDTLS_RSA_C |
| 7005 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7006 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7007 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7008 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7009 | crt_file=data_files/server7_int-ca.crt \ |
| 7010 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7011 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7012 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7013 | "$P_CLI dtls=1 debug_level=2 \ |
| 7014 | crt_file=data_files/server8_int-ca2.crt \ |
| 7015 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7016 | hs_timeout=2500-60000 \ |
| 7017 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7018 | 0 \ |
| 7019 | -s "found fragmented DTLS handshake message" \ |
| 7020 | -c "found fragmented DTLS handshake message" \ |
| 7021 | -C "error" |
| 7022 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7023 | # 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] | 7024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7025 | requires_config_enabled MBEDTLS_RSA_C |
| 7026 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7027 | requires_config_enabled MBEDTLS_SHA256_C |
| 7028 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7029 | requires_config_enabled MBEDTLS_AES_C |
| 7030 | requires_config_enabled MBEDTLS_GCM_C |
| 7031 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7032 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7033 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7034 | crt_file=data_files/server7_int-ca.crt \ |
| 7035 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7036 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7037 | mtu=512" \ |
| 7038 | "$P_CLI dtls=1 debug_level=2 \ |
| 7039 | crt_file=data_files/server8_int-ca2.crt \ |
| 7040 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7041 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7042 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7043 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7044 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7045 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7046 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7047 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7048 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7049 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7050 | # 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] | 7051 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7052 | # retransmissions, but in some cases (like both the server and client using |
| 7053 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7054 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7055 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7057 | requires_config_enabled MBEDTLS_RSA_C |
| 7058 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7060 | requires_config_enabled MBEDTLS_AES_C |
| 7061 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7062 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7063 | -p "$P_PXY mtu=508" \ |
| 7064 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7065 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7066 | key_file=data_files/server7.key \ |
| 7067 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7068 | "$P_CLI dtls=1 debug_level=2 \ |
| 7069 | crt_file=data_files/server8_int-ca2.crt \ |
| 7070 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7071 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7072 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7073 | 0 \ |
| 7074 | -s "found fragmented DTLS handshake message" \ |
| 7075 | -c "found fragmented DTLS handshake message" \ |
| 7076 | -C "error" |
| 7077 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7078 | # 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] | 7079 | only_with_valgrind |
| 7080 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7081 | requires_config_enabled MBEDTLS_RSA_C |
| 7082 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7084 | requires_config_enabled MBEDTLS_AES_C |
| 7085 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7086 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7087 | -p "$P_PXY mtu=508" \ |
| 7088 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7089 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7090 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7091 | hs_timeout=250-10000" \ |
| 7092 | "$P_CLI dtls=1 debug_level=2 \ |
| 7093 | crt_file=data_files/server8_int-ca2.crt \ |
| 7094 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7095 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7096 | hs_timeout=250-10000" \ |
| 7097 | 0 \ |
| 7098 | -s "found fragmented DTLS handshake message" \ |
| 7099 | -c "found fragmented DTLS handshake message" \ |
| 7100 | -C "error" |
| 7101 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7102 | # 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] | 7103 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7104 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7105 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7106 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7107 | requires_config_enabled MBEDTLS_RSA_C |
| 7108 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7109 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7110 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7111 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7112 | crt_file=data_files/server7_int-ca.crt \ |
| 7113 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7114 | hs_timeout=10000-60000 \ |
| 7115 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7116 | "$P_CLI dtls=1 debug_level=2 \ |
| 7117 | crt_file=data_files/server8_int-ca2.crt \ |
| 7118 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7119 | hs_timeout=10000-60000 \ |
| 7120 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7121 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7122 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7123 | -s "found fragmented DTLS handshake message" \ |
| 7124 | -c "found fragmented DTLS handshake message" \ |
| 7125 | -C "error" |
| 7126 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7127 | # 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] | 7128 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7129 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7130 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7131 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7132 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7133 | requires_config_enabled MBEDTLS_RSA_C |
| 7134 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7135 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7136 | requires_config_enabled MBEDTLS_AES_C |
| 7137 | requires_config_enabled MBEDTLS_GCM_C |
| 7138 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7139 | -p "$P_PXY mtu=512" \ |
| 7140 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7141 | crt_file=data_files/server7_int-ca.crt \ |
| 7142 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7143 | hs_timeout=10000-60000 \ |
| 7144 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7145 | "$P_CLI dtls=1 debug_level=2 \ |
| 7146 | crt_file=data_files/server8_int-ca2.crt \ |
| 7147 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7148 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7149 | hs_timeout=10000-60000 \ |
| 7150 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7151 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7152 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7153 | -s "found fragmented DTLS handshake message" \ |
| 7154 | -c "found fragmented DTLS handshake message" \ |
| 7155 | -C "error" |
| 7156 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7157 | not_with_valgrind # spurious autoreduction due to timeout |
| 7158 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7159 | requires_config_enabled MBEDTLS_RSA_C |
| 7160 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7161 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7162 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7163 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7164 | crt_file=data_files/server7_int-ca.crt \ |
| 7165 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7166 | hs_timeout=10000-60000 \ |
| 7167 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7168 | "$P_CLI dtls=1 debug_level=2 \ |
| 7169 | crt_file=data_files/server8_int-ca2.crt \ |
| 7170 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7171 | hs_timeout=10000-60000 \ |
| 7172 | mtu=1024 nbio=2" \ |
| 7173 | 0 \ |
| 7174 | -S "autoreduction" \ |
| 7175 | -s "found fragmented DTLS handshake message" \ |
| 7176 | -c "found fragmented DTLS handshake message" \ |
| 7177 | -C "error" |
| 7178 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7179 | # 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] | 7180 | not_with_valgrind # spurious autoreduction due to timeout |
| 7181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7182 | requires_config_enabled MBEDTLS_RSA_C |
| 7183 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7184 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7185 | requires_config_enabled MBEDTLS_AES_C |
| 7186 | requires_config_enabled MBEDTLS_GCM_C |
| 7187 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7188 | -p "$P_PXY mtu=512" \ |
| 7189 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7190 | crt_file=data_files/server7_int-ca.crt \ |
| 7191 | key_file=data_files/server7.key \ |
| 7192 | hs_timeout=10000-60000 \ |
| 7193 | mtu=512 nbio=2" \ |
| 7194 | "$P_CLI dtls=1 debug_level=2 \ |
| 7195 | crt_file=data_files/server8_int-ca2.crt \ |
| 7196 | key_file=data_files/server8.key \ |
| 7197 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7198 | hs_timeout=10000-60000 \ |
| 7199 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7200 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7201 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7202 | -s "found fragmented DTLS handshake message" \ |
| 7203 | -c "found fragmented DTLS handshake message" \ |
| 7204 | -C "error" |
| 7205 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7206 | # 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] | 7207 | # This ensures things still work after session_reset(). |
| 7208 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7209 | # Since we don't support reading fragmented ClientHello yet, |
| 7210 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7211 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7212 | # An autoreduction on the client-side might happen if the server is |
| 7213 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7214 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7215 | # resumed listening, which would result in a spurious autoreduction. |
| 7216 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7217 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7218 | requires_config_enabled MBEDTLS_RSA_C |
| 7219 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7220 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7221 | requires_config_enabled MBEDTLS_AES_C |
| 7222 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7223 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7224 | -p "$P_PXY mtu=1450" \ |
| 7225 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7226 | crt_file=data_files/server7_int-ca.crt \ |
| 7227 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7228 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7229 | mtu=1450" \ |
| 7230 | "$P_CLI dtls=1 debug_level=2 \ |
| 7231 | crt_file=data_files/server8_int-ca2.crt \ |
| 7232 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7233 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7234 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7235 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7236 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7237 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7238 | -s "found fragmented DTLS handshake message" \ |
| 7239 | -c "found fragmented DTLS handshake message" \ |
| 7240 | -C "error" |
| 7241 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7242 | # An autoreduction on the client-side might happen if the server is |
| 7243 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7244 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7245 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7246 | requires_config_enabled MBEDTLS_RSA_C |
| 7247 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7248 | requires_config_enabled MBEDTLS_SHA256_C |
| 7249 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7250 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7251 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7252 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7253 | -p "$P_PXY mtu=512" \ |
| 7254 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7255 | crt_file=data_files/server7_int-ca.crt \ |
| 7256 | key_file=data_files/server7.key \ |
| 7257 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7258 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7259 | mtu=512" \ |
| 7260 | "$P_CLI dtls=1 debug_level=2 \ |
| 7261 | crt_file=data_files/server8_int-ca2.crt \ |
| 7262 | key_file=data_files/server8.key \ |
| 7263 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7264 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7265 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7266 | mtu=512" \ |
| 7267 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7268 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7269 | -s "found fragmented DTLS handshake message" \ |
| 7270 | -c "found fragmented DTLS handshake message" \ |
| 7271 | -C "error" |
| 7272 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7273 | # An autoreduction on the client-side might happen if the server is |
| 7274 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7275 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7277 | requires_config_enabled MBEDTLS_RSA_C |
| 7278 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7279 | requires_config_enabled MBEDTLS_SHA256_C |
| 7280 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7282 | requires_config_enabled MBEDTLS_AES_C |
| 7283 | requires_config_enabled MBEDTLS_GCM_C |
| 7284 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7285 | -p "$P_PXY mtu=512" \ |
| 7286 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7287 | crt_file=data_files/server7_int-ca.crt \ |
| 7288 | key_file=data_files/server7.key \ |
| 7289 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7290 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7291 | mtu=512" \ |
| 7292 | "$P_CLI dtls=1 debug_level=2 \ |
| 7293 | crt_file=data_files/server8_int-ca2.crt \ |
| 7294 | key_file=data_files/server8.key \ |
| 7295 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7296 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7297 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7298 | mtu=512" \ |
| 7299 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7300 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7301 | -s "found fragmented DTLS handshake message" \ |
| 7302 | -c "found fragmented DTLS handshake message" \ |
| 7303 | -C "error" |
| 7304 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7305 | # An autoreduction on the client-side might happen if the server is |
| 7306 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7307 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7309 | requires_config_enabled MBEDTLS_RSA_C |
| 7310 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7311 | requires_config_enabled MBEDTLS_SHA256_C |
| 7312 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7314 | requires_config_enabled MBEDTLS_AES_C |
| 7315 | requires_config_enabled MBEDTLS_CCM_C |
| 7316 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7317 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7318 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7319 | crt_file=data_files/server7_int-ca.crt \ |
| 7320 | key_file=data_files/server7.key \ |
| 7321 | exchanges=2 renegotiation=1 \ |
| 7322 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7323 | hs_timeout=10000-60000 \ |
| 7324 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7325 | "$P_CLI dtls=1 debug_level=2 \ |
| 7326 | crt_file=data_files/server8_int-ca2.crt \ |
| 7327 | key_file=data_files/server8.key \ |
| 7328 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7329 | hs_timeout=10000-60000 \ |
| 7330 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7331 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7332 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7333 | -s "found fragmented DTLS handshake message" \ |
| 7334 | -c "found fragmented DTLS handshake message" \ |
| 7335 | -C "error" |
| 7336 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7337 | # An autoreduction on the client-side might happen if the server is |
| 7338 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7339 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7340 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7341 | requires_config_enabled MBEDTLS_RSA_C |
| 7342 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7343 | requires_config_enabled MBEDTLS_SHA256_C |
| 7344 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7346 | requires_config_enabled MBEDTLS_AES_C |
| 7347 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7348 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7349 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7350 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7351 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7352 | crt_file=data_files/server7_int-ca.crt \ |
| 7353 | key_file=data_files/server7.key \ |
| 7354 | exchanges=2 renegotiation=1 \ |
| 7355 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7356 | hs_timeout=10000-60000 \ |
| 7357 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7358 | "$P_CLI dtls=1 debug_level=2 \ |
| 7359 | crt_file=data_files/server8_int-ca2.crt \ |
| 7360 | key_file=data_files/server8.key \ |
| 7361 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7362 | hs_timeout=10000-60000 \ |
| 7363 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7364 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7365 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7366 | -s "found fragmented DTLS handshake message" \ |
| 7367 | -c "found fragmented DTLS handshake message" \ |
| 7368 | -C "error" |
| 7369 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7370 | # An autoreduction on the client-side might happen if the server is |
| 7371 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7372 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7373 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7374 | requires_config_enabled MBEDTLS_RSA_C |
| 7375 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7376 | requires_config_enabled MBEDTLS_SHA256_C |
| 7377 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7378 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7379 | requires_config_enabled MBEDTLS_AES_C |
| 7380 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7381 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7382 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7383 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7384 | crt_file=data_files/server7_int-ca.crt \ |
| 7385 | key_file=data_files/server7.key \ |
| 7386 | exchanges=2 renegotiation=1 \ |
| 7387 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7388 | hs_timeout=10000-60000 \ |
| 7389 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7390 | "$P_CLI dtls=1 debug_level=2 \ |
| 7391 | crt_file=data_files/server8_int-ca2.crt \ |
| 7392 | key_file=data_files/server8.key \ |
| 7393 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7394 | hs_timeout=10000-60000 \ |
| 7395 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7396 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7397 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7398 | -s "found fragmented DTLS handshake message" \ |
| 7399 | -c "found fragmented DTLS handshake message" \ |
| 7400 | -C "error" |
| 7401 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7402 | # 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] | 7403 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7404 | requires_config_enabled MBEDTLS_RSA_C |
| 7405 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7406 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7407 | requires_config_enabled MBEDTLS_AES_C |
| 7408 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7409 | client_needs_more_time 2 |
| 7410 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7411 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7412 | "$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] | 7413 | crt_file=data_files/server7_int-ca.crt \ |
| 7414 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7415 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7416 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7417 | crt_file=data_files/server8_int-ca2.crt \ |
| 7418 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7419 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7420 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7421 | 0 \ |
| 7422 | -s "found fragmented DTLS handshake message" \ |
| 7423 | -c "found fragmented DTLS handshake message" \ |
| 7424 | -C "error" |
| 7425 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7426 | # 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] | 7427 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7428 | requires_config_enabled MBEDTLS_RSA_C |
| 7429 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7430 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7431 | requires_config_enabled MBEDTLS_AES_C |
| 7432 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7433 | client_needs_more_time 2 |
| 7434 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7435 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7436 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7437 | crt_file=data_files/server7_int-ca.crt \ |
| 7438 | key_file=data_files/server7.key \ |
| 7439 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7440 | "$P_CLI dtls=1 debug_level=2 \ |
| 7441 | crt_file=data_files/server8_int-ca2.crt \ |
| 7442 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7443 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7444 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7445 | 0 \ |
| 7446 | -s "found fragmented DTLS handshake message" \ |
| 7447 | -c "found fragmented DTLS handshake message" \ |
| 7448 | -C "error" |
| 7449 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7450 | # interop tests for DTLS fragmentating with reliable connection |
| 7451 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7452 | # here and below we just want to test that the we fragment in a way that |
| 7453 | # pleases other implementations, so we don't need the peer to fragment |
| 7454 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7455 | requires_config_enabled MBEDTLS_RSA_C |
| 7456 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7457 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7458 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7459 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7460 | "$G_SRV -u" \ |
| 7461 | "$P_CLI dtls=1 debug_level=2 \ |
| 7462 | crt_file=data_files/server8_int-ca2.crt \ |
| 7463 | key_file=data_files/server8.key \ |
| 7464 | mtu=512 force_version=dtls1_2" \ |
| 7465 | 0 \ |
| 7466 | -c "fragmenting handshake message" \ |
| 7467 | -C "error" |
| 7468 | |
| 7469 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7470 | requires_config_enabled MBEDTLS_RSA_C |
| 7471 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7473 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7474 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 7475 | "$G_SRV -u" \ |
| 7476 | "$P_CLI dtls=1 debug_level=2 \ |
| 7477 | crt_file=data_files/server8_int-ca2.crt \ |
| 7478 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7479 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7480 | 0 \ |
| 7481 | -c "fragmenting handshake message" \ |
| 7482 | -C "error" |
| 7483 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7484 | # We use --insecure for the GnuTLS client because it expects |
| 7485 | # the hostname / IP it connects to to be the name used in the |
| 7486 | # certificate obtained from the server. Here, however, it |
| 7487 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7488 | # as the server name in the certificate. This will make the |
| 7489 | # certifiate validation fail, but passing --insecure makes |
| 7490 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7491 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7492 | requires_config_enabled MBEDTLS_RSA_C |
| 7493 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7494 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7495 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7496 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7497 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7498 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7499 | crt_file=data_files/server7_int-ca.crt \ |
| 7500 | key_file=data_files/server7.key \ |
| 7501 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7502 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7503 | 0 \ |
| 7504 | -s "fragmenting handshake message" |
| 7505 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7506 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7508 | requires_config_enabled MBEDTLS_RSA_C |
| 7509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7511 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7512 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7513 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7514 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7515 | crt_file=data_files/server7_int-ca.crt \ |
| 7516 | key_file=data_files/server7.key \ |
| 7517 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7518 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7519 | 0 \ |
| 7520 | -s "fragmenting handshake message" |
| 7521 | |
| 7522 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7523 | requires_config_enabled MBEDTLS_RSA_C |
| 7524 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7526 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7527 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7528 | "$P_CLI dtls=1 debug_level=2 \ |
| 7529 | crt_file=data_files/server8_int-ca2.crt \ |
| 7530 | key_file=data_files/server8.key \ |
| 7531 | mtu=512 force_version=dtls1_2" \ |
| 7532 | 0 \ |
| 7533 | -c "fragmenting handshake message" \ |
| 7534 | -C "error" |
| 7535 | |
| 7536 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7537 | requires_config_enabled MBEDTLS_RSA_C |
| 7538 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7539 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7540 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 7541 | "$O_SRV -dtls1 -verify 10" \ |
| 7542 | "$P_CLI dtls=1 debug_level=2 \ |
| 7543 | crt_file=data_files/server8_int-ca2.crt \ |
| 7544 | key_file=data_files/server8.key \ |
| 7545 | mtu=512 force_version=dtls1" \ |
| 7546 | 0 \ |
| 7547 | -c "fragmenting handshake message" \ |
| 7548 | -C "error" |
| 7549 | |
| 7550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7551 | requires_config_enabled MBEDTLS_RSA_C |
| 7552 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7554 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7555 | "$P_SRV dtls=1 debug_level=2 \ |
| 7556 | crt_file=data_files/server7_int-ca.crt \ |
| 7557 | key_file=data_files/server7.key \ |
| 7558 | mtu=512 force_version=dtls1_2" \ |
| 7559 | "$O_CLI -dtls1_2" \ |
| 7560 | 0 \ |
| 7561 | -s "fragmenting handshake message" |
| 7562 | |
| 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 |
| 7567 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 7568 | "$P_SRV dtls=1 debug_level=2 \ |
| 7569 | crt_file=data_files/server7_int-ca.crt \ |
| 7570 | key_file=data_files/server7.key \ |
| 7571 | mtu=512 force_version=dtls1" \ |
| 7572 | "$O_CLI -dtls1" \ |
| 7573 | 0 \ |
| 7574 | -s "fragmenting handshake message" |
| 7575 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7576 | # interop tests for DTLS fragmentating with unreliable connection |
| 7577 | # |
| 7578 | # again we just want to test that the we fragment in a way that |
| 7579 | # pleases other implementations, so we don't need the peer to fragment |
| 7580 | requires_gnutls_next |
| 7581 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7582 | requires_config_enabled MBEDTLS_RSA_C |
| 7583 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7585 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7586 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7587 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7588 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7589 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7590 | crt_file=data_files/server8_int-ca2.crt \ |
| 7591 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7592 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7593 | 0 \ |
| 7594 | -c "fragmenting handshake message" \ |
| 7595 | -C "error" |
| 7596 | |
| 7597 | requires_gnutls_next |
| 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, gnutls server, DTLS 1.0" \ |
| 7604 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7605 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7606 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7607 | crt_file=data_files/server8_int-ca2.crt \ |
| 7608 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7609 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7610 | 0 \ |
| 7611 | -c "fragmenting handshake message" \ |
| 7612 | -C "error" |
| 7613 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7614 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7615 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7616 | requires_config_enabled MBEDTLS_RSA_C |
| 7617 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7618 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7619 | client_needs_more_time 4 |
| 7620 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7621 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7622 | "$P_SRV dtls=1 debug_level=2 \ |
| 7623 | crt_file=data_files/server7_int-ca.crt \ |
| 7624 | key_file=data_files/server7.key \ |
| 7625 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7626 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7627 | 0 \ |
| 7628 | -s "fragmenting handshake message" |
| 7629 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7630 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7631 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7632 | requires_config_enabled MBEDTLS_RSA_C |
| 7633 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7635 | client_needs_more_time 4 |
| 7636 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7637 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7638 | "$P_SRV dtls=1 debug_level=2 \ |
| 7639 | crt_file=data_files/server7_int-ca.crt \ |
| 7640 | key_file=data_files/server7.key \ |
| 7641 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7642 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7643 | 0 \ |
| 7644 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7645 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7646 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7647 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7648 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7649 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7650 | ## (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] | 7651 | skip_next_test |
| 7652 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7653 | requires_config_enabled MBEDTLS_RSA_C |
| 7654 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7656 | client_needs_more_time 4 |
| 7657 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7658 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7659 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7660 | "$P_CLI dtls=1 debug_level=2 \ |
| 7661 | crt_file=data_files/server8_int-ca2.crt \ |
| 7662 | key_file=data_files/server8.key \ |
| 7663 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7664 | 0 \ |
| 7665 | -c "fragmenting handshake message" \ |
| 7666 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7667 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7668 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7670 | requires_config_enabled MBEDTLS_RSA_C |
| 7671 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7672 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7673 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7674 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7675 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7676 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7677 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7678 | crt_file=data_files/server8_int-ca2.crt \ |
| 7679 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7680 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7681 | 0 \ |
| 7682 | -c "fragmenting handshake message" \ |
| 7683 | -C "error" |
| 7684 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7685 | skip_next_test |
| 7686 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7687 | requires_config_enabled MBEDTLS_RSA_C |
| 7688 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7689 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7690 | client_needs_more_time 4 |
| 7691 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7692 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7693 | "$P_SRV dtls=1 debug_level=2 \ |
| 7694 | crt_file=data_files/server7_int-ca.crt \ |
| 7695 | key_file=data_files/server7.key \ |
| 7696 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7697 | "$O_CLI -dtls1_2" \ |
| 7698 | 0 \ |
| 7699 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7700 | |
| 7701 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7702 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7703 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7704 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7705 | requires_config_enabled MBEDTLS_RSA_C |
| 7706 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7707 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7708 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7709 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7710 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7711 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7712 | crt_file=data_files/server7_int-ca.crt \ |
| 7713 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7714 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7715 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7716 | 0 \ |
| 7717 | -s "fragmenting handshake message" |
| 7718 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7719 | # Tests for specific things with "unreliable" UDP connection |
| 7720 | |
| 7721 | not_with_valgrind # spurious resend due to timeout |
| 7722 | run_test "DTLS proxy: reference" \ |
| 7723 | -p "$P_PXY" \ |
| 7724 | "$P_SRV dtls=1 debug_level=2" \ |
| 7725 | "$P_CLI dtls=1 debug_level=2" \ |
| 7726 | 0 \ |
| 7727 | -C "replayed record" \ |
| 7728 | -S "replayed record" \ |
| 7729 | -C "record from another epoch" \ |
| 7730 | -S "record from another epoch" \ |
| 7731 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7732 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7733 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7734 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7735 | -c "HTTP/1.0 200 OK" |
| 7736 | |
| 7737 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7738 | run_test "DTLS proxy: duplicate every packet" \ |
| 7739 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7740 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7741 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7742 | 0 \ |
| 7743 | -c "replayed record" \ |
| 7744 | -s "replayed record" \ |
| 7745 | -c "record from another epoch" \ |
| 7746 | -s "record from another epoch" \ |
| 7747 | -S "resend" \ |
| 7748 | -s "Extra-header:" \ |
| 7749 | -c "HTTP/1.0 200 OK" |
| 7750 | |
| 7751 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7752 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7753 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7754 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7755 | 0 \ |
| 7756 | -c "replayed record" \ |
| 7757 | -S "replayed record" \ |
| 7758 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7759 | -s "record from another epoch" \ |
| 7760 | -c "resend" \ |
| 7761 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7762 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7763 | -c "HTTP/1.0 200 OK" |
| 7764 | |
| 7765 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7766 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7767 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7768 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7769 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7770 | -c "next record in same datagram" \ |
| 7771 | -s "next record in same datagram" |
| 7772 | |
| 7773 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7774 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7775 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7776 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7777 | 0 \ |
| 7778 | -c "next record in same datagram" \ |
| 7779 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7780 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7781 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7782 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7783 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7784 | "$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] | 7785 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7786 | -c "discarding invalid record (mac)" \ |
| 7787 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7788 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7789 | -c "HTTP/1.0 200 OK" \ |
| 7790 | -S "too many records with bad MAC" \ |
| 7791 | -S "Verification of the message MAC failed" |
| 7792 | |
| 7793 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7794 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7795 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7796 | "$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] | 7797 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7798 | -C "discarding invalid record (mac)" \ |
| 7799 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7800 | -S "Extra-header:" \ |
| 7801 | -C "HTTP/1.0 200 OK" \ |
| 7802 | -s "too many records with bad MAC" \ |
| 7803 | -s "Verification of the message MAC failed" |
| 7804 | |
| 7805 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7806 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7807 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7808 | "$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] | 7809 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7810 | -c "discarding invalid record (mac)" \ |
| 7811 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7812 | -s "Extra-header:" \ |
| 7813 | -c "HTTP/1.0 200 OK" \ |
| 7814 | -S "too many records with bad MAC" \ |
| 7815 | -S "Verification of the message MAC failed" |
| 7816 | |
| 7817 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7818 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7819 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7820 | "$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] | 7821 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7822 | -c "discarding invalid record (mac)" \ |
| 7823 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7824 | -s "Extra-header:" \ |
| 7825 | -c "HTTP/1.0 200 OK" \ |
| 7826 | -s "too many records with bad MAC" \ |
| 7827 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7828 | |
| 7829 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7830 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7831 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7832 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7833 | 0 \ |
| 7834 | -c "record from another epoch" \ |
| 7835 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7836 | -s "Extra-header:" \ |
| 7837 | -c "HTTP/1.0 200 OK" |
| 7838 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7839 | # Tests for reordering support with DTLS |
| 7840 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7841 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7842 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7843 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7844 | hs_timeout=2500-60000" \ |
| 7845 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7846 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7847 | 0 \ |
| 7848 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7849 | -c "Next handshake message has been buffered - load"\ |
| 7850 | -S "Buffering HS message" \ |
| 7851 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7852 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7853 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7854 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7855 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7856 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7857 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7858 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7859 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7860 | hs_timeout=2500-60000" \ |
| 7861 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7862 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7863 | 0 \ |
| 7864 | -c "Buffering HS message" \ |
| 7865 | -c "found fragmented DTLS handshake message"\ |
| 7866 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7867 | -c "Next handshake message has been buffered - load"\ |
| 7868 | -S "Buffering HS message" \ |
| 7869 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7870 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7871 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7872 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7873 | -S "Remember CCS message" |
| 7874 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7875 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7876 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7877 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7878 | # while keeping the ServerKeyExchange. |
| 7879 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7880 | 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] | 7881 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7882 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7883 | hs_timeout=2500-60000" \ |
| 7884 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7885 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7886 | 0 \ |
| 7887 | -c "Buffering HS message" \ |
| 7888 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7889 | -C "attempt to make space by freeing buffered messages" \ |
| 7890 | -S "Buffering HS message" \ |
| 7891 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7892 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7893 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7894 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7895 | -S "Remember CCS message" |
| 7896 | |
| 7897 | # The size constraints ensure that the delayed certificate message can't |
| 7898 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7899 | # when dropping it first. |
| 7900 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7901 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7902 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7903 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7904 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7905 | hs_timeout=2500-60000" \ |
| 7906 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7907 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7908 | 0 \ |
| 7909 | -c "Buffering HS message" \ |
| 7910 | -c "attempt to make space by freeing buffered future messages" \ |
| 7911 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7912 | -S "Buffering HS message" \ |
| 7913 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7914 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7915 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7916 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7917 | -S "Remember CCS message" |
| 7918 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7919 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7920 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7921 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7922 | hs_timeout=2500-60000" \ |
| 7923 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7924 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7925 | 0 \ |
| 7926 | -C "Buffering HS message" \ |
| 7927 | -C "Next handshake message has been buffered - load"\ |
| 7928 | -s "Buffering HS message" \ |
| 7929 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7930 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7931 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7932 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7933 | -S "Remember CCS message" |
| 7934 | |
| 7935 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7936 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7937 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7938 | hs_timeout=2500-60000" \ |
| 7939 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7940 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7941 | 0 \ |
| 7942 | -C "Buffering HS message" \ |
| 7943 | -C "Next handshake message has been buffered - load"\ |
| 7944 | -S "Buffering HS message" \ |
| 7945 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7946 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7947 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7948 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7949 | -S "Remember CCS message" |
| 7950 | |
| 7951 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7952 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7953 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7954 | hs_timeout=2500-60000" \ |
| 7955 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7956 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7957 | 0 \ |
| 7958 | -C "Buffering HS message" \ |
| 7959 | -C "Next handshake message has been buffered - load"\ |
| 7960 | -S "Buffering HS message" \ |
| 7961 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7962 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7963 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7964 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7965 | -s "Remember CCS message" |
| 7966 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7967 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7968 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7969 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7970 | hs_timeout=2500-60000" \ |
| 7971 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7972 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7973 | 0 \ |
| 7974 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7975 | -s "Found buffered record from current epoch - load" \ |
| 7976 | -c "Buffer record from epoch 1" \ |
| 7977 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7978 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7979 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7980 | # from the server are delayed, so that the encrypted Finished message |
| 7981 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7982 | # in afterwards, the encrypted Finished message must be freed in order |
| 7983 | # to make space for the NewSessionTicket to be reassembled. |
| 7984 | # This works only in very particular circumstances: |
| 7985 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7986 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7987 | # the encrypted Finished message. |
| 7988 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7989 | # needs to be fragmented. |
| 7990 | # - All messages sent by the server must be small enough to be either sent |
| 7991 | # without fragmentation or be reassembled within the bounds of |
| 7992 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7993 | # handshake, omitting CRTs. |
| 7994 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7995 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7996 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7997 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7998 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7999 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8000 | 0 \ |
| 8001 | -s "Buffer record from epoch 1" \ |
| 8002 | -s "Found buffered record from current epoch - load" \ |
| 8003 | -c "Buffer record from epoch 1" \ |
| 8004 | -C "Found buffered record from current epoch - load" \ |
| 8005 | -c "Enough space available after freeing future epoch record" |
| 8006 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8007 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8008 | |
| 8009 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8010 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8011 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8012 | "$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] | 8013 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8014 | "$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] | 8015 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8016 | 0 \ |
| 8017 | -s "Extra-header:" \ |
| 8018 | -c "HTTP/1.0 200 OK" |
| 8019 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8020 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8021 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8022 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8023 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8024 | "$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] | 8025 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8026 | 0 \ |
| 8027 | -s "Extra-header:" \ |
| 8028 | -c "HTTP/1.0 200 OK" |
| 8029 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8030 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8031 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8032 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8033 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8034 | "$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] | 8035 | 0 \ |
| 8036 | -s "Extra-header:" \ |
| 8037 | -c "HTTP/1.0 200 OK" |
| 8038 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8039 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8040 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8041 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8042 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8043 | "$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] | 8044 | 0 \ |
| 8045 | -s "Extra-header:" \ |
| 8046 | -c "HTTP/1.0 200 OK" |
| 8047 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8048 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8049 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8051 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8052 | "$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] | 8053 | 0 \ |
| 8054 | -s "Extra-header:" \ |
| 8055 | -c "HTTP/1.0 200 OK" |
| 8056 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8057 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8058 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8059 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8060 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8061 | "$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] | 8062 | 0 \ |
| 8063 | -s "Extra-header:" \ |
| 8064 | -c "HTTP/1.0 200 OK" |
| 8065 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8066 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8067 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8068 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8069 | "$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] | 8070 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8071 | "$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] | 8072 | 0 \ |
| 8073 | -s "Extra-header:" \ |
| 8074 | -c "HTTP/1.0 200 OK" |
| 8075 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8076 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8077 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8078 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8079 | "$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] | 8080 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8081 | "$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] | 8082 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8083 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8084 | 0 \ |
| 8085 | -s "a session has been resumed" \ |
| 8086 | -c "a session has been resumed" \ |
| 8087 | -s "Extra-header:" \ |
| 8088 | -c "HTTP/1.0 200 OK" |
| 8089 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8090 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8091 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8092 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8093 | "$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] | 8094 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8095 | "$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] | 8096 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8097 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8098 | 0 \ |
| 8099 | -s "a session has been resumed" \ |
| 8100 | -c "a session has been resumed" \ |
| 8101 | -s "Extra-header:" \ |
| 8102 | -c "HTTP/1.0 200 OK" |
| 8103 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8104 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8105 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8106 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8107 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8108 | "$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] | 8109 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8110 | "$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] | 8111 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8112 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8113 | 0 \ |
| 8114 | -c "=> renegotiate" \ |
| 8115 | -s "=> renegotiate" \ |
| 8116 | -s "Extra-header:" \ |
| 8117 | -c "HTTP/1.0 200 OK" |
| 8118 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8119 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8120 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8121 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8122 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8123 | "$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] | 8124 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8125 | "$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] | 8126 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8127 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8128 | 0 \ |
| 8129 | -c "=> renegotiate" \ |
| 8130 | -s "=> renegotiate" \ |
| 8131 | -s "Extra-header:" \ |
| 8132 | -c "HTTP/1.0 200 OK" |
| 8133 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8134 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8135 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8136 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8137 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8138 | "$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] | 8139 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8140 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8141 | "$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] | 8142 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8143 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8144 | 0 \ |
| 8145 | -c "=> renegotiate" \ |
| 8146 | -s "=> renegotiate" \ |
| 8147 | -s "Extra-header:" \ |
| 8148 | -c "HTTP/1.0 200 OK" |
| 8149 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8150 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8151 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8152 | 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] | 8153 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8154 | "$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] | 8155 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8156 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8157 | "$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] | 8158 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8159 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8160 | 0 \ |
| 8161 | -c "=> renegotiate" \ |
| 8162 | -s "=> renegotiate" \ |
| 8163 | -s "Extra-header:" \ |
| 8164 | -c "HTTP/1.0 200 OK" |
| 8165 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8166 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8167 | ## all versions installed on the CI machines), reported here: |
| 8168 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8169 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8170 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8171 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8172 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8173 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8174 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8175 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8176 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8177 | "$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] | 8178 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8179 | -c "HTTP/1.0 200 OK" |
| 8180 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8181 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8182 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8183 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8184 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8185 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8186 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8187 | "$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] | 8188 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8189 | -c "HTTP/1.0 200 OK" |
| 8190 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8191 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8192 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8193 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8194 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8195 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8196 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8197 | "$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] | 8198 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8199 | -c "HTTP/1.0 200 OK" |
| 8200 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8201 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8202 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8203 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8204 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8205 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8206 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8207 | "$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] | 8208 | 0 \ |
| 8209 | -s "Extra-header:" \ |
| 8210 | -c "Extra-header:" |
| 8211 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8212 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8213 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8214 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8215 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8216 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8217 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8218 | "$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] | 8219 | 0 \ |
| 8220 | -s "Extra-header:" \ |
| 8221 | -c "Extra-header:" |
| 8222 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8223 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8224 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8225 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8226 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8227 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8228 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8229 | "$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] | 8230 | 0 \ |
| 8231 | -s "Extra-header:" \ |
| 8232 | -c "Extra-header:" |
| 8233 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8234 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8235 | run_test "export keys functionality" \ |
| 8236 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8237 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8238 | 0 \ |
| 8239 | -s "exported maclen is " \ |
| 8240 | -s "exported keylen is " \ |
| 8241 | -s "exported ivlen is " \ |
| 8242 | -c "exported maclen is " \ |
| 8243 | -c "exported keylen is " \ |
| 8244 | -c "exported ivlen is " |
| 8245 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8246 | # Final report |
| 8247 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8248 | echo "------------------------------------------------------------------------" |
| 8249 | |
| 8250 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8251 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8252 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8253 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8254 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8255 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8256 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8257 | |
| 8258 | exit $FAILS |