Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 6 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 7 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
| 8 | # |
| 9 | # Purpose |
| 10 | # |
| 11 | # Executes tests to prove various TLS/SSL options and extensions. |
| 12 | # |
| 13 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 14 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 15 | # (session resumption from cache or ticket, renego, etc). |
| 16 | # |
| 17 | # The tests assume a build with default options, with exceptions expressed |
| 18 | # with a dependency. The tests focus on functionality and do not consider |
| 19 | # performance. |
| 20 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 21 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 22 | set -u |
| 23 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 24 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 25 | # where it may output seemingly unlimited length error logs. |
| 26 | ulimit -f 20971520 |
| 27 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 28 | if cd $( dirname $0 ); then :; else |
| 29 | echo "cd $( dirname $0 ) failed" >&2 |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 33 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 34 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 35 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 36 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 37 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 42 | 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] | 43 | 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] | 44 | 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] | 45 | 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] | 46 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 47 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 48 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 49 | |
| 50 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 51 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 52 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 53 | else |
| 54 | O_LEGACY_SRV=false |
| 55 | O_LEGACY_CLI=false |
| 56 | fi |
| 57 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 58 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 59 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 60 | else |
| 61 | G_NEXT_SRV=false |
| 62 | fi |
| 63 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 64 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 65 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 66 | else |
| 67 | G_NEXT_CLI=false |
| 68 | fi |
| 69 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 70 | TESTS=0 |
| 71 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 72 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 73 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 74 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 75 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 76 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 77 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 78 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 79 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 80 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 81 | RUN_TEST_NUMBER='' |
| 82 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 83 | PRESERVE_LOGS=0 |
| 84 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 85 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 86 | # port which is this plus 10000. Each port number may be independently |
| 87 | # overridden by a command line option. |
| 88 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 89 | PXY_PORT=$((SRV_PORT + 10000)) |
| 90 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 91 | print_usage() { |
| 92 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 93 | printf " -h|--help\tPrint this help.\n" |
| 94 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 95 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 96 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 97 | 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] | 98 | 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] | 99 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 100 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 101 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 102 | 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] | 103 | } |
| 104 | |
| 105 | get_options() { |
| 106 | while [ $# -gt 0 ]; do |
| 107 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 108 | -f|--filter) |
| 109 | shift; FILTER=$1 |
| 110 | ;; |
| 111 | -e|--exclude) |
| 112 | shift; EXCLUDE=$1 |
| 113 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | -m|--memcheck) |
| 115 | MEMCHECK=1 |
| 116 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 117 | -n|--number) |
| 118 | shift; RUN_TEST_NUMBER=$1 |
| 119 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 120 | -s|--show-numbers) |
| 121 | SHOW_TEST_NUMBER=1 |
| 122 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 123 | -p|--preserve-logs) |
| 124 | PRESERVE_LOGS=1 |
| 125 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 126 | --port) |
| 127 | shift; SRV_PORT=$1 |
| 128 | ;; |
| 129 | --proxy-port) |
| 130 | shift; PXY_PORT=$1 |
| 131 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 132 | --seed) |
| 133 | shift; SEED="$1" |
| 134 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 135 | -h|--help) |
| 136 | print_usage |
| 137 | exit 0 |
| 138 | ;; |
| 139 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 140 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 141 | print_usage |
| 142 | exit 1 |
| 143 | ;; |
| 144 | esac |
| 145 | shift |
| 146 | done |
| 147 | } |
| 148 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 149 | # Skip next test; use this macro to skip tests which are legitimate |
| 150 | # in theory and expected to be re-introduced at some point, but |
| 151 | # aren't expected to succeed at the moment due to problems outside |
| 152 | # our control (such as bugs in other TLS implementations). |
| 153 | skip_next_test() { |
| 154 | SKIP_NEXT="YES" |
| 155 | } |
| 156 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 157 | # skip next test if the flag is not enabled in config.h |
| 158 | requires_config_enabled() { |
| 159 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 160 | SKIP_NEXT="YES" |
| 161 | fi |
| 162 | } |
| 163 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 164 | # skip next test if the flag is enabled in config.h |
| 165 | requires_config_disabled() { |
| 166 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 167 | SKIP_NEXT="YES" |
| 168 | fi |
| 169 | } |
| 170 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 171 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 172 | # This function uses the query_config command line option to query the |
| 173 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 174 | # program. The command will always return a success value if the |
| 175 | # configuration is defined and the value will be printed to stdout. |
| 176 | # |
| 177 | # Note that if the configuration is not defined or is defined to nothing, |
| 178 | # the output of this function will be an empty string. |
| 179 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 183 | VAL="$( get_config_value_or_default "$1" )" |
| 184 | if [ -z "$VAL" ]; then |
| 185 | # Should never happen |
| 186 | echo "Mbed TLS configuration $1 is not defined" |
| 187 | exit 1 |
| 188 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 189 | SKIP_NEXT="YES" |
| 190 | fi |
| 191 | } |
| 192 | |
| 193 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 194 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 195 | if [ -z "$VAL" ]; then |
| 196 | # Should never happen |
| 197 | echo "Mbed TLS configuration $1 is not defined" |
| 198 | exit 1 |
| 199 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 200 | SKIP_NEXT="YES" |
| 201 | fi |
| 202 | } |
| 203 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 204 | requires_ciphersuite_enabled() { |
Hanno Becker | a0dc9cf | 2018-11-20 11:31:17 +0000 | [diff] [blame] | 205 | if [ -z "$($P_CLI --help | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 206 | SKIP_NEXT="YES" |
| 207 | fi |
| 208 | } |
| 209 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 210 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 211 | requires_openssl_with_fallback_scsv() { |
| 212 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 213 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 214 | then |
| 215 | OPENSSL_HAS_FBSCSV="YES" |
| 216 | else |
| 217 | OPENSSL_HAS_FBSCSV="NO" |
| 218 | fi |
| 219 | fi |
| 220 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 221 | SKIP_NEXT="YES" |
| 222 | fi |
| 223 | } |
| 224 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 225 | # skip next test if GnuTLS isn't available |
| 226 | requires_gnutls() { |
| 227 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 228 | 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] | 229 | GNUTLS_AVAILABLE="YES" |
| 230 | else |
| 231 | GNUTLS_AVAILABLE="NO" |
| 232 | fi |
| 233 | fi |
| 234 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 235 | SKIP_NEXT="YES" |
| 236 | fi |
| 237 | } |
| 238 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 239 | # skip next test if GnuTLS-next isn't available |
| 240 | requires_gnutls_next() { |
| 241 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 242 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 243 | GNUTLS_NEXT_AVAILABLE="YES" |
| 244 | else |
| 245 | GNUTLS_NEXT_AVAILABLE="NO" |
| 246 | fi |
| 247 | fi |
| 248 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 249 | SKIP_NEXT="YES" |
| 250 | fi |
| 251 | } |
| 252 | |
| 253 | # skip next test if OpenSSL-legacy isn't available |
| 254 | requires_openssl_legacy() { |
| 255 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 256 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 257 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 258 | else |
| 259 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 260 | fi |
| 261 | fi |
| 262 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 263 | SKIP_NEXT="YES" |
| 264 | fi |
| 265 | } |
| 266 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 267 | # skip next test if IPv6 isn't available on this host |
| 268 | requires_ipv6() { |
| 269 | if [ -z "${HAS_IPV6:-}" ]; then |
| 270 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 271 | SRV_PID=$! |
| 272 | sleep 1 |
| 273 | kill $SRV_PID >/dev/null 2>&1 |
| 274 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 275 | HAS_IPV6="NO" |
| 276 | else |
| 277 | HAS_IPV6="YES" |
| 278 | fi |
| 279 | rm -r $SRV_OUT |
| 280 | fi |
| 281 | |
| 282 | if [ "$HAS_IPV6" = "NO" ]; then |
| 283 | SKIP_NEXT="YES" |
| 284 | fi |
| 285 | } |
| 286 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 287 | # skip next test if it's i686 or uname is not available |
| 288 | requires_not_i686() { |
| 289 | if [ -z "${IS_I686:-}" ]; then |
| 290 | IS_I686="YES" |
| 291 | if which "uname" >/dev/null 2>&1; then |
| 292 | if [ -z "$(uname -a | grep i686)" ]; then |
| 293 | IS_I686="NO" |
| 294 | fi |
| 295 | fi |
| 296 | fi |
| 297 | if [ "$IS_I686" = "YES" ]; then |
| 298 | SKIP_NEXT="YES" |
| 299 | fi |
| 300 | } |
| 301 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 302 | # Calculate the input & output maximum content lengths set in the config |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 303 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 304 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 305 | MAX_OUT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 306 | |
| 307 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 308 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 309 | fi |
| 310 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 311 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 312 | fi |
| 313 | |
| 314 | # skip the next test if the SSL output buffer is less than 16KB |
| 315 | requires_full_size_output_buffer() { |
| 316 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 317 | SKIP_NEXT="YES" |
| 318 | fi |
| 319 | } |
| 320 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 321 | # skip the next test if valgrind is in use |
| 322 | not_with_valgrind() { |
| 323 | if [ "$MEMCHECK" -gt 0 ]; then |
| 324 | SKIP_NEXT="YES" |
| 325 | fi |
| 326 | } |
| 327 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 328 | # skip the next test if valgrind is NOT in use |
| 329 | only_with_valgrind() { |
| 330 | if [ "$MEMCHECK" -eq 0 ]; then |
| 331 | SKIP_NEXT="YES" |
| 332 | fi |
| 333 | } |
| 334 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 335 | # 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] | 336 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 337 | CLI_DELAY_FACTOR=$1 |
| 338 | } |
| 339 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 340 | # wait for the given seconds after the client finished in the next test |
| 341 | server_needs_more_time() { |
| 342 | SRV_DELAY_SECONDS=$1 |
| 343 | } |
| 344 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 345 | # print_name <name> |
| 346 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 347 | TESTS=$(( $TESTS + 1 )) |
| 348 | LINE="" |
| 349 | |
| 350 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 351 | LINE="$TESTS " |
| 352 | fi |
| 353 | |
| 354 | LINE="$LINE$1" |
| 355 | printf "$LINE " |
| 356 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 357 | for i in `seq 1 $LEN`; do printf '.'; done |
| 358 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 359 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | # fail <message> |
| 363 | fail() { |
| 364 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 365 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 366 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 367 | mv $SRV_OUT o-srv-${TESTS}.log |
| 368 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 369 | if [ -n "$PXY_CMD" ]; then |
| 370 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 371 | fi |
| 372 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 373 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 374 | 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] | 375 | echo " ! server output:" |
| 376 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 377 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 378 | echo " ! client output:" |
| 379 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 380 | if [ -n "$PXY_CMD" ]; then |
| 381 | echo " ! ========================================================" |
| 382 | echo " ! proxy output:" |
| 383 | cat o-pxy-${TESTS}.log |
| 384 | fi |
| 385 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 386 | fi |
| 387 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 388 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 389 | } |
| 390 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 391 | # is_polar <cmd_line> |
| 392 | is_polar() { |
| 393 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 394 | } |
| 395 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 396 | # openssl s_server doesn't have -www with DTLS |
| 397 | check_osrv_dtls() { |
| 398 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 399 | NEEDS_INPUT=1 |
| 400 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 401 | else |
| 402 | NEEDS_INPUT=0 |
| 403 | fi |
| 404 | } |
| 405 | |
| 406 | # provide input to commands that need it |
| 407 | provide_input() { |
| 408 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 409 | return |
| 410 | fi |
| 411 | |
| 412 | while true; do |
| 413 | echo "HTTP/1.0 200 OK" |
| 414 | sleep 1 |
| 415 | done |
| 416 | } |
| 417 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 418 | # has_mem_err <log_file_name> |
| 419 | has_mem_err() { |
| 420 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 421 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 422 | then |
| 423 | return 1 # false: does not have errors |
| 424 | else |
| 425 | return 0 # true: has errors |
| 426 | fi |
| 427 | } |
| 428 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 429 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 430 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 431 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 432 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 433 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 434 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 435 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 436 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 437 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 438 | # Make a tight loop, server normally takes less than 1s to start. |
| 439 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 440 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 441 | echo "$3 START TIMEOUT" |
| 442 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 443 | break |
| 444 | fi |
| 445 | # Linux and *BSD support decimal arguments to sleep. On other |
| 446 | # OSes this may be a tight loop. |
| 447 | sleep 0.1 2>/dev/null || true |
| 448 | done |
| 449 | } |
| 450 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 451 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 452 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 453 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 454 | } |
| 455 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 456 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 457 | # Wait for server process $2 to be listening on port $1. |
| 458 | wait_server_start() { |
| 459 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 460 | } |
| 461 | |
| 462 | # Wait for proxy process $2 to be listening on port $1. |
| 463 | wait_proxy_start() { |
| 464 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 465 | } |
| 466 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 467 | # 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] | 468 | # 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] | 469 | # acceptable bounds |
| 470 | check_server_hello_time() { |
| 471 | # 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] | 472 | 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] | 473 | # Get the Unix timestamp for now |
| 474 | CUR_TIME=$(date +'%s') |
| 475 | THRESHOLD_IN_SECS=300 |
| 476 | |
| 477 | # Check if the ServerHello time was printed |
| 478 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 479 | return 1 |
| 480 | fi |
| 481 | |
| 482 | # Check the time in ServerHello is within acceptable bounds |
| 483 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 484 | # The time in ServerHello is at least 5 minutes before now |
| 485 | return 1 |
| 486 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 487 | # 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] | 488 | return 1 |
| 489 | else |
| 490 | return 0 |
| 491 | fi |
| 492 | } |
| 493 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 494 | # wait for client to terminate and set CLI_EXIT |
| 495 | # must be called right after starting the client |
| 496 | wait_client_done() { |
| 497 | CLI_PID=$! |
| 498 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 499 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 500 | CLI_DELAY_FACTOR=1 |
| 501 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 502 | ( 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] | 503 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 504 | |
| 505 | wait $CLI_PID |
| 506 | CLI_EXIT=$? |
| 507 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 508 | kill $DOG_PID >/dev/null 2>&1 |
| 509 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 510 | |
| 511 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 512 | |
| 513 | sleep $SRV_DELAY_SECONDS |
| 514 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 515 | } |
| 516 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 517 | # check if the given command uses dtls and sets global variable DTLS |
| 518 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 519 | 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] | 520 | DTLS=1 |
| 521 | else |
| 522 | DTLS=0 |
| 523 | fi |
| 524 | } |
| 525 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 526 | # 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] | 527 | # Options: -s pattern pattern that must be present in server output |
| 528 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 529 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 530 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 531 | # -S pattern pattern that must be absent in server output |
| 532 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 533 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 534 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 535 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 536 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 537 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 538 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 539 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 540 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 541 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 542 | return |
| 543 | fi |
| 544 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 545 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 546 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 547 | # Do we only run numbered tests? |
| 548 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 549 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 550 | else |
| 551 | SKIP_NEXT="YES" |
| 552 | fi |
| 553 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 554 | # does this test use a proxy? |
| 555 | if [ "X$1" = "X-p" ]; then |
| 556 | PXY_CMD="$2" |
| 557 | shift 2 |
| 558 | else |
| 559 | PXY_CMD="" |
| 560 | fi |
| 561 | |
| 562 | # get commands and client output |
| 563 | SRV_CMD="$1" |
| 564 | CLI_CMD="$2" |
| 565 | CLI_EXPECT="$3" |
| 566 | shift 3 |
| 567 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 568 | # Check if test uses files |
| 569 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 570 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 571 | requires_config_enabled MBEDTLS_FS_IO |
| 572 | fi |
| 573 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 574 | # Check if server forces ciphersuite |
| 575 | FORCE_CIPHERSUITE=$(echo "$SRV_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 576 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 577 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 578 | fi |
| 579 | |
| 580 | # Check if client forces ciphersuite |
| 581 | FORCE_CIPHERSUITE=$(echo "$CLI_CMD" | sed -n 's/^.*force_ciphersuite=\([a-zA-Z0-9\-]*\).*$/\1/p') |
| 582 | if [ ! -z "$FORCE_CIPHERSUITE" ]; then |
| 583 | requires_ciphersuite_enabled $FORCE_CIPHERSUITE |
| 584 | fi |
| 585 | |
| 586 | # should we skip? |
| 587 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 588 | SKIP_NEXT="NO" |
| 589 | echo "SKIP" |
| 590 | SKIPS=$(( $SKIPS + 1 )) |
| 591 | return |
| 592 | fi |
| 593 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 594 | # fix client port |
| 595 | if [ -n "$PXY_CMD" ]; then |
| 596 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 597 | else |
| 598 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 599 | fi |
| 600 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 601 | # update DTLS variable |
| 602 | detect_dtls "$SRV_CMD" |
| 603 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 604 | # prepend valgrind to our commands if active |
| 605 | if [ "$MEMCHECK" -gt 0 ]; then |
| 606 | if is_polar "$SRV_CMD"; then |
| 607 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 608 | fi |
| 609 | if is_polar "$CLI_CMD"; then |
| 610 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 611 | fi |
| 612 | fi |
| 613 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 614 | TIMES_LEFT=2 |
| 615 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 616 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 617 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 618 | # run the commands |
| 619 | if [ -n "$PXY_CMD" ]; then |
| 620 | echo "$PXY_CMD" > $PXY_OUT |
| 621 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 622 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 623 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 624 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 625 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 626 | check_osrv_dtls |
| 627 | echo "$SRV_CMD" > $SRV_OUT |
| 628 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 629 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 630 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 631 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 632 | echo "$CLI_CMD" > $CLI_OUT |
| 633 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 634 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 635 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 636 | sleep 0.05 |
| 637 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 638 | # terminate the server (and the proxy) |
| 639 | kill $SRV_PID |
| 640 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 641 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 642 | if [ -n "$PXY_CMD" ]; then |
| 643 | kill $PXY_PID >/dev/null 2>&1 |
| 644 | wait $PXY_PID |
| 645 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 646 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 647 | # retry only on timeouts |
| 648 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 649 | printf "RETRY " |
| 650 | else |
| 651 | TIMES_LEFT=0 |
| 652 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 653 | done |
| 654 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 655 | # 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] | 656 | # (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] | 657 | # expected client exit to incorrectly succeed in case of catastrophic |
| 658 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 659 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 660 | 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] | 661 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 662 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 663 | return |
| 664 | fi |
| 665 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 666 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 667 | 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] | 668 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 669 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 670 | return |
| 671 | fi |
| 672 | fi |
| 673 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 674 | # check server exit code |
| 675 | if [ $? != 0 ]; then |
| 676 | fail "server fail" |
| 677 | return |
| 678 | fi |
| 679 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 680 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 681 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 682 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 683 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 684 | 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] | 685 | return |
| 686 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 687 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 688 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 689 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 690 | # 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] | 691 | while [ $# -gt 0 ] |
| 692 | do |
| 693 | case $1 in |
| 694 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 695 | 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] | 696 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 697 | return |
| 698 | fi |
| 699 | ;; |
| 700 | |
| 701 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 702 | 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] | 703 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 704 | return |
| 705 | fi |
| 706 | ;; |
| 707 | |
| 708 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 709 | 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] | 710 | 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] | 711 | return |
| 712 | fi |
| 713 | ;; |
| 714 | |
| 715 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 716 | 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] | 717 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 718 | return |
| 719 | fi |
| 720 | ;; |
| 721 | |
| 722 | # The filtering in the following two options (-u and -U) do the following |
| 723 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 724 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 725 | # - keep one of each non-unique line |
| 726 | # - count how many lines remain |
| 727 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 728 | # if there were no duplicates. |
| 729 | "-U") |
| 730 | 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 |
| 731 | fail "lines following pattern '$2' must be unique in Server output" |
| 732 | return |
| 733 | fi |
| 734 | ;; |
| 735 | |
| 736 | "-u") |
| 737 | 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 |
| 738 | 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] | 739 | return |
| 740 | fi |
| 741 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 742 | "-F") |
| 743 | if ! $2 "$SRV_OUT"; then |
| 744 | fail "function call to '$2' failed on Server output" |
| 745 | return |
| 746 | fi |
| 747 | ;; |
| 748 | "-f") |
| 749 | if ! $2 "$CLI_OUT"; then |
| 750 | fail "function call to '$2' failed on Client output" |
| 751 | return |
| 752 | fi |
| 753 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 754 | |
| 755 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 756 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 757 | exit 1 |
| 758 | esac |
| 759 | shift 2 |
| 760 | done |
| 761 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 762 | # check valgrind's results |
| 763 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 764 | 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] | 765 | fail "Server has memory errors" |
| 766 | return |
| 767 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 768 | 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] | 769 | fail "Client has memory errors" |
| 770 | return |
| 771 | fi |
| 772 | fi |
| 773 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 774 | # if we're here, everything is ok |
| 775 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 776 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 777 | mv $SRV_OUT o-srv-${TESTS}.log |
| 778 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 779 | if [ -n "$PXY_CMD" ]; then |
| 780 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 781 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 782 | fi |
| 783 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 784 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 785 | } |
| 786 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 787 | run_test_psa() { |
| 788 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 789 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 790 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 791 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 792 | 0 \ |
| 793 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 794 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 795 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 796 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 797 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 798 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 799 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 800 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 801 | -C "Failed to setup PSA-based cipher context"\ |
| 802 | -S "Failed to setup PSA-based cipher context"\ |
| 803 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 804 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 805 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 806 | -S "error" \ |
| 807 | -C "error" |
| 808 | } |
| 809 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 810 | run_test_psa_force_curve() { |
| 811 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 812 | run_test "PSA - ECDH with $1" \ |
| 813 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 814 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 815 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 816 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 817 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 818 | -c "PSA calc verify" \ |
| 819 | -c "calc PSA finished" \ |
| 820 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 821 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 822 | -s "PSA calc verify" \ |
| 823 | -s "calc PSA finished" \ |
| 824 | -C "Failed to setup PSA-based cipher context"\ |
| 825 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 826 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 827 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 828 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 829 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 830 | -C "error" |
| 831 | } |
| 832 | |
| 833 | cleanup() { |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 834 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
| 835 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 836 | 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] | 837 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 838 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
| 839 | exit 1 |
| 840 | } |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 841 | |
| 842 | # |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 843 | # MAIN |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 844 | # |
| 845 | |
| 846 | get_options "$@" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 847 | |
| 848 | # sanity checks, avoid an avalanche of errors |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 849 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 850 | P_CLI_BIN="${P_CLI%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 851 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 852 | if [ ! -x "$P_SRV_BIN" ]; then |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 853 | echo "Command '$P_SRV_BIN' is not an executable file" |
| 854 | exit 1 |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 855 | fi |
| 856 | if [ ! -x "$P_CLI_BIN" ]; then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 857 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 858 | exit 1 |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 859 | fi |
| 860 | if [ ! -x "$P_PXY_BIN" ]; then |
| 861 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 862 | exit 1 |
| 863 | fi |
| 864 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 865 | if which valgrind >/dev/null 2>&1; then :; else |
| 866 | echo "Memcheck not possible. Valgrind not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 867 | exit 1 |
| 868 | fi |
| 869 | fi |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 870 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 871 | echo "Command '$OPENSSL_CMD' not found" |
| 872 | exit 1 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 873 | fi |
| 874 | |
| 875 | # used by watchdog |
| 876 | MAIN_PID="$$" |
| 877 | |
| 878 | # We use somewhat arbitrary delays for tests: |
| 879 | # - how long do we wait for the server to start (when lsof not available)? |
| 880 | # - how long do we allow for the client to finish? |
| 881 | # (not to check performance, just to avoid waiting indefinitely) |
| 882 | # Things are slower with valgrind, so give extra time here. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 883 | # |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 884 | # Note: without lsof, there is a trade-off between the running time of this |
| 885 | # 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] | 886 | # 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] | 887 | # the script, only the case where a client or server gets stuck. |
| 888 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 889 | START_DELAY=6 |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 890 | DOG_DELAY=60 |
| 891 | else |
| 892 | START_DELAY=2 |
| 893 | DOG_DELAY=20 |
| 894 | fi |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 895 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 896 | # some particular tests need more time: |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 897 | # - 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] | 898 | # - 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] | 899 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 900 | CLI_DELAY_FACTOR=1 |
| 901 | SRV_DELAY_SECONDS=0 |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 902 | |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 903 | # 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] | 904 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 905 | 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] | 906 | 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] | 907 | 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] | 908 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 909 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 910 | G_SRV="$G_SRV -p $SRV_PORT" |
| 911 | G_CLI="$G_CLI -p +SRV_PORT" |
| 912 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 913 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 914 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 915 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 916 | fi |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 917 | |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 918 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 919 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 920 | fi |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 921 | |
| 922 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 923 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 924 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 925 | |
| 926 | # Allow SHA-1, because many of our test certificates use it |
| 927 | P_SRV="$P_SRV allow_sha1=1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 928 | P_CLI="$P_CLI allow_sha1=1" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 929 | |
| 930 | # Also pick a unique name for intermediate files |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 931 | SRV_OUT="srv_out.$$" |
| 932 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 933 | PXY_OUT="pxy_out.$$" |
| 934 | SESSION="session.$$" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 935 | |
| 936 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 937 | |
| 938 | trap cleanup INT TERM HUP |
| 939 | |
| 940 | # Basic test |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 941 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 942 | # Checks that: |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 943 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 944 | # - the expected (highest security) parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 945 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 946 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 947 | "$P_SRV debug_level=3" \ |
| 948 | "$P_CLI" \ |
| 949 | 0 \ |
| 950 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 951 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 952 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 953 | -s "ECDHE curve: secp521r1" \ |
| 954 | -S "error" \ |
| 955 | -C "error" |
| 956 | |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 957 | run_test "Default, DTLS" \ |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 958 | "$P_SRV dtls=1" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 959 | "$P_CLI dtls=1" \ |
| 960 | 0 \ |
| 961 | -s "Protocol is DTLSv1.2" \ |
| 962 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
| 963 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 964 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 965 | run_test "CA callback on client" \ |
| 966 | "$P_SRV debug_level=3" \ |
| 967 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 968 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 969 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 970 | -S "error" \ |
| 971 | -C "error" |
| 972 | |
| 973 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 974 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 975 | requires_config_enabled MBEDTLS_ECDSA_C |
| 976 | requires_config_enabled MBEDTLS_SHA256_C |
| 977 | run_test "CA callback on server" \ |
| 978 | "$P_SRV auth_mode=required" \ |
| 979 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 980 | key_file=data_files/server5.key" \ |
| 981 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 982 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 983 | -s "Verifying peer X.509 certificate... ok" \ |
| 984 | -S "error" \ |
| 985 | -C "error" |
| 986 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 987 | # Test using an opaque private key for client authentication |
| 988 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 989 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 990 | requires_config_enabled MBEDTLS_ECDSA_C |
| 991 | requires_config_enabled MBEDTLS_SHA256_C |
| 992 | run_test "Opaque key for client authentication" \ |
| 993 | "$P_SRV auth_mode=required" \ |
| 994 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 995 | key_file=data_files/server5.key" \ |
| 996 | 0 \ |
| 997 | -c "key type: Opaque" \ |
| 998 | -s "Verifying peer X.509 certificate... ok" \ |
| 999 | -S "error" \ |
| 1000 | -C "error" |
| 1001 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1002 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1003 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1004 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1005 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1006 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1007 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1008 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1009 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1010 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1011 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1012 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1013 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1014 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1015 | run_test_psa_force_curve "secp521r1" |
| 1016 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1017 | run_test_psa_force_curve "brainpoolP512r1" |
| 1018 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1019 | run_test_psa_force_curve "secp384r1" |
| 1020 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1021 | run_test_psa_force_curve "brainpoolP384r1" |
| 1022 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1023 | run_test_psa_force_curve "secp256r1" |
| 1024 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1025 | run_test_psa_force_curve "secp256k1" |
| 1026 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1027 | run_test_psa_force_curve "brainpoolP256r1" |
| 1028 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1029 | run_test_psa_force_curve "secp224r1" |
| 1030 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1031 | run_test_psa_force_curve "secp224k1" |
| 1032 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1033 | run_test_psa_force_curve "secp192r1" |
| 1034 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1035 | run_test_psa_force_curve "secp192k1" |
| 1036 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1037 | # Test current time in ServerHello |
| 1038 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1039 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1040 | "$P_SRV debug_level=3" \ |
| 1041 | "$P_CLI debug_level=3" \ |
| 1042 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1043 | -f "check_server_hello_time" \ |
| 1044 | -F "check_server_hello_time" |
| 1045 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1046 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1047 | run_test "Unique IV in GCM" \ |
| 1048 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1049 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1050 | 0 \ |
| 1051 | -u "IV used" \ |
| 1052 | -U "IV used" |
| 1053 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1054 | # Tests for certificate verification callback |
| 1055 | run_test "Configuration-specific CRT verification callback" \ |
| 1056 | "$P_SRV debug_level=3" \ |
| 1057 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1058 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1059 | -S "error" \ |
| 1060 | -c "Verify requested for " \ |
| 1061 | -c "Use configuration-specific verification callback" \ |
| 1062 | -C "Use context-specific verification callback" \ |
| 1063 | -C "error" |
| 1064 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1065 | run_test "Context-specific CRT verification callback" \ |
| 1066 | "$P_SRV debug_level=3" \ |
| 1067 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1068 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1069 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1070 | -c "Verify requested for " \ |
| 1071 | -c "Use context-specific verification callback" \ |
| 1072 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1073 | -C "error" |
| 1074 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1075 | # Tests for rc4 option |
| 1076 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1077 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1078 | run_test "RC4: server disabled, client enabled" \ |
| 1079 | "$P_SRV" \ |
| 1080 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1081 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1082 | -s "SSL - The server has no ciphersuites in common" |
| 1083 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1084 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1085 | run_test "RC4: server half, client enabled" \ |
| 1086 | "$P_SRV arc4=1" \ |
| 1087 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1088 | 1 \ |
| 1089 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1090 | |
| 1091 | run_test "RC4: server enabled, client disabled" \ |
| 1092 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1093 | "$P_CLI" \ |
| 1094 | 1 \ |
| 1095 | -s "SSL - The server has no ciphersuites in common" |
| 1096 | |
| 1097 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1098 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1099 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1100 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1101 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1102 | -S "SSL - The server has no ciphersuites in common" |
| 1103 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1104 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1105 | |
| 1106 | requires_gnutls |
| 1107 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1108 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1109 | "$G_SRV"\ |
| 1110 | "$P_CLI force_version=tls1_1" \ |
| 1111 | 0 |
| 1112 | |
| 1113 | requires_gnutls |
| 1114 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1115 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1116 | "$G_SRV"\ |
| 1117 | "$P_CLI force_version=tls1" \ |
| 1118 | 0 |
| 1119 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1120 | # Tests for SHA-1 support |
| 1121 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1122 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1123 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1124 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1125 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1126 | 1 \ |
| 1127 | -c "The certificate is signed with an unacceptable hash" |
| 1128 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1129 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1130 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1131 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1132 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1133 | 0 |
| 1134 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1135 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1136 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1137 | "$P_CLI allow_sha1=1" \ |
| 1138 | 0 |
| 1139 | |
| 1140 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1141 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1142 | "$P_CLI allow_sha1=0" \ |
| 1143 | 0 |
| 1144 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1145 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1146 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1147 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1148 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1149 | 1 \ |
| 1150 | -s "The certificate is signed with an unacceptable hash" |
| 1151 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1152 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1153 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1154 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1155 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1156 | 0 |
| 1157 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1158 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1159 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1160 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1161 | 0 |
| 1162 | |
| 1163 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1164 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1165 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1166 | 0 |
| 1167 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1168 | # Tests for datagram packing |
| 1169 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1170 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1171 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1172 | 0 \ |
| 1173 | -c "next record in same datagram" \ |
| 1174 | -s "next record in same datagram" |
| 1175 | |
| 1176 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1177 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1178 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1179 | 0 \ |
| 1180 | -s "next record in same datagram" \ |
| 1181 | -C "next record in same datagram" |
| 1182 | |
| 1183 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1184 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1185 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1186 | 0 \ |
| 1187 | -S "next record in same datagram" \ |
| 1188 | -c "next record in same datagram" |
| 1189 | |
| 1190 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1191 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1192 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1193 | 0 \ |
| 1194 | -S "next record in same datagram" \ |
| 1195 | -C "next record in same datagram" |
| 1196 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1197 | # Tests for Truncated HMAC extension |
| 1198 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1199 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1200 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1201 | "$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] | 1202 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1203 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1204 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1205 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1206 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1207 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1208 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1209 | "$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] | 1210 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1211 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1212 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1213 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1214 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1215 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1216 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1217 | "$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] | 1218 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1219 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1220 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1221 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1222 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1223 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1224 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1225 | "$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] | 1226 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1227 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1228 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1229 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1230 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1231 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1232 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1233 | "$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] | 1234 | 0 \ |
| 1235 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1236 | -S "dumping 'expected mac' (10 bytes)" |
| 1237 | |
| 1238 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1239 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1240 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1241 | "$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] | 1242 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1243 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1244 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1245 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1246 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1247 | "$P_SRV dtls=1 debug_level=4" \ |
| 1248 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1249 | 0 \ |
| 1250 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1251 | -S "dumping 'expected mac' (10 bytes)" |
| 1252 | |
| 1253 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1254 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1255 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1256 | "$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] | 1257 | 0 \ |
| 1258 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1259 | -S "dumping 'expected mac' (10 bytes)" |
| 1260 | |
| 1261 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1262 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1263 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1264 | "$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] | 1265 | 0 \ |
| 1266 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1267 | -S "dumping 'expected mac' (10 bytes)" |
| 1268 | |
| 1269 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1270 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1271 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1272 | "$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] | 1273 | 0 \ |
| 1274 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1275 | -S "dumping 'expected mac' (10 bytes)" |
| 1276 | |
| 1277 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1278 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1279 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1280 | "$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] | 1281 | 0 \ |
| 1282 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1283 | -S "dumping 'expected mac' (10 bytes)" |
| 1284 | |
| 1285 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1286 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1287 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1288 | "$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] | 1289 | 0 \ |
| 1290 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1291 | -s "dumping 'expected mac' (10 bytes)" |
| 1292 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1293 | # Tests for Context serialization |
| 1294 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1295 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1296 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1297 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1298 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1299 | 0 \ |
| 1300 | -c "Deserializing connection..." \ |
| 1301 | -S "Deserializing connection..." |
| 1302 | |
| 1303 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1304 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1305 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1306 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1307 | 0 \ |
| 1308 | -c "Deserializing connection..." \ |
| 1309 | -S "Deserializing connection..." |
| 1310 | |
| 1311 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1312 | run_test "Context serialization, client serializes, GCM" \ |
| 1313 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1314 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1315 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1316 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1317 | -S "Deserializing connection..." |
| 1318 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1319 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1320 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1321 | run_test "Context serialization, client serializes, with CID" \ |
| 1322 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1323 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1324 | 0 \ |
| 1325 | -c "Deserializing connection..." \ |
| 1326 | -S "Deserializing connection..." |
| 1327 | |
| 1328 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1329 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1330 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1331 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1332 | 0 \ |
| 1333 | -C "Deserializing connection..." \ |
| 1334 | -s "Deserializing connection..." |
| 1335 | |
| 1336 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1337 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1338 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1339 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1340 | 0 \ |
| 1341 | -C "Deserializing connection..." \ |
| 1342 | -s "Deserializing connection..." |
| 1343 | |
| 1344 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1345 | run_test "Context serialization, server serializes, GCM" \ |
| 1346 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1347 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1348 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1349 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1350 | -s "Deserializing connection..." |
| 1351 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1352 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1354 | run_test "Context serialization, server serializes, with CID" \ |
| 1355 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1356 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1357 | 0 \ |
| 1358 | -C "Deserializing connection..." \ |
| 1359 | -s "Deserializing connection..." |
| 1360 | |
| 1361 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1362 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1363 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1364 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1365 | 0 \ |
| 1366 | -c "Deserializing connection..." \ |
| 1367 | -s "Deserializing connection..." |
| 1368 | |
| 1369 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1370 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1371 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1372 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1373 | 0 \ |
| 1374 | -c "Deserializing connection..." \ |
| 1375 | -s "Deserializing connection..." |
| 1376 | |
| 1377 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1378 | run_test "Context serialization, both serialize, GCM" \ |
| 1379 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1380 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1381 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1382 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1383 | -s "Deserializing connection..." |
| 1384 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1385 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1386 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1387 | run_test "Context serialization, both serialize, with CID" \ |
| 1388 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1389 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1390 | 0 \ |
| 1391 | -c "Deserializing connection..." \ |
| 1392 | -s "Deserializing connection..." |
| 1393 | |
| 1394 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1395 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1396 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1397 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1398 | 0 \ |
| 1399 | -c "Deserializing connection..." \ |
| 1400 | -S "Deserializing connection..." |
| 1401 | |
| 1402 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1403 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1404 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1405 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1406 | 0 \ |
| 1407 | -c "Deserializing connection..." \ |
| 1408 | -S "Deserializing connection..." |
| 1409 | |
| 1410 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1411 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1412 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1413 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1414 | 0 \ |
| 1415 | -c "Deserializing connection..." \ |
| 1416 | -S "Deserializing connection..." |
| 1417 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1418 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1419 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1420 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1421 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1422 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1423 | 0 \ |
| 1424 | -c "Deserializing connection..." \ |
| 1425 | -S "Deserializing connection..." |
| 1426 | |
| 1427 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1428 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1429 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1430 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1431 | 0 \ |
| 1432 | -C "Deserializing connection..." \ |
| 1433 | -s "Deserializing connection..." |
| 1434 | |
| 1435 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1436 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1437 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1438 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1439 | 0 \ |
| 1440 | -C "Deserializing connection..." \ |
| 1441 | -s "Deserializing connection..." |
| 1442 | |
| 1443 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1444 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1445 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1446 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1447 | 0 \ |
| 1448 | -C "Deserializing connection..." \ |
| 1449 | -s "Deserializing connection..." |
| 1450 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1451 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1452 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1453 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1454 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1455 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1456 | 0 \ |
| 1457 | -C "Deserializing connection..." \ |
| 1458 | -s "Deserializing connection..." |
| 1459 | |
| 1460 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1461 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1462 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1463 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1464 | 0 \ |
| 1465 | -c "Deserializing connection..." \ |
| 1466 | -s "Deserializing connection..." |
| 1467 | |
| 1468 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1469 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1470 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1471 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1472 | 0 \ |
| 1473 | -c "Deserializing connection..." \ |
| 1474 | -s "Deserializing connection..." |
| 1475 | |
| 1476 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1477 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1478 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1479 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1480 | 0 \ |
| 1481 | -c "Deserializing connection..." \ |
| 1482 | -s "Deserializing connection..." |
| 1483 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1484 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1485 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1486 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1487 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1488 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1489 | 0 \ |
| 1490 | -c "Deserializing connection..." \ |
| 1491 | -s "Deserializing connection..." |
| 1492 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1493 | # Tests for DTLS Connection ID extension |
| 1494 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1495 | # So far, the CID API isn't implemented, so we can't |
| 1496 | # grep for output witnessing its use. This needs to be |
| 1497 | # changed once the CID extension is implemented. |
| 1498 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1499 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1500 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1501 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1502 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1503 | 0 \ |
| 1504 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1505 | -s "found CID extension" \ |
| 1506 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1507 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1508 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1509 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1510 | -C "found CID extension" \ |
| 1511 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1512 | -C "Copy CIDs into SSL transform" \ |
| 1513 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1514 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1515 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1516 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1517 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1518 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1519 | 0 \ |
| 1520 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1521 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1522 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1523 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1524 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1525 | -C "found CID extension" \ |
| 1526 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1527 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1528 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1529 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1530 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1531 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1532 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1533 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1534 | 0 \ |
| 1535 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1536 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1537 | -c "client hello, adding CID extension" \ |
| 1538 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1539 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1540 | -s "server hello, adding CID extension" \ |
| 1541 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1542 | -c "Use of CID extension negotiated" \ |
| 1543 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1544 | -c "Copy CIDs into SSL transform" \ |
| 1545 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1546 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1547 | -s "Use of Connection ID has been negotiated" \ |
| 1548 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1549 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1550 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1551 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1552 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1553 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1554 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1555 | 0 \ |
| 1556 | -c "Enable use of CID extension." \ |
| 1557 | -s "Enable use of CID extension." \ |
| 1558 | -c "client hello, adding CID extension" \ |
| 1559 | -s "found CID extension" \ |
| 1560 | -s "Use of CID extension negotiated" \ |
| 1561 | -s "server hello, adding CID extension" \ |
| 1562 | -c "found CID extension" \ |
| 1563 | -c "Use of CID extension negotiated" \ |
| 1564 | -s "Copy CIDs into SSL transform" \ |
| 1565 | -c "Copy CIDs into SSL transform" \ |
| 1566 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1567 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1568 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1569 | -c "Use of Connection ID has been negotiated" \ |
| 1570 | -c "ignoring unexpected CID" \ |
| 1571 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1572 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1573 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1574 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1575 | -p "$P_PXY mtu=800" \ |
| 1576 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1577 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1578 | 0 \ |
| 1579 | -c "Enable use of CID extension." \ |
| 1580 | -s "Enable use of CID extension." \ |
| 1581 | -c "client hello, adding CID extension" \ |
| 1582 | -s "found CID extension" \ |
| 1583 | -s "Use of CID extension negotiated" \ |
| 1584 | -s "server hello, adding CID extension" \ |
| 1585 | -c "found CID extension" \ |
| 1586 | -c "Use of CID extension negotiated" \ |
| 1587 | -s "Copy CIDs into SSL transform" \ |
| 1588 | -c "Copy CIDs into SSL transform" \ |
| 1589 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1590 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1591 | -s "Use of Connection ID has been negotiated" \ |
| 1592 | -c "Use of Connection ID has been negotiated" |
| 1593 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1594 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1595 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1596 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1597 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1598 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1599 | 0 \ |
| 1600 | -c "Enable use of CID extension." \ |
| 1601 | -s "Enable use of CID extension." \ |
| 1602 | -c "client hello, adding CID extension" \ |
| 1603 | -s "found CID extension" \ |
| 1604 | -s "Use of CID extension negotiated" \ |
| 1605 | -s "server hello, adding CID extension" \ |
| 1606 | -c "found CID extension" \ |
| 1607 | -c "Use of CID extension negotiated" \ |
| 1608 | -s "Copy CIDs into SSL transform" \ |
| 1609 | -c "Copy CIDs into SSL transform" \ |
| 1610 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1611 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1612 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1613 | -c "Use of Connection ID has been negotiated" \ |
| 1614 | -c "ignoring unexpected CID" \ |
| 1615 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1616 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1618 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1619 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1620 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1621 | 0 \ |
| 1622 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1623 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1624 | -c "client hello, adding CID extension" \ |
| 1625 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1626 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1627 | -s "server hello, adding CID extension" \ |
| 1628 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1629 | -c "Use of CID extension negotiated" \ |
| 1630 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1631 | -c "Copy CIDs into SSL transform" \ |
| 1632 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1633 | -s "Peer CID (length 0 Bytes):" \ |
| 1634 | -s "Use of Connection ID has been negotiated" \ |
| 1635 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1636 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1637 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1638 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1639 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1640 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1641 | 0 \ |
| 1642 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1643 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1644 | -c "client hello, adding CID extension" \ |
| 1645 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1646 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1647 | -s "server hello, adding CID extension" \ |
| 1648 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1649 | -c "Use of CID extension negotiated" \ |
| 1650 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1651 | -c "Copy CIDs into SSL transform" \ |
| 1652 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1653 | -c "Peer CID (length 0 Bytes):" \ |
| 1654 | -s "Use of Connection ID has been negotiated" \ |
| 1655 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1656 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1657 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1658 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1659 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1660 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1661 | 0 \ |
| 1662 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1663 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1664 | -c "client hello, adding CID extension" \ |
| 1665 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1666 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1667 | -s "server hello, adding CID extension" \ |
| 1668 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1669 | -c "Use of CID extension negotiated" \ |
| 1670 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1671 | -c "Copy CIDs into SSL transform" \ |
| 1672 | -S "Use of Connection ID has been negotiated" \ |
| 1673 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1674 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1676 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1677 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1678 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1679 | 0 \ |
| 1680 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1681 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1682 | -c "client hello, adding CID extension" \ |
| 1683 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1684 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1685 | -s "server hello, adding CID extension" \ |
| 1686 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1687 | -c "Use of CID extension negotiated" \ |
| 1688 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1689 | -c "Copy CIDs into SSL transform" \ |
| 1690 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1691 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1692 | -s "Use of Connection ID has been negotiated" \ |
| 1693 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1694 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1695 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1696 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1697 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1698 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1699 | 0 \ |
| 1700 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1701 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1702 | -c "client hello, adding CID extension" \ |
| 1703 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1704 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1705 | -s "server hello, adding CID extension" \ |
| 1706 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1707 | -c "Use of CID extension negotiated" \ |
| 1708 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1709 | -c "Copy CIDs into SSL transform" \ |
| 1710 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1711 | -s "Peer CID (length 0 Bytes):" \ |
| 1712 | -s "Use of Connection ID has been negotiated" \ |
| 1713 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1714 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1716 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1717 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1718 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1719 | 0 \ |
| 1720 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1721 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1722 | -c "client hello, adding CID extension" \ |
| 1723 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1724 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1725 | -s "server hello, adding CID extension" \ |
| 1726 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1727 | -c "Use of CID extension negotiated" \ |
| 1728 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1729 | -c "Copy CIDs into SSL transform" \ |
| 1730 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1731 | -c "Peer CID (length 0 Bytes):" \ |
| 1732 | -s "Use of Connection ID has been negotiated" \ |
| 1733 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1734 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1735 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1736 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1737 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1738 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1739 | 0 \ |
| 1740 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1741 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1742 | -c "client hello, adding CID extension" \ |
| 1743 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1744 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1745 | -s "server hello, adding CID extension" \ |
| 1746 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1747 | -c "Use of CID extension negotiated" \ |
| 1748 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1749 | -c "Copy CIDs into SSL transform" \ |
| 1750 | -S "Use of Connection ID has been negotiated" \ |
| 1751 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1752 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1753 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1754 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1755 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1756 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1757 | 0 \ |
| 1758 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1759 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1760 | -c "client hello, adding CID extension" \ |
| 1761 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1762 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1763 | -s "server hello, adding CID extension" \ |
| 1764 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1765 | -c "Use of CID extension negotiated" \ |
| 1766 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1767 | -c "Copy CIDs into SSL transform" \ |
| 1768 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1769 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1770 | -s "Use of Connection ID has been negotiated" \ |
| 1771 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1772 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1773 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1774 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1775 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1776 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1777 | 0 \ |
| 1778 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1779 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1780 | -c "client hello, adding CID extension" \ |
| 1781 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1782 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1783 | -s "server hello, adding CID extension" \ |
| 1784 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1785 | -c "Use of CID extension negotiated" \ |
| 1786 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1787 | -c "Copy CIDs into SSL transform" \ |
| 1788 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1789 | -s "Peer CID (length 0 Bytes):" \ |
| 1790 | -s "Use of Connection ID has been negotiated" \ |
| 1791 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1792 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1794 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1795 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1796 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1797 | 0 \ |
| 1798 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1799 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1800 | -c "client hello, adding CID extension" \ |
| 1801 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1802 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1803 | -s "server hello, adding CID extension" \ |
| 1804 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1805 | -c "Use of CID extension negotiated" \ |
| 1806 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1807 | -c "Copy CIDs into SSL transform" \ |
| 1808 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1809 | -c "Peer CID (length 0 Bytes):" \ |
| 1810 | -s "Use of Connection ID has been negotiated" \ |
| 1811 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1812 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1813 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1814 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1815 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1816 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1817 | 0 \ |
| 1818 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1819 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1820 | -c "client hello, adding CID extension" \ |
| 1821 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1822 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1823 | -s "server hello, adding CID extension" \ |
| 1824 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1825 | -c "Use of CID extension negotiated" \ |
| 1826 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1827 | -c "Copy CIDs into SSL transform" \ |
| 1828 | -S "Use of Connection ID has been negotiated" \ |
| 1829 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1830 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1831 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1833 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1834 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1835 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 1836 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1837 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1838 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1839 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1840 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1841 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1842 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1843 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1844 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1845 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1846 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1847 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1848 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1849 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1850 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1851 | 0 \ |
| 1852 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1853 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1854 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1855 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1856 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1857 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1858 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1859 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1860 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1861 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1863 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 1864 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1865 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1866 | 0 \ |
| 1867 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1868 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1869 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1870 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1871 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1872 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1873 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1874 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 1875 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1876 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1877 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1878 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1879 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1880 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 1881 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 1882 | 0 \ |
| 1883 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1884 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1885 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1886 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1887 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1888 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1889 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1890 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1891 | -c "ignoring unexpected CID" \ |
| 1892 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1893 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1894 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1895 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1896 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1897 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1898 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1899 | 0 \ |
| 1900 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1901 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1902 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1903 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1904 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1905 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1906 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1907 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1908 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1909 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1910 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1911 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 1912 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1913 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1914 | 0 \ |
| 1915 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1916 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1917 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1918 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1919 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1920 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1921 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1922 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 1923 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1924 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1925 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1926 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1927 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1928 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 1929 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1930 | 0 \ |
| 1931 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1932 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1933 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1934 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1935 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1936 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1937 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1938 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1939 | -c "ignoring unexpected CID" \ |
| 1940 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1941 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1942 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1944 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1945 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1946 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1947 | 0 \ |
| 1948 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1949 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1950 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1951 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1952 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1953 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1954 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1957 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 1958 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1959 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1960 | 0 \ |
| 1961 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1962 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1963 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1964 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1965 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1966 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 1967 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1970 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1971 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1972 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 1973 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 1974 | 0 \ |
| 1975 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1976 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1977 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1978 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1979 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1980 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1981 | -c "ignoring unexpected CID" \ |
| 1982 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1983 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1985 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 1986 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 1987 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 1988 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 1989 | 0 \ |
| 1990 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 1991 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 1992 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1993 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 1994 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 1995 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 1996 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1997 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 1998 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 1999 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2000 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2001 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2002 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2003 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2004 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2005 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2006 | 0 \ |
| 2007 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2008 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2009 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2010 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2011 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2012 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2013 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2014 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2015 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2016 | -c "ignoring unexpected CID" \ |
| 2017 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2018 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2019 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2020 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2021 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2022 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2023 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2024 | 0 \ |
| 2025 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2026 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2027 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2028 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2029 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2030 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2031 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2032 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2033 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2034 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2035 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2036 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2037 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2038 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2039 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2040 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2041 | 0 \ |
| 2042 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2043 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2044 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2045 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2046 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2047 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2048 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2049 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2050 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2051 | -c "ignoring unexpected CID" \ |
| 2052 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2053 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2054 | # Tests for Encrypt-then-MAC extension |
| 2055 | |
| 2056 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2057 | "$P_SRV debug_level=3 \ |
| 2058 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2059 | "$P_CLI debug_level=3" \ |
| 2060 | 0 \ |
| 2061 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2062 | -s "found encrypt then mac extension" \ |
| 2063 | -s "server hello, adding encrypt then mac extension" \ |
| 2064 | -c "found encrypt_then_mac extension" \ |
| 2065 | -c "using encrypt then mac" \ |
| 2066 | -s "using encrypt then mac" |
| 2067 | |
| 2068 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2069 | "$P_SRV debug_level=3 etm=0 \ |
| 2070 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2071 | "$P_CLI debug_level=3 etm=1" \ |
| 2072 | 0 \ |
| 2073 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2074 | -s "found encrypt then mac extension" \ |
| 2075 | -S "server hello, adding encrypt then mac extension" \ |
| 2076 | -C "found encrypt_then_mac extension" \ |
| 2077 | -C "using encrypt then mac" \ |
| 2078 | -S "using encrypt then mac" |
| 2079 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2080 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2081 | "$P_SRV debug_level=3 etm=1 \ |
| 2082 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2083 | "$P_CLI debug_level=3 etm=1" \ |
| 2084 | 0 \ |
| 2085 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2086 | -s "found encrypt then mac extension" \ |
| 2087 | -S "server hello, adding encrypt then mac extension" \ |
| 2088 | -C "found encrypt_then_mac extension" \ |
| 2089 | -C "using encrypt then mac" \ |
| 2090 | -S "using encrypt then mac" |
| 2091 | |
| 2092 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2093 | "$P_SRV debug_level=3 etm=1 \ |
| 2094 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2095 | "$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] | 2096 | 0 \ |
| 2097 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2098 | -s "found encrypt then mac extension" \ |
| 2099 | -S "server hello, adding encrypt then mac extension" \ |
| 2100 | -C "found encrypt_then_mac extension" \ |
| 2101 | -C "using encrypt then mac" \ |
| 2102 | -S "using encrypt then mac" |
| 2103 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2104 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2105 | "$P_SRV debug_level=3 etm=1 \ |
| 2106 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2107 | "$P_CLI debug_level=3 etm=0" \ |
| 2108 | 0 \ |
| 2109 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2110 | -S "found encrypt then mac extension" \ |
| 2111 | -S "server hello, adding encrypt then mac extension" \ |
| 2112 | -C "found encrypt_then_mac extension" \ |
| 2113 | -C "using encrypt then mac" \ |
| 2114 | -S "using encrypt then mac" |
| 2115 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2116 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2117 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2118 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2119 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2120 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2121 | 0 \ |
| 2122 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2123 | -S "found encrypt then mac extension" \ |
| 2124 | -S "server hello, adding encrypt then mac extension" \ |
| 2125 | -C "found encrypt_then_mac extension" \ |
| 2126 | -C "using encrypt then mac" \ |
| 2127 | -S "using encrypt then mac" |
| 2128 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2129 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2130 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2131 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2132 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2133 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2134 | 0 \ |
| 2135 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2136 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2137 | -S "server hello, adding encrypt then mac extension" \ |
| 2138 | -C "found encrypt_then_mac extension" \ |
| 2139 | -C "using encrypt then mac" \ |
| 2140 | -S "using encrypt then mac" |
| 2141 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2142 | # Tests for Extended Master Secret extension |
| 2143 | |
| 2144 | run_test "Extended Master Secret: default" \ |
| 2145 | "$P_SRV debug_level=3" \ |
| 2146 | "$P_CLI debug_level=3" \ |
| 2147 | 0 \ |
| 2148 | -c "client hello, adding extended_master_secret extension" \ |
| 2149 | -s "found extended master secret extension" \ |
| 2150 | -s "server hello, adding extended master secret extension" \ |
| 2151 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2152 | -c "session hash for extended master secret" \ |
| 2153 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2154 | |
| 2155 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2156 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2157 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2158 | 0 \ |
| 2159 | -c "client hello, adding extended_master_secret extension" \ |
| 2160 | -s "found extended master secret extension" \ |
| 2161 | -S "server hello, adding extended master secret extension" \ |
| 2162 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2163 | -C "session hash for extended master secret" \ |
| 2164 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2165 | |
| 2166 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2167 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2168 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2169 | 0 \ |
| 2170 | -C "client hello, adding extended_master_secret extension" \ |
| 2171 | -S "found extended master secret extension" \ |
| 2172 | -S "server hello, adding extended master secret extension" \ |
| 2173 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2174 | -C "session hash for extended master secret" \ |
| 2175 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2176 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2178 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2179 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2180 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2181 | 0 \ |
| 2182 | -C "client hello, adding extended_master_secret extension" \ |
| 2183 | -S "found extended master secret extension" \ |
| 2184 | -S "server hello, adding extended master secret extension" \ |
| 2185 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2186 | -C "session hash for extended master secret" \ |
| 2187 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2188 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2189 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2190 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2191 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2192 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2193 | 0 \ |
| 2194 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2195 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2196 | -S "server hello, adding extended master secret extension" \ |
| 2197 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2198 | -C "session hash for extended master secret" \ |
| 2199 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2200 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2201 | # Tests for FALLBACK_SCSV |
| 2202 | |
| 2203 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2204 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2205 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2206 | 0 \ |
| 2207 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2208 | -S "received FALLBACK_SCSV" \ |
| 2209 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2210 | -C "is a fatal alert message (msg 86)" |
| 2211 | |
| 2212 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2213 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2214 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2215 | 0 \ |
| 2216 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2217 | -S "received FALLBACK_SCSV" \ |
| 2218 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2219 | -C "is a fatal alert message (msg 86)" |
| 2220 | |
| 2221 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2222 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2223 | "$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] | 2224 | 1 \ |
| 2225 | -c "adding FALLBACK_SCSV" \ |
| 2226 | -s "received FALLBACK_SCSV" \ |
| 2227 | -s "inapropriate fallback" \ |
| 2228 | -c "is a fatal alert message (msg 86)" |
| 2229 | |
| 2230 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2231 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2232 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2233 | 0 \ |
| 2234 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2235 | -s "received FALLBACK_SCSV" \ |
| 2236 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2237 | -C "is a fatal alert message (msg 86)" |
| 2238 | |
| 2239 | requires_openssl_with_fallback_scsv |
| 2240 | run_test "Fallback SCSV: default, openssl server" \ |
| 2241 | "$O_SRV" \ |
| 2242 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2243 | 0 \ |
| 2244 | -C "adding FALLBACK_SCSV" \ |
| 2245 | -C "is a fatal alert message (msg 86)" |
| 2246 | |
| 2247 | requires_openssl_with_fallback_scsv |
| 2248 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2249 | "$O_SRV" \ |
| 2250 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2251 | 1 \ |
| 2252 | -c "adding FALLBACK_SCSV" \ |
| 2253 | -c "is a fatal alert message (msg 86)" |
| 2254 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2255 | requires_openssl_with_fallback_scsv |
| 2256 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2257 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2258 | "$O_CLI -tls1_1" \ |
| 2259 | 0 \ |
| 2260 | -S "received FALLBACK_SCSV" \ |
| 2261 | -S "inapropriate fallback" |
| 2262 | |
| 2263 | requires_openssl_with_fallback_scsv |
| 2264 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2265 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2266 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2267 | 1 \ |
| 2268 | -s "received FALLBACK_SCSV" \ |
| 2269 | -s "inapropriate fallback" |
| 2270 | |
| 2271 | requires_openssl_with_fallback_scsv |
| 2272 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2273 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2274 | "$O_CLI -fallback_scsv" \ |
| 2275 | 0 \ |
| 2276 | -s "received FALLBACK_SCSV" \ |
| 2277 | -S "inapropriate fallback" |
| 2278 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2279 | # Test sending and receiving empty application data records |
| 2280 | |
| 2281 | run_test "Encrypt then MAC: empty application data record" \ |
| 2282 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2283 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2284 | 0 \ |
| 2285 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2286 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2287 | -c "0 bytes written in 1 fragments" |
| 2288 | |
| 2289 | run_test "Default, no Encrypt then MAC: empty application data record" \ |
| 2290 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2291 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2292 | 0 \ |
| 2293 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2294 | -c "0 bytes written in 1 fragments" |
| 2295 | |
| 2296 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2297 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2298 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2299 | 0 \ |
| 2300 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2301 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2302 | -c "0 bytes written in 1 fragments" |
| 2303 | |
| 2304 | run_test "Default, no Encrypt then MAC, DTLS: empty application data record" \ |
| 2305 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2306 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2307 | 0 \ |
| 2308 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2309 | -c "0 bytes written in 1 fragments" |
| 2310 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2311 | ## ClientHello generated with |
| 2312 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2313 | ## then manually twiddling the ciphersuite list. |
| 2314 | ## The ClientHello content is spelled out below as a hex string as |
| 2315 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2316 | ## The expected response is an inappropriate_fallback alert. |
| 2317 | requires_openssl_with_fallback_scsv |
| 2318 | run_test "Fallback SCSV: beginning of list" \ |
| 2319 | "$P_SRV debug_level=2" \ |
| 2320 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2321 | 0 \ |
| 2322 | -s "received FALLBACK_SCSV" \ |
| 2323 | -s "inapropriate fallback" |
| 2324 | |
| 2325 | requires_openssl_with_fallback_scsv |
| 2326 | run_test "Fallback SCSV: end of list" \ |
| 2327 | "$P_SRV debug_level=2" \ |
| 2328 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2329 | 0 \ |
| 2330 | -s "received FALLBACK_SCSV" \ |
| 2331 | -s "inapropriate fallback" |
| 2332 | |
| 2333 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2334 | requires_openssl_with_fallback_scsv |
| 2335 | run_test "Fallback SCSV: not in list" \ |
| 2336 | "$P_SRV debug_level=2" \ |
| 2337 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2338 | 0 \ |
| 2339 | -S "received FALLBACK_SCSV" \ |
| 2340 | -S "inapropriate fallback" |
| 2341 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2342 | # Tests for CBC 1/n-1 record splitting |
| 2343 | |
| 2344 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2345 | "$P_SRV" \ |
| 2346 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2347 | request_size=123 force_version=tls1_2" \ |
| 2348 | 0 \ |
| 2349 | -s "Read from client: 123 bytes read" \ |
| 2350 | -S "Read from client: 1 bytes read" \ |
| 2351 | -S "122 bytes read" |
| 2352 | |
| 2353 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2354 | "$P_SRV" \ |
| 2355 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2356 | request_size=123 force_version=tls1_1" \ |
| 2357 | 0 \ |
| 2358 | -s "Read from client: 123 bytes read" \ |
| 2359 | -S "Read from client: 1 bytes read" \ |
| 2360 | -S "122 bytes read" |
| 2361 | |
| 2362 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2363 | "$P_SRV" \ |
| 2364 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2365 | request_size=123 force_version=tls1" \ |
| 2366 | 0 \ |
| 2367 | -S "Read from client: 123 bytes read" \ |
| 2368 | -s "Read from client: 1 bytes read" \ |
| 2369 | -s "122 bytes read" |
| 2370 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2371 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2372 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2373 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2374 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2375 | request_size=123 force_version=ssl3" \ |
| 2376 | 0 \ |
| 2377 | -S "Read from client: 123 bytes read" \ |
| 2378 | -s "Read from client: 1 bytes read" \ |
| 2379 | -s "122 bytes read" |
| 2380 | |
| 2381 | 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] | 2382 | "$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] | 2383 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2384 | request_size=123 force_version=tls1" \ |
| 2385 | 0 \ |
| 2386 | -s "Read from client: 123 bytes read" \ |
| 2387 | -S "Read from client: 1 bytes read" \ |
| 2388 | -S "122 bytes read" |
| 2389 | |
| 2390 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2391 | "$P_SRV" \ |
| 2392 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2393 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2394 | 0 \ |
| 2395 | -s "Read from client: 123 bytes read" \ |
| 2396 | -S "Read from client: 1 bytes read" \ |
| 2397 | -S "122 bytes read" |
| 2398 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2399 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2400 | "$P_SRV nbio=2" \ |
| 2401 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2402 | request_size=123 force_version=tls1" \ |
| 2403 | 0 \ |
| 2404 | -S "Read from client: 123 bytes read" \ |
| 2405 | -s "Read from client: 1 bytes read" \ |
| 2406 | -s "122 bytes read" |
| 2407 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2408 | # Tests for Session Tickets |
| 2409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2410 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2411 | "$P_SRV debug_level=3 tickets=1" \ |
| 2412 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2413 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2414 | -c "client hello, adding session ticket extension" \ |
| 2415 | -s "found session ticket extension" \ |
| 2416 | -s "server hello, adding session ticket extension" \ |
| 2417 | -c "found session_ticket extension" \ |
| 2418 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2419 | -S "session successfully restored from cache" \ |
| 2420 | -s "session successfully restored from ticket" \ |
| 2421 | -s "a session has been resumed" \ |
| 2422 | -c "a session has been resumed" |
| 2423 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2424 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2425 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2426 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2427 | 0 \ |
| 2428 | -c "client hello, adding session ticket extension" \ |
| 2429 | -s "found session ticket extension" \ |
| 2430 | -s "server hello, adding session ticket extension" \ |
| 2431 | -c "found session_ticket extension" \ |
| 2432 | -c "parse new session ticket" \ |
| 2433 | -S "session successfully restored from cache" \ |
| 2434 | -s "session successfully restored from ticket" \ |
| 2435 | -s "a session has been resumed" \ |
| 2436 | -c "a session has been resumed" |
| 2437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2438 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2439 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2440 | "$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] | 2441 | 0 \ |
| 2442 | -c "client hello, adding session ticket extension" \ |
| 2443 | -s "found session ticket extension" \ |
| 2444 | -s "server hello, adding session ticket extension" \ |
| 2445 | -c "found session_ticket extension" \ |
| 2446 | -c "parse new session ticket" \ |
| 2447 | -S "session successfully restored from cache" \ |
| 2448 | -S "session successfully restored from ticket" \ |
| 2449 | -S "a session has been resumed" \ |
| 2450 | -C "a session has been resumed" |
| 2451 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2452 | run_test "Session resume using tickets: session copy" \ |
| 2453 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2454 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2455 | 0 \ |
| 2456 | -c "client hello, adding session ticket extension" \ |
| 2457 | -s "found session ticket extension" \ |
| 2458 | -s "server hello, adding session ticket extension" \ |
| 2459 | -c "found session_ticket extension" \ |
| 2460 | -c "parse new session ticket" \ |
| 2461 | -S "session successfully restored from cache" \ |
| 2462 | -s "session successfully restored from ticket" \ |
| 2463 | -s "a session has been resumed" \ |
| 2464 | -c "a session has been resumed" |
| 2465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2466 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2467 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2468 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2469 | 0 \ |
| 2470 | -c "client hello, adding session ticket extension" \ |
| 2471 | -c "found session_ticket extension" \ |
| 2472 | -c "parse new session ticket" \ |
| 2473 | -c "a session has been resumed" |
| 2474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2475 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2476 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2477 | "( $O_CLI -sess_out $SESSION; \ |
| 2478 | $O_CLI -sess_in $SESSION; \ |
| 2479 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2480 | 0 \ |
| 2481 | -s "found session ticket extension" \ |
| 2482 | -s "server hello, adding session ticket extension" \ |
| 2483 | -S "session successfully restored from cache" \ |
| 2484 | -s "session successfully restored from ticket" \ |
| 2485 | -s "a session has been resumed" |
| 2486 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2487 | # Tests for Session Tickets with DTLS |
| 2488 | |
| 2489 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2490 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
| 2491 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2492 | 0 \ |
| 2493 | -c "client hello, adding session ticket extension" \ |
| 2494 | -s "found session ticket extension" \ |
| 2495 | -s "server hello, adding session ticket extension" \ |
| 2496 | -c "found session_ticket extension" \ |
| 2497 | -c "parse new session ticket" \ |
| 2498 | -S "session successfully restored from cache" \ |
| 2499 | -s "session successfully restored from ticket" \ |
| 2500 | -s "a session has been resumed" \ |
| 2501 | -c "a session has been resumed" |
| 2502 | |
| 2503 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2504 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2505 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1" \ |
| 2506 | 0 \ |
| 2507 | -c "client hello, adding session ticket extension" \ |
| 2508 | -s "found session ticket extension" \ |
| 2509 | -s "server hello, adding session ticket extension" \ |
| 2510 | -c "found session_ticket extension" \ |
| 2511 | -c "parse new session ticket" \ |
| 2512 | -S "session successfully restored from cache" \ |
| 2513 | -s "session successfully restored from ticket" \ |
| 2514 | -s "a session has been resumed" \ |
| 2515 | -c "a session has been resumed" |
| 2516 | |
| 2517 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2518 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2519 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_delay=2" \ |
| 2520 | 0 \ |
| 2521 | -c "client hello, adding session ticket extension" \ |
| 2522 | -s "found session ticket extension" \ |
| 2523 | -s "server hello, adding session ticket extension" \ |
| 2524 | -c "found session_ticket extension" \ |
| 2525 | -c "parse new session ticket" \ |
| 2526 | -S "session successfully restored from cache" \ |
| 2527 | -S "session successfully restored from ticket" \ |
| 2528 | -S "a session has been resumed" \ |
| 2529 | -C "a session has been resumed" |
| 2530 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2531 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2532 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
| 2533 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 reco_mode=0" \ |
| 2534 | 0 \ |
| 2535 | -c "client hello, adding session ticket extension" \ |
| 2536 | -s "found session ticket extension" \ |
| 2537 | -s "server hello, adding session ticket extension" \ |
| 2538 | -c "found session_ticket extension" \ |
| 2539 | -c "parse new session ticket" \ |
| 2540 | -S "session successfully restored from cache" \ |
| 2541 | -s "session successfully restored from ticket" \ |
| 2542 | -s "a session has been resumed" \ |
| 2543 | -c "a session has been resumed" |
| 2544 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2545 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2546 | "$O_SRV -dtls1" \ |
| 2547 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2548 | 0 \ |
| 2549 | -c "client hello, adding session ticket extension" \ |
| 2550 | -c "found session_ticket extension" \ |
| 2551 | -c "parse new session ticket" \ |
| 2552 | -c "a session has been resumed" |
| 2553 | |
| 2554 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2555 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2556 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2557 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2558 | rm -f $SESSION )" \ |
| 2559 | 0 \ |
| 2560 | -s "found session ticket extension" \ |
| 2561 | -s "server hello, adding session ticket extension" \ |
| 2562 | -S "session successfully restored from cache" \ |
| 2563 | -s "session successfully restored from ticket" \ |
| 2564 | -s "a session has been resumed" |
| 2565 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2566 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2567 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2568 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 tickets=0" \ |
| 2570 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2571 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2572 | -c "client hello, adding session ticket extension" \ |
| 2573 | -s "found session ticket extension" \ |
| 2574 | -S "server hello, adding session ticket extension" \ |
| 2575 | -C "found session_ticket extension" \ |
| 2576 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2577 | -s "session successfully restored from cache" \ |
| 2578 | -S "session successfully restored from ticket" \ |
| 2579 | -s "a session has been resumed" \ |
| 2580 | -c "a session has been resumed" |
| 2581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2582 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2583 | "$P_SRV debug_level=3 tickets=1" \ |
| 2584 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2585 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2586 | -C "client hello, adding session ticket extension" \ |
| 2587 | -S "found session ticket extension" \ |
| 2588 | -S "server hello, adding session ticket extension" \ |
| 2589 | -C "found session_ticket extension" \ |
| 2590 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2591 | -s "session successfully restored from cache" \ |
| 2592 | -S "session successfully restored from ticket" \ |
| 2593 | -s "a session has been resumed" \ |
| 2594 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2596 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2597 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2598 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2599 | 0 \ |
| 2600 | -S "session successfully restored from cache" \ |
| 2601 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2602 | -S "a session has been resumed" \ |
| 2603 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2604 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2605 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2606 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2607 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2608 | 0 \ |
| 2609 | -s "session successfully restored from cache" \ |
| 2610 | -S "session successfully restored from ticket" \ |
| 2611 | -s "a session has been resumed" \ |
| 2612 | -c "a session has been resumed" |
| 2613 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2614 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2615 | "$P_SRV debug_level=3 tickets=0" \ |
| 2616 | "$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] | 2617 | 0 \ |
| 2618 | -s "session successfully restored from cache" \ |
| 2619 | -S "session successfully restored from ticket" \ |
| 2620 | -s "a session has been resumed" \ |
| 2621 | -c "a session has been resumed" |
| 2622 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2623 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2624 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2625 | "$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] | 2626 | 0 \ |
| 2627 | -S "session successfully restored from cache" \ |
| 2628 | -S "session successfully restored from ticket" \ |
| 2629 | -S "a session has been resumed" \ |
| 2630 | -C "a session has been resumed" |
| 2631 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2632 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2633 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2634 | "$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] | 2635 | 0 \ |
| 2636 | -s "session successfully restored from cache" \ |
| 2637 | -S "session successfully restored from ticket" \ |
| 2638 | -s "a session has been resumed" \ |
| 2639 | -c "a session has been resumed" |
| 2640 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2641 | run_test "Session resume using cache: session copy" \ |
| 2642 | "$P_SRV debug_level=3 tickets=0" \ |
| 2643 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2644 | 0 \ |
| 2645 | -s "session successfully restored from cache" \ |
| 2646 | -S "session successfully restored from ticket" \ |
| 2647 | -s "a session has been resumed" \ |
| 2648 | -c "a session has been resumed" |
| 2649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2650 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2651 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2652 | "( $O_CLI -sess_out $SESSION; \ |
| 2653 | $O_CLI -sess_in $SESSION; \ |
| 2654 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2655 | 0 \ |
| 2656 | -s "found session ticket extension" \ |
| 2657 | -S "server hello, adding session ticket extension" \ |
| 2658 | -s "session successfully restored from cache" \ |
| 2659 | -S "session successfully restored from ticket" \ |
| 2660 | -s "a session has been resumed" |
| 2661 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2662 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2663 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2664 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2665 | 0 \ |
| 2666 | -C "found session_ticket extension" \ |
| 2667 | -C "parse new session ticket" \ |
| 2668 | -c "a session has been resumed" |
| 2669 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2670 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2671 | |
| 2672 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2673 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2674 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2675 | 0 \ |
| 2676 | -c "client hello, adding session ticket extension" \ |
| 2677 | -s "found session ticket extension" \ |
| 2678 | -S "server hello, adding session ticket extension" \ |
| 2679 | -C "found session_ticket extension" \ |
| 2680 | -C "parse new session ticket" \ |
| 2681 | -s "session successfully restored from cache" \ |
| 2682 | -S "session successfully restored from ticket" \ |
| 2683 | -s "a session has been resumed" \ |
| 2684 | -c "a session has been resumed" |
| 2685 | |
| 2686 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2687 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2688 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2689 | 0 \ |
| 2690 | -C "client hello, adding session ticket extension" \ |
| 2691 | -S "found session ticket extension" \ |
| 2692 | -S "server hello, adding session ticket extension" \ |
| 2693 | -C "found session_ticket extension" \ |
| 2694 | -C "parse new session ticket" \ |
| 2695 | -s "session successfully restored from cache" \ |
| 2696 | -S "session successfully restored from ticket" \ |
| 2697 | -s "a session has been resumed" \ |
| 2698 | -c "a session has been resumed" |
| 2699 | |
| 2700 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2701 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
| 2702 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2703 | 0 \ |
| 2704 | -S "session successfully restored from cache" \ |
| 2705 | -S "session successfully restored from ticket" \ |
| 2706 | -S "a session has been resumed" \ |
| 2707 | -C "a session has been resumed" |
| 2708 | |
| 2709 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2710 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
| 2711 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2712 | 0 \ |
| 2713 | -s "session successfully restored from cache" \ |
| 2714 | -S "session successfully restored from ticket" \ |
| 2715 | -s "a session has been resumed" \ |
| 2716 | -c "a session has been resumed" |
| 2717 | |
| 2718 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2719 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2720 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
| 2721 | 0 \ |
| 2722 | -s "session successfully restored from cache" \ |
| 2723 | -S "session successfully restored from ticket" \ |
| 2724 | -s "a session has been resumed" \ |
| 2725 | -c "a session has been resumed" |
| 2726 | |
| 2727 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2728 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
| 2729 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2730 | 0 \ |
| 2731 | -S "session successfully restored from cache" \ |
| 2732 | -S "session successfully restored from ticket" \ |
| 2733 | -S "a session has been resumed" \ |
| 2734 | -C "a session has been resumed" |
| 2735 | |
| 2736 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2737 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
| 2738 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_delay=2" \ |
| 2739 | 0 \ |
| 2740 | -s "session successfully restored from cache" \ |
| 2741 | -S "session successfully restored from ticket" \ |
| 2742 | -s "a session has been resumed" \ |
| 2743 | -c "a session has been resumed" |
| 2744 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2745 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2746 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2747 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2748 | 0 \ |
| 2749 | -s "session successfully restored from cache" \ |
| 2750 | -S "session successfully restored from ticket" \ |
| 2751 | -s "a session has been resumed" \ |
| 2752 | -c "a session has been resumed" |
| 2753 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2754 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2755 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2756 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2757 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2758 | rm -f $SESSION )" \ |
| 2759 | 0 \ |
| 2760 | -s "found session ticket extension" \ |
| 2761 | -S "server hello, adding session ticket extension" \ |
| 2762 | -s "session successfully restored from cache" \ |
| 2763 | -S "session successfully restored from ticket" \ |
| 2764 | -s "a session has been resumed" |
| 2765 | |
| 2766 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2767 | "$O_SRV -dtls1" \ |
| 2768 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2769 | 0 \ |
| 2770 | -C "found session_ticket extension" \ |
| 2771 | -C "parse new session ticket" \ |
| 2772 | -c "a session has been resumed" |
| 2773 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2774 | # Tests for Max Fragment Length extension |
| 2775 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2776 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 2777 | 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] | 2778 | exit 1 |
| 2779 | fi |
| 2780 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2781 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 2782 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 2783 | fi |
| 2784 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2785 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2786 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2787 | "$P_SRV debug_level=3" \ |
| 2788 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2789 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2790 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2791 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2792 | -C "client hello, adding max_fragment_length extension" \ |
| 2793 | -S "found max fragment length extension" \ |
| 2794 | -S "server hello, max_fragment_length extension" \ |
| 2795 | -C "found max_fragment_length extension" |
| 2796 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2797 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2798 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2799 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2800 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2801 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2802 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2803 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2804 | -C "client hello, adding max_fragment_length extension" \ |
| 2805 | -S "found max fragment length extension" \ |
| 2806 | -S "server hello, max_fragment_length extension" \ |
| 2807 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2808 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2809 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2810 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2811 | |
| 2812 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2813 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2814 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2815 | "$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] | 2816 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2817 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2818 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2819 | -C "client hello, adding max_fragment_length extension" \ |
| 2820 | -S "found max fragment length extension" \ |
| 2821 | -S "server hello, max_fragment_length extension" \ |
| 2822 | -C "found max_fragment_length extension" \ |
| 2823 | -c "fragment larger than.*maximum " |
| 2824 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2825 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2826 | # (session fragment length will be 16384 regardless of mbedtls |
| 2827 | # content length configuration.) |
| 2828 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2829 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2830 | run_test "Max fragment length: disabled, larger message" \ |
| 2831 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2832 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2833 | 0 \ |
| 2834 | -C "Maximum fragment length is 16384" \ |
| 2835 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2836 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2837 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2838 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2839 | |
| 2840 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2841 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2842 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2843 | "$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] | 2844 | 1 \ |
| 2845 | -C "Maximum fragment length is 16384" \ |
| 2846 | -S "Maximum fragment length is 16384" \ |
| 2847 | -c "fragment larger than.*maximum " |
| 2848 | |
| 2849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2850 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2851 | "$P_SRV debug_level=3" \ |
| 2852 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2853 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2854 | -c "Maximum fragment length is 4096" \ |
| 2855 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2856 | -c "client hello, adding max_fragment_length extension" \ |
| 2857 | -s "found max fragment length extension" \ |
| 2858 | -s "server hello, max_fragment_length extension" \ |
| 2859 | -c "found max_fragment_length extension" |
| 2860 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2861 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2862 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2863 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2864 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2865 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2866 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2867 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2868 | -C "client hello, adding max_fragment_length extension" \ |
| 2869 | -S "found max fragment length extension" \ |
| 2870 | -S "server hello, max_fragment_length extension" \ |
| 2871 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2872 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2873 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2874 | requires_gnutls |
| 2875 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2876 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2877 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2878 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2879 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2880 | -c "client hello, adding max_fragment_length extension" \ |
| 2881 | -c "found max_fragment_length extension" |
| 2882 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2883 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2884 | run_test "Max fragment length: client, message just fits" \ |
| 2885 | "$P_SRV debug_level=3" \ |
| 2886 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2887 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2888 | -c "Maximum fragment length is 2048" \ |
| 2889 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2890 | -c "client hello, adding max_fragment_length extension" \ |
| 2891 | -s "found max fragment length extension" \ |
| 2892 | -s "server hello, max_fragment_length extension" \ |
| 2893 | -c "found max_fragment_length extension" \ |
| 2894 | -c "2048 bytes written in 1 fragments" \ |
| 2895 | -s "2048 bytes read" |
| 2896 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2897 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2898 | run_test "Max fragment length: client, larger message" \ |
| 2899 | "$P_SRV debug_level=3" \ |
| 2900 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2901 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2902 | -c "Maximum fragment length is 2048" \ |
| 2903 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2904 | -c "client hello, adding max_fragment_length extension" \ |
| 2905 | -s "found max fragment length extension" \ |
| 2906 | -s "server hello, max_fragment_length extension" \ |
| 2907 | -c "found max_fragment_length extension" \ |
| 2908 | -c "2345 bytes written in 2 fragments" \ |
| 2909 | -s "2048 bytes read" \ |
| 2910 | -s "297 bytes read" |
| 2911 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2912 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2913 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2914 | "$P_SRV debug_level=3 dtls=1" \ |
| 2915 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2916 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2917 | -c "Maximum fragment length is 2048" \ |
| 2918 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2919 | -c "client hello, adding max_fragment_length extension" \ |
| 2920 | -s "found max fragment length extension" \ |
| 2921 | -s "server hello, max_fragment_length extension" \ |
| 2922 | -c "found max_fragment_length extension" \ |
| 2923 | -c "fragment larger than.*maximum" |
| 2924 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2925 | # Tests for renegotiation |
| 2926 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2927 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2928 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2929 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2931 | 0 \ |
| 2932 | -C "client hello, adding renegotiation extension" \ |
| 2933 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2934 | -S "found renegotiation extension" \ |
| 2935 | -s "server hello, secure renegotiation extension" \ |
| 2936 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2937 | -C "=> renegotiate" \ |
| 2938 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2939 | -S "write hello request" |
| 2940 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2941 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2942 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2943 | "$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] | 2944 | "$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] | 2945 | 0 \ |
| 2946 | -c "client hello, adding renegotiation extension" \ |
| 2947 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2948 | -s "found renegotiation extension" \ |
| 2949 | -s "server hello, secure renegotiation extension" \ |
| 2950 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2951 | -c "=> renegotiate" \ |
| 2952 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2953 | -S "write hello request" |
| 2954 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2955 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2956 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2957 | "$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] | 2958 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2959 | 0 \ |
| 2960 | -c "client hello, adding renegotiation extension" \ |
| 2961 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2962 | -s "found renegotiation extension" \ |
| 2963 | -s "server hello, secure renegotiation extension" \ |
| 2964 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2965 | -c "=> renegotiate" \ |
| 2966 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2967 | -s "write hello request" |
| 2968 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2969 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2970 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2971 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2972 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2973 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2974 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2975 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2976 | 0 \ |
| 2977 | -c "client hello, adding renegotiation extension" \ |
| 2978 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2979 | -s "found renegotiation extension" \ |
| 2980 | -s "server hello, secure renegotiation extension" \ |
| 2981 | -c "found renegotiation extension" \ |
| 2982 | -c "=> renegotiate" \ |
| 2983 | -s "=> renegotiate" \ |
| 2984 | -S "write hello request" \ |
| 2985 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2986 | |
| 2987 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2988 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2989 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2990 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2991 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2992 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2993 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2994 | 0 \ |
| 2995 | -c "client hello, adding renegotiation extension" \ |
| 2996 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2997 | -s "found renegotiation extension" \ |
| 2998 | -s "server hello, secure renegotiation extension" \ |
| 2999 | -c "found renegotiation extension" \ |
| 3000 | -c "=> renegotiate" \ |
| 3001 | -s "=> renegotiate" \ |
| 3002 | -s "write hello request" \ |
| 3003 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3004 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3006 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3007 | "$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] | 3008 | "$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] | 3009 | 0 \ |
| 3010 | -c "client hello, adding renegotiation extension" \ |
| 3011 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3012 | -s "found renegotiation extension" \ |
| 3013 | -s "server hello, secure renegotiation extension" \ |
| 3014 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3015 | -c "=> renegotiate" \ |
| 3016 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3017 | -s "write hello request" |
| 3018 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3020 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3021 | "$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] | 3022 | "$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] | 3023 | 1 \ |
| 3024 | -c "client hello, adding renegotiation extension" \ |
| 3025 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3026 | -S "found renegotiation extension" \ |
| 3027 | -s "server hello, secure renegotiation extension" \ |
| 3028 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3029 | -c "=> renegotiate" \ |
| 3030 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3031 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3032 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3033 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3034 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3035 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3036 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3037 | "$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] | 3038 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3039 | 0 \ |
| 3040 | -C "client hello, adding renegotiation extension" \ |
| 3041 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3042 | -S "found renegotiation extension" \ |
| 3043 | -s "server hello, secure renegotiation extension" \ |
| 3044 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3045 | -C "=> renegotiate" \ |
| 3046 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3047 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3048 | -S "SSL - An unexpected message was received from our peer" \ |
| 3049 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3050 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3051 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3052 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3053 | "$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] | 3054 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3055 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3056 | 0 \ |
| 3057 | -C "client hello, adding renegotiation extension" \ |
| 3058 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3059 | -S "found renegotiation extension" \ |
| 3060 | -s "server hello, secure renegotiation extension" \ |
| 3061 | -c "found renegotiation extension" \ |
| 3062 | -C "=> renegotiate" \ |
| 3063 | -S "=> renegotiate" \ |
| 3064 | -s "write hello request" \ |
| 3065 | -S "SSL - An unexpected message was received from our peer" \ |
| 3066 | -S "failed" |
| 3067 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3068 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3069 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3070 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3071 | "$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] | 3072 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3073 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3074 | 0 \ |
| 3075 | -C "client hello, adding renegotiation extension" \ |
| 3076 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3077 | -S "found renegotiation extension" \ |
| 3078 | -s "server hello, secure renegotiation extension" \ |
| 3079 | -c "found renegotiation extension" \ |
| 3080 | -C "=> renegotiate" \ |
| 3081 | -S "=> renegotiate" \ |
| 3082 | -s "write hello request" \ |
| 3083 | -S "SSL - An unexpected message was received from our peer" \ |
| 3084 | -S "failed" |
| 3085 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3086 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3087 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3088 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3089 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3090 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3091 | 0 \ |
| 3092 | -C "client hello, adding renegotiation extension" \ |
| 3093 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3094 | -S "found renegotiation extension" \ |
| 3095 | -s "server hello, secure renegotiation extension" \ |
| 3096 | -c "found renegotiation extension" \ |
| 3097 | -C "=> renegotiate" \ |
| 3098 | -S "=> renegotiate" \ |
| 3099 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3100 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3101 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3102 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3103 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3104 | "$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] | 3105 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3106 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3107 | 0 \ |
| 3108 | -c "client hello, adding renegotiation extension" \ |
| 3109 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3110 | -s "found renegotiation extension" \ |
| 3111 | -s "server hello, secure renegotiation extension" \ |
| 3112 | -c "found renegotiation extension" \ |
| 3113 | -c "=> renegotiate" \ |
| 3114 | -s "=> renegotiate" \ |
| 3115 | -s "write hello request" \ |
| 3116 | -S "SSL - An unexpected message was received from our peer" \ |
| 3117 | -S "failed" |
| 3118 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3120 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3121 | "$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] | 3122 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3123 | 0 \ |
| 3124 | -C "client hello, adding renegotiation extension" \ |
| 3125 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3126 | -S "found renegotiation extension" \ |
| 3127 | -s "server hello, secure renegotiation extension" \ |
| 3128 | -c "found renegotiation extension" \ |
| 3129 | -S "record counter limit reached: renegotiate" \ |
| 3130 | -C "=> renegotiate" \ |
| 3131 | -S "=> renegotiate" \ |
| 3132 | -S "write hello request" \ |
| 3133 | -S "SSL - An unexpected message was received from our peer" \ |
| 3134 | -S "failed" |
| 3135 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3136 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3137 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3138 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3139 | "$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] | 3140 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3141 | 0 \ |
| 3142 | -c "client hello, adding renegotiation extension" \ |
| 3143 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3144 | -s "found renegotiation extension" \ |
| 3145 | -s "server hello, secure renegotiation extension" \ |
| 3146 | -c "found renegotiation extension" \ |
| 3147 | -s "record counter limit reached: renegotiate" \ |
| 3148 | -c "=> renegotiate" \ |
| 3149 | -s "=> renegotiate" \ |
| 3150 | -s "write hello request" \ |
| 3151 | -S "SSL - An unexpected message was received from our peer" \ |
| 3152 | -S "failed" |
| 3153 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3154 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3155 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3156 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3157 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3158 | 0 \ |
| 3159 | -c "client hello, adding renegotiation extension" \ |
| 3160 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3161 | -s "found renegotiation extension" \ |
| 3162 | -s "server hello, secure renegotiation extension" \ |
| 3163 | -c "found renegotiation extension" \ |
| 3164 | -s "record counter limit reached: renegotiate" \ |
| 3165 | -c "=> renegotiate" \ |
| 3166 | -s "=> renegotiate" \ |
| 3167 | -s "write hello request" \ |
| 3168 | -S "SSL - An unexpected message was received from our peer" \ |
| 3169 | -S "failed" |
| 3170 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3172 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3173 | "$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] | 3174 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3175 | 0 \ |
| 3176 | -C "client hello, adding renegotiation extension" \ |
| 3177 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3178 | -S "found renegotiation extension" \ |
| 3179 | -s "server hello, secure renegotiation extension" \ |
| 3180 | -c "found renegotiation extension" \ |
| 3181 | -S "record counter limit reached: renegotiate" \ |
| 3182 | -C "=> renegotiate" \ |
| 3183 | -S "=> renegotiate" \ |
| 3184 | -S "write hello request" \ |
| 3185 | -S "SSL - An unexpected message was received from our peer" \ |
| 3186 | -S "failed" |
| 3187 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3188 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3189 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3190 | "$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] | 3191 | "$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] | 3192 | 0 \ |
| 3193 | -c "client hello, adding renegotiation extension" \ |
| 3194 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3195 | -s "found renegotiation extension" \ |
| 3196 | -s "server hello, secure renegotiation extension" \ |
| 3197 | -c "found renegotiation extension" \ |
| 3198 | -c "=> renegotiate" \ |
| 3199 | -s "=> renegotiate" \ |
| 3200 | -S "write hello request" |
| 3201 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3203 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3204 | "$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] | 3205 | "$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] | 3206 | 0 \ |
| 3207 | -c "client hello, adding renegotiation extension" \ |
| 3208 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3209 | -s "found renegotiation extension" \ |
| 3210 | -s "server hello, secure renegotiation extension" \ |
| 3211 | -c "found renegotiation extension" \ |
| 3212 | -c "=> renegotiate" \ |
| 3213 | -s "=> renegotiate" \ |
| 3214 | -s "write hello request" |
| 3215 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3217 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3218 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3219 | "$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] | 3220 | 0 \ |
| 3221 | -c "client hello, adding renegotiation extension" \ |
| 3222 | -c "found renegotiation extension" \ |
| 3223 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3224 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3225 | -C "error" \ |
| 3226 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3227 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3228 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3229 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3230 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3231 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3232 | "$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] | 3233 | 0 \ |
| 3234 | -c "client hello, adding renegotiation extension" \ |
| 3235 | -c "found renegotiation extension" \ |
| 3236 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3237 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3238 | -C "error" \ |
| 3239 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3240 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3241 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3242 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3243 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3244 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3245 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3246 | 1 \ |
| 3247 | -c "client hello, adding renegotiation extension" \ |
| 3248 | -C "found renegotiation extension" \ |
| 3249 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3250 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3251 | -c "error" \ |
| 3252 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3253 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3254 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3256 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3257 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3258 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3259 | allow_legacy=0" \ |
| 3260 | 1 \ |
| 3261 | -c "client hello, adding renegotiation extension" \ |
| 3262 | -C "found renegotiation extension" \ |
| 3263 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3264 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3265 | -c "error" \ |
| 3266 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3267 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3268 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3269 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3270 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3271 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3272 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3273 | allow_legacy=1" \ |
| 3274 | 0 \ |
| 3275 | -c "client hello, adding renegotiation extension" \ |
| 3276 | -C "found renegotiation extension" \ |
| 3277 | -c "=> renegotiate" \ |
| 3278 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3279 | -C "error" \ |
| 3280 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3281 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3283 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3284 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3285 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3286 | 0 \ |
| 3287 | -c "client hello, adding renegotiation extension" \ |
| 3288 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3289 | -s "found renegotiation extension" \ |
| 3290 | -s "server hello, secure renegotiation extension" \ |
| 3291 | -c "found renegotiation extension" \ |
| 3292 | -c "=> renegotiate" \ |
| 3293 | -s "=> renegotiate" \ |
| 3294 | -S "write hello request" |
| 3295 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3297 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3298 | "$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] | 3299 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3300 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3301 | 0 \ |
| 3302 | -c "client hello, adding renegotiation extension" \ |
| 3303 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3304 | -s "found renegotiation extension" \ |
| 3305 | -s "server hello, secure renegotiation extension" \ |
| 3306 | -c "found renegotiation extension" \ |
| 3307 | -c "=> renegotiate" \ |
| 3308 | -s "=> renegotiate" \ |
| 3309 | -s "write hello request" |
| 3310 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3312 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3313 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3314 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3315 | 0 \ |
| 3316 | -c "client hello, adding renegotiation extension" \ |
| 3317 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3318 | -s "found renegotiation extension" \ |
| 3319 | -s "server hello, secure renegotiation extension" \ |
| 3320 | -s "record counter limit reached: renegotiate" \ |
| 3321 | -c "=> renegotiate" \ |
| 3322 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3323 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3324 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3325 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3326 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3327 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3328 | "$G_SRV -u --mtu 4096" \ |
| 3329 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3330 | 0 \ |
| 3331 | -c "client hello, adding renegotiation extension" \ |
| 3332 | -c "found renegotiation extension" \ |
| 3333 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3334 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3335 | -C "error" \ |
| 3336 | -s "Extra-header:" |
| 3337 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3338 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3339 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3340 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3341 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3342 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3343 | "$P_CLI debug_level=3" \ |
| 3344 | 0 \ |
| 3345 | -c "found renegotiation extension" \ |
| 3346 | -C "error" \ |
| 3347 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3348 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3349 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3350 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3351 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3352 | "$P_CLI debug_level=3" \ |
| 3353 | 0 \ |
| 3354 | -C "found renegotiation extension" \ |
| 3355 | -C "error" \ |
| 3356 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3357 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3358 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3359 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3360 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3361 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3362 | 1 \ |
| 3363 | -C "found renegotiation extension" \ |
| 3364 | -c "error" \ |
| 3365 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3366 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3367 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3368 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3369 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3370 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3371 | 0 \ |
| 3372 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3373 | -s "server hello, secure renegotiation extension" |
| 3374 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3375 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3376 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3377 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3378 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3379 | 0 \ |
| 3380 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3381 | -S "server hello, secure renegotiation extension" |
| 3382 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3383 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3384 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3385 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3386 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3387 | 1 \ |
| 3388 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3389 | -S "server hello, secure renegotiation extension" |
| 3390 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3391 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3392 | |
| 3393 | requires_gnutls |
| 3394 | run_test "DER format: no trailing bytes" \ |
| 3395 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3396 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3397 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3398 | 0 \ |
| 3399 | -c "Handshake was completed" \ |
| 3400 | |
| 3401 | requires_gnutls |
| 3402 | run_test "DER format: with a trailing zero byte" \ |
| 3403 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3404 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3405 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3406 | 0 \ |
| 3407 | -c "Handshake was completed" \ |
| 3408 | |
| 3409 | requires_gnutls |
| 3410 | run_test "DER format: with a trailing random byte" \ |
| 3411 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3412 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3413 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3414 | 0 \ |
| 3415 | -c "Handshake was completed" \ |
| 3416 | |
| 3417 | requires_gnutls |
| 3418 | run_test "DER format: with 2 trailing random bytes" \ |
| 3419 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3420 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3421 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3422 | 0 \ |
| 3423 | -c "Handshake was completed" \ |
| 3424 | |
| 3425 | requires_gnutls |
| 3426 | run_test "DER format: with 4 trailing random bytes" \ |
| 3427 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3428 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3429 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3430 | 0 \ |
| 3431 | -c "Handshake was completed" \ |
| 3432 | |
| 3433 | requires_gnutls |
| 3434 | run_test "DER format: with 8 trailing random bytes" \ |
| 3435 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3436 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3437 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3438 | 0 \ |
| 3439 | -c "Handshake was completed" \ |
| 3440 | |
| 3441 | requires_gnutls |
| 3442 | run_test "DER format: with 9 trailing random bytes" \ |
| 3443 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3444 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3445 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3446 | 0 \ |
| 3447 | -c "Handshake was completed" \ |
| 3448 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3449 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3450 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3451 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3452 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3453 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3454 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3455 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3456 | 1 \ |
| 3457 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3458 | -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] | 3459 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3460 | -c "X509 - Certificate verification failed" |
| 3461 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3462 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3463 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3464 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3465 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3466 | 0 \ |
| 3467 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3468 | -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] | 3469 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3470 | -C "X509 - Certificate verification failed" |
| 3471 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3472 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3473 | "$P_SRV" \ |
| 3474 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3475 | 0 \ |
| 3476 | -c "x509_verify_cert() returned" \ |
| 3477 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3478 | -c "! Certificate verification flags"\ |
| 3479 | -C "! mbedtls_ssl_handshake returned" \ |
| 3480 | -C "X509 - Certificate verification failed" \ |
| 3481 | -C "SSL - No CA Chain is set, but required to operate" |
| 3482 | |
| 3483 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3484 | "$P_SRV" \ |
| 3485 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3486 | 1 \ |
| 3487 | -c "x509_verify_cert() returned" \ |
| 3488 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3489 | -c "! Certificate verification flags"\ |
| 3490 | -c "! mbedtls_ssl_handshake returned" \ |
| 3491 | -c "SSL - No CA Chain is set, but required to operate" |
| 3492 | |
| 3493 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3494 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3495 | # the client informs the server about the supported curves - it does, though, in the |
| 3496 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3497 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3498 | # different means to have the server ignoring the client's supported curve list. |
| 3499 | |
| 3500 | requires_config_enabled MBEDTLS_ECP_C |
| 3501 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3502 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3503 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3504 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3505 | 1 \ |
| 3506 | -c "bad certificate (EC key curve)"\ |
| 3507 | -c "! Certificate verification flags"\ |
| 3508 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3509 | |
| 3510 | requires_config_enabled MBEDTLS_ECP_C |
| 3511 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3512 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3513 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3514 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3515 | 1 \ |
| 3516 | -c "bad certificate (EC key curve)"\ |
| 3517 | -c "! Certificate verification flags"\ |
| 3518 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3519 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3520 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3521 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3522 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3523 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3524 | 0 \ |
| 3525 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3526 | -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] | 3527 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3528 | -C "X509 - Certificate verification failed" |
| 3529 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3530 | run_test "Authentication: client SHA256, server required" \ |
| 3531 | "$P_SRV auth_mode=required" \ |
| 3532 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3533 | key_file=data_files/server6.key \ |
| 3534 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3535 | 0 \ |
| 3536 | -c "Supported Signature Algorithm found: 4," \ |
| 3537 | -c "Supported Signature Algorithm found: 5," |
| 3538 | |
| 3539 | run_test "Authentication: client SHA384, server required" \ |
| 3540 | "$P_SRV auth_mode=required" \ |
| 3541 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3542 | key_file=data_files/server6.key \ |
| 3543 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3544 | 0 \ |
| 3545 | -c "Supported Signature Algorithm found: 4," \ |
| 3546 | -c "Supported Signature Algorithm found: 5," |
| 3547 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 3549 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 3550 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 3551 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 3552 | key_file=data_files/server5.key" \ |
| 3553 | 1 \ |
| 3554 | -S "skip write certificate request" \ |
| 3555 | -C "skip parse certificate request" \ |
| 3556 | -c "got a certificate request" \ |
| 3557 | -c "got no certificate to send" \ |
| 3558 | -S "x509_verify_cert() returned" \ |
| 3559 | -s "client has no certificate" \ |
| 3560 | -s "! mbedtls_ssl_handshake returned" \ |
| 3561 | -c "! mbedtls_ssl_handshake returned" \ |
| 3562 | -s "No client certification received from the client, but required by the authentication mode" |
| 3563 | |
| 3564 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3565 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3566 | "$P_CLI debug_level=3 crt_file=none \ |
| 3567 | key_file=data_files/server5.key" \ |
| 3568 | 1 \ |
| 3569 | -S "skip write certificate request" \ |
| 3570 | -C "skip parse certificate request" \ |
| 3571 | -c "got a certificate request" \ |
| 3572 | -c "= write certificate$" \ |
| 3573 | -C "skip write certificate$" \ |
| 3574 | -S "x509_verify_cert() returned" \ |
| 3575 | -s "client has no certificate" \ |
| 3576 | -s "! mbedtls_ssl_handshake returned" \ |
| 3577 | -c "! mbedtls_ssl_handshake returned" \ |
| 3578 | -s "No client certification received from the client, but required by the authentication mode" |
| 3579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3580 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3581 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3582 | "$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] | 3583 | key_file=data_files/server5.key" \ |
| 3584 | 1 \ |
| 3585 | -S "skip write certificate request" \ |
| 3586 | -C "skip parse certificate request" \ |
| 3587 | -c "got a certificate request" \ |
| 3588 | -C "skip write certificate" \ |
| 3589 | -C "skip write certificate verify" \ |
| 3590 | -S "skip parse certificate verify" \ |
| 3591 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3592 | -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] | 3593 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3594 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3595 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3596 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3597 | # We don't check that the client receives the alert because it might |
| 3598 | # detect that its write end of the connection is closed and abort |
| 3599 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3600 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3601 | run_test "Authentication: client cert not trusted, server required" \ |
| 3602 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3603 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3604 | key_file=data_files/server5.key" \ |
| 3605 | 1 \ |
| 3606 | -S "skip write certificate request" \ |
| 3607 | -C "skip parse certificate request" \ |
| 3608 | -c "got a certificate request" \ |
| 3609 | -C "skip write certificate" \ |
| 3610 | -C "skip write certificate verify" \ |
| 3611 | -S "skip parse certificate verify" \ |
| 3612 | -s "x509_verify_cert() returned" \ |
| 3613 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3614 | -s "! mbedtls_ssl_handshake returned" \ |
| 3615 | -c "! mbedtls_ssl_handshake returned" \ |
| 3616 | -s "X509 - Certificate verification failed" |
| 3617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3618 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3619 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3620 | "$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] | 3621 | key_file=data_files/server5.key" \ |
| 3622 | 0 \ |
| 3623 | -S "skip write certificate request" \ |
| 3624 | -C "skip parse certificate request" \ |
| 3625 | -c "got a certificate request" \ |
| 3626 | -C "skip write certificate" \ |
| 3627 | -C "skip write certificate verify" \ |
| 3628 | -S "skip parse certificate verify" \ |
| 3629 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3630 | -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] | 3631 | -S "! mbedtls_ssl_handshake returned" \ |
| 3632 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3633 | -S "X509 - Certificate verification failed" |
| 3634 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3635 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3636 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3637 | "$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] | 3638 | key_file=data_files/server5.key" \ |
| 3639 | 0 \ |
| 3640 | -s "skip write certificate request" \ |
| 3641 | -C "skip parse certificate request" \ |
| 3642 | -c "got no 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" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3647 | -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] | 3648 | -S "! mbedtls_ssl_handshake returned" \ |
| 3649 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3650 | -S "X509 - Certificate verification failed" |
| 3651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3652 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3653 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3654 | "$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] | 3655 | 0 \ |
| 3656 | -S "skip write certificate request" \ |
| 3657 | -C "skip parse certificate request" \ |
| 3658 | -c "got a certificate request" \ |
| 3659 | -C "skip write certificate$" \ |
| 3660 | -C "got no certificate to send" \ |
| 3661 | -S "SSLv3 client has no certificate" \ |
| 3662 | -c "skip write certificate verify" \ |
| 3663 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3664 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3665 | -S "! mbedtls_ssl_handshake returned" \ |
| 3666 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3667 | -S "X509 - Certificate verification failed" |
| 3668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3670 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3671 | "$O_CLI" \ |
| 3672 | 0 \ |
| 3673 | -S "skip write certificate request" \ |
| 3674 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3675 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3676 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3677 | -S "X509 - Certificate verification failed" |
| 3678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3679 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3680 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3681 | "$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] | 3682 | 0 \ |
| 3683 | -C "skip parse certificate request" \ |
| 3684 | -c "got a certificate request" \ |
| 3685 | -C "skip write certificate$" \ |
| 3686 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3687 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3688 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3689 | run_test "Authentication: client no cert, openssl server required" \ |
| 3690 | "$O_SRV -Verify 10" \ |
| 3691 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3692 | 1 \ |
| 3693 | -C "skip parse certificate request" \ |
| 3694 | -c "got a certificate request" \ |
| 3695 | -C "skip write certificate$" \ |
| 3696 | -c "skip write certificate verify" \ |
| 3697 | -c "! mbedtls_ssl_handshake returned" |
| 3698 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3700 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3701 | "$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] | 3702 | "$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] | 3703 | 0 \ |
| 3704 | -S "skip write certificate request" \ |
| 3705 | -C "skip parse certificate request" \ |
| 3706 | -c "got a certificate request" \ |
| 3707 | -C "skip write certificate$" \ |
| 3708 | -c "skip write certificate verify" \ |
| 3709 | -c "got no certificate to send" \ |
| 3710 | -s "SSLv3 client has no certificate" \ |
| 3711 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3712 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3713 | -S "! mbedtls_ssl_handshake returned" \ |
| 3714 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3715 | -S "X509 - Certificate verification failed" |
| 3716 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3717 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3718 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3719 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3720 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 3721 | MAX_IM_CA_CONFIG=$( ../scripts/config.py get MBEDTLS_X509_MAX_INTERMEDIATE_CA) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3722 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3723 | 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] | 3724 | 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] | 3725 | 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] | 3726 | printf "test value of ${MAX_IM_CA}. \n" |
| 3727 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3728 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 3729 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3730 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3731 | |
| 3732 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3733 | fi |
| 3734 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3735 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3736 | run_test "Authentication: server max_int chain, client default" \ |
| 3737 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3738 | key_file=data_files/dir-maxpath/09.key" \ |
| 3739 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3740 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3741 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3742 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3743 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3744 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3745 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3746 | key_file=data_files/dir-maxpath/10.key" \ |
| 3747 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3748 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3749 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3750 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3751 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3752 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3753 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3754 | key_file=data_files/dir-maxpath/10.key" \ |
| 3755 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3756 | auth_mode=optional" \ |
| 3757 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3758 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3759 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3760 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3761 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3762 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3763 | key_file=data_files/dir-maxpath/10.key" \ |
| 3764 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3765 | auth_mode=none" \ |
| 3766 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3767 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3768 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3769 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3770 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3771 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3772 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3773 | key_file=data_files/dir-maxpath/10.key" \ |
| 3774 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3775 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3776 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3777 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3778 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3779 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3780 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3781 | key_file=data_files/dir-maxpath/10.key" \ |
| 3782 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3783 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3784 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3785 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3786 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3787 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3788 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3789 | key_file=data_files/dir-maxpath/10.key" \ |
| 3790 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3791 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3792 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3793 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3794 | run_test "Authentication: client max_int chain, server required" \ |
| 3795 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3796 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3797 | key_file=data_files/dir-maxpath/09.key" \ |
| 3798 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3799 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3800 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3801 | # Tests for CA list in CertificateRequest messages |
| 3802 | |
| 3803 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3804 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3805 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3806 | key_file=data_files/server6.key" \ |
| 3807 | 0 \ |
| 3808 | -s "requested DN" |
| 3809 | |
| 3810 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3811 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3812 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3813 | key_file=data_files/server6.key" \ |
| 3814 | 0 \ |
| 3815 | -S "requested DN" |
| 3816 | |
| 3817 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3818 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3819 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3820 | key_file=data_files/server5.key" \ |
| 3821 | 1 \ |
| 3822 | -S "requested DN" \ |
| 3823 | -s "x509_verify_cert() returned" \ |
| 3824 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3825 | -s "! mbedtls_ssl_handshake returned" \ |
| 3826 | -c "! mbedtls_ssl_handshake returned" \ |
| 3827 | -s "X509 - Certificate verification failed" |
| 3828 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3829 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3830 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3831 | |
| 3832 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3833 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 3834 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3835 | key_file=data_files/server5.key" \ |
| 3836 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3837 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3838 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3839 | -c "x509_verify_cert() returned" \ |
| 3840 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3841 | -c "! mbedtls_ssl_handshake returned" \ |
| 3842 | -c "X509 - Certificate verification failed" |
| 3843 | |
| 3844 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3845 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 3846 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3847 | key_file=data_files/server5.key" \ |
| 3848 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3849 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3850 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3851 | -c "x509_verify_cert() returned" \ |
| 3852 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3853 | -C "! mbedtls_ssl_handshake returned" \ |
| 3854 | -C "X509 - Certificate verification failed" |
| 3855 | |
| 3856 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3857 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3858 | # the client informs the server about the supported curves - it does, though, in the |
| 3859 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3860 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3861 | # different means to have the server ignoring the client's supported curve list. |
| 3862 | |
| 3863 | requires_config_enabled MBEDTLS_ECP_C |
| 3864 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3865 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3866 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3867 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3868 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3869 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3870 | -c "use CA callback for X.509 CRT verification" \ |
| 3871 | -c "bad certificate (EC key curve)" \ |
| 3872 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3873 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3874 | |
| 3875 | requires_config_enabled MBEDTLS_ECP_C |
| 3876 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3877 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3878 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3879 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3880 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3881 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3882 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3883 | -c "bad certificate (EC key curve)"\ |
| 3884 | -c "! Certificate verification flags"\ |
| 3885 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3886 | |
| 3887 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3888 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 3889 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3890 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3891 | key_file=data_files/server6.key \ |
| 3892 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3893 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3894 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3895 | -c "Supported Signature Algorithm found: 4," \ |
| 3896 | -c "Supported Signature Algorithm found: 5," |
| 3897 | |
| 3898 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3899 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 3900 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3901 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3902 | key_file=data_files/server6.key \ |
| 3903 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3904 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3905 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3906 | -c "Supported Signature Algorithm found: 4," \ |
| 3907 | -c "Supported Signature Algorithm found: 5," |
| 3908 | |
| 3909 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3910 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 3911 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3912 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3913 | key_file=data_files/server5.key" \ |
| 3914 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3915 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3916 | -S "skip write certificate request" \ |
| 3917 | -C "skip parse certificate request" \ |
| 3918 | -c "got a certificate request" \ |
| 3919 | -C "skip write certificate" \ |
| 3920 | -C "skip write certificate verify" \ |
| 3921 | -S "skip parse certificate verify" \ |
| 3922 | -s "x509_verify_cert() returned" \ |
| 3923 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3924 | -s "! mbedtls_ssl_handshake returned" \ |
| 3925 | -s "send alert level=2 message=48" \ |
| 3926 | -c "! mbedtls_ssl_handshake returned" \ |
| 3927 | -s "X509 - Certificate verification failed" |
| 3928 | # We don't check that the client receives the alert because it might |
| 3929 | # detect that its write end of the connection is closed and abort |
| 3930 | # before reading the alert message. |
| 3931 | |
| 3932 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3933 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 3934 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 3935 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3936 | key_file=data_files/server5.key" \ |
| 3937 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3938 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3939 | -S "skip write certificate request" \ |
| 3940 | -C "skip parse certificate request" \ |
| 3941 | -c "got a certificate request" \ |
| 3942 | -C "skip write certificate" \ |
| 3943 | -C "skip write certificate verify" \ |
| 3944 | -S "skip parse certificate verify" \ |
| 3945 | -s "x509_verify_cert() returned" \ |
| 3946 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3947 | -s "! mbedtls_ssl_handshake returned" \ |
| 3948 | -c "! mbedtls_ssl_handshake returned" \ |
| 3949 | -s "X509 - Certificate verification failed" |
| 3950 | |
| 3951 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3952 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 3953 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 3954 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 3955 | key_file=data_files/server5.key" \ |
| 3956 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3957 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3958 | -S "skip write certificate request" \ |
| 3959 | -C "skip parse certificate request" \ |
| 3960 | -c "got a certificate request" \ |
| 3961 | -C "skip write certificate" \ |
| 3962 | -C "skip write certificate verify" \ |
| 3963 | -S "skip parse certificate verify" \ |
| 3964 | -s "x509_verify_cert() returned" \ |
| 3965 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3966 | -S "! mbedtls_ssl_handshake returned" \ |
| 3967 | -C "! mbedtls_ssl_handshake returned" \ |
| 3968 | -S "X509 - Certificate verification failed" |
| 3969 | |
| 3970 | requires_full_size_output_buffer |
| 3971 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3972 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 3973 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3974 | key_file=data_files/dir-maxpath/09.key" \ |
| 3975 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3976 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3977 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3978 | -C "X509 - A fatal error occurred" |
| 3979 | |
| 3980 | requires_full_size_output_buffer |
| 3981 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3982 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 3983 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3984 | key_file=data_files/dir-maxpath/10.key" \ |
| 3985 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3986 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3987 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3988 | -c "X509 - A fatal error occurred" |
| 3989 | |
| 3990 | requires_full_size_output_buffer |
| 3991 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3992 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 3993 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3994 | key_file=data_files/dir-maxpath/10.key" \ |
| 3995 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3996 | debug_level=3 auth_mode=optional" \ |
| 3997 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 3998 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3999 | -c "X509 - A fatal error occurred" |
| 4000 | |
| 4001 | requires_full_size_output_buffer |
| 4002 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4003 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4004 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4005 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4006 | key_file=data_files/dir-maxpath/10.key" \ |
| 4007 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4008 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4009 | -s "X509 - A fatal error occurred" |
| 4010 | |
| 4011 | requires_full_size_output_buffer |
| 4012 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4013 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4014 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4015 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4016 | key_file=data_files/dir-maxpath/10.key" \ |
| 4017 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4018 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4019 | -s "X509 - A fatal error occurred" |
| 4020 | |
| 4021 | requires_full_size_output_buffer |
| 4022 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4023 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4024 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4025 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4026 | key_file=data_files/dir-maxpath/09.key" \ |
| 4027 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4028 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4029 | -S "X509 - A fatal error occurred" |
| 4030 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4031 | # Tests for certificate selection based on SHA verson |
| 4032 | |
| 4033 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4034 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4035 | key_file=data_files/server5.key \ |
| 4036 | crt_file2=data_files/server5-sha1.crt \ |
| 4037 | key_file2=data_files/server5.key" \ |
| 4038 | "$P_CLI force_version=tls1_2" \ |
| 4039 | 0 \ |
| 4040 | -c "signed using.*ECDSA with SHA256" \ |
| 4041 | -C "signed using.*ECDSA with SHA1" |
| 4042 | |
| 4043 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4044 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4045 | key_file=data_files/server5.key \ |
| 4046 | crt_file2=data_files/server5-sha1.crt \ |
| 4047 | key_file2=data_files/server5.key" \ |
| 4048 | "$P_CLI force_version=tls1_1" \ |
| 4049 | 0 \ |
| 4050 | -C "signed using.*ECDSA with SHA256" \ |
| 4051 | -c "signed using.*ECDSA with SHA1" |
| 4052 | |
| 4053 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4054 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4055 | key_file=data_files/server5.key \ |
| 4056 | crt_file2=data_files/server5-sha1.crt \ |
| 4057 | key_file2=data_files/server5.key" \ |
| 4058 | "$P_CLI force_version=tls1" \ |
| 4059 | 0 \ |
| 4060 | -C "signed using.*ECDSA with SHA256" \ |
| 4061 | -c "signed using.*ECDSA with SHA1" |
| 4062 | |
| 4063 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4064 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4065 | key_file=data_files/server5.key \ |
| 4066 | crt_file2=data_files/server6.crt \ |
| 4067 | key_file2=data_files/server6.key" \ |
| 4068 | "$P_CLI force_version=tls1_1" \ |
| 4069 | 0 \ |
| 4070 | -c "serial number.*09" \ |
| 4071 | -c "signed using.*ECDSA with SHA256" \ |
| 4072 | -C "signed using.*ECDSA with SHA1" |
| 4073 | |
| 4074 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4075 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4076 | key_file=data_files/server6.key \ |
| 4077 | crt_file2=data_files/server5.crt \ |
| 4078 | key_file2=data_files/server5.key" \ |
| 4079 | "$P_CLI force_version=tls1_1" \ |
| 4080 | 0 \ |
| 4081 | -c "serial number.*0A" \ |
| 4082 | -c "signed using.*ECDSA with SHA256" \ |
| 4083 | -C "signed using.*ECDSA with SHA1" |
| 4084 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4085 | # tests for SNI |
| 4086 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4087 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4088 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4089 | 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] | 4090 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4091 | 0 \ |
| 4092 | -S "parse ServerName extension" \ |
| 4093 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4094 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4095 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4096 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4097 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4098 | 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] | 4099 | 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] | 4100 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4101 | 0 \ |
| 4102 | -s "parse ServerName extension" \ |
| 4103 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4104 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4106 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4107 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4108 | 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] | 4109 | 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] | 4110 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4111 | 0 \ |
| 4112 | -s "parse ServerName extension" \ |
| 4113 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4114 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4115 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4116 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4117 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4118 | 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] | 4119 | 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] | 4120 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4121 | 1 \ |
| 4122 | -s "parse ServerName extension" \ |
| 4123 | -s "ssl_sni_wrapper() returned" \ |
| 4124 | -s "mbedtls_ssl_handshake returned" \ |
| 4125 | -c "mbedtls_ssl_handshake returned" \ |
| 4126 | -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] | 4127 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4128 | run_test "SNI: client auth no override: optional" \ |
| 4129 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4130 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4131 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4132 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4133 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4134 | -S "skip write certificate request" \ |
| 4135 | -C "skip parse certificate request" \ |
| 4136 | -c "got a certificate request" \ |
| 4137 | -C "skip write certificate" \ |
| 4138 | -C "skip write certificate verify" \ |
| 4139 | -S "skip parse certificate verify" |
| 4140 | |
| 4141 | run_test "SNI: client auth override: none -> optional" \ |
| 4142 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4143 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4144 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4145 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4146 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4147 | -S "skip write certificate request" \ |
| 4148 | -C "skip parse certificate request" \ |
| 4149 | -c "got a certificate request" \ |
| 4150 | -C "skip write certificate" \ |
| 4151 | -C "skip write certificate verify" \ |
| 4152 | -S "skip parse certificate verify" |
| 4153 | |
| 4154 | run_test "SNI: client auth override: optional -> none" \ |
| 4155 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4156 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4157 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4158 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4159 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4160 | -s "skip write certificate request" \ |
| 4161 | -C "skip parse certificate request" \ |
| 4162 | -c "got no certificate request" \ |
| 4163 | -c "skip write certificate" \ |
| 4164 | -c "skip write certificate verify" \ |
| 4165 | -s "skip parse certificate verify" |
| 4166 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4167 | run_test "SNI: CA no override" \ |
| 4168 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4169 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4170 | ca_file=data_files/test-ca.crt \ |
| 4171 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4172 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4173 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4174 | 1 \ |
| 4175 | -S "skip write certificate request" \ |
| 4176 | -C "skip parse certificate request" \ |
| 4177 | -c "got a certificate request" \ |
| 4178 | -C "skip write certificate" \ |
| 4179 | -C "skip write certificate verify" \ |
| 4180 | -S "skip parse certificate verify" \ |
| 4181 | -s "x509_verify_cert() returned" \ |
| 4182 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4183 | -S "The certificate has been revoked (is on a CRL)" |
| 4184 | |
| 4185 | run_test "SNI: CA override" \ |
| 4186 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4187 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4188 | ca_file=data_files/test-ca.crt \ |
| 4189 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4190 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4191 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4192 | 0 \ |
| 4193 | -S "skip write certificate request" \ |
| 4194 | -C "skip parse certificate request" \ |
| 4195 | -c "got a certificate request" \ |
| 4196 | -C "skip write certificate" \ |
| 4197 | -C "skip write certificate verify" \ |
| 4198 | -S "skip parse certificate verify" \ |
| 4199 | -S "x509_verify_cert() returned" \ |
| 4200 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4201 | -S "The certificate has been revoked (is on a CRL)" |
| 4202 | |
| 4203 | run_test "SNI: CA override with CRL" \ |
| 4204 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4205 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4206 | ca_file=data_files/test-ca.crt \ |
| 4207 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4208 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4209 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4210 | 1 \ |
| 4211 | -S "skip write certificate request" \ |
| 4212 | -C "skip parse certificate request" \ |
| 4213 | -c "got a certificate request" \ |
| 4214 | -C "skip write certificate" \ |
| 4215 | -C "skip write certificate verify" \ |
| 4216 | -S "skip parse certificate verify" \ |
| 4217 | -s "x509_verify_cert() returned" \ |
| 4218 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4219 | -s "The certificate has been revoked (is on a CRL)" |
| 4220 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4221 | # Tests for SNI and DTLS |
| 4222 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4223 | run_test "SNI: DTLS, no SNI callback" \ |
| 4224 | "$P_SRV debug_level=3 dtls=1 \ |
| 4225 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4226 | "$P_CLI server_name=localhost dtls=1" \ |
| 4227 | 0 \ |
| 4228 | -S "parse ServerName extension" \ |
| 4229 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4230 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4231 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4232 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4233 | "$P_SRV debug_level=3 dtls=1 \ |
| 4234 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4235 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4236 | "$P_CLI server_name=localhost dtls=1" \ |
| 4237 | 0 \ |
| 4238 | -s "parse ServerName extension" \ |
| 4239 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4240 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4241 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4242 | run_test "SNI: DTLS, matching cert 2" \ |
| 4243 | "$P_SRV debug_level=3 dtls=1 \ |
| 4244 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4245 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4246 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4247 | 0 \ |
| 4248 | -s "parse ServerName extension" \ |
| 4249 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4250 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4251 | |
| 4252 | run_test "SNI: DTLS, no matching cert" \ |
| 4253 | "$P_SRV debug_level=3 dtls=1 \ |
| 4254 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4255 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4256 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4257 | 1 \ |
| 4258 | -s "parse ServerName extension" \ |
| 4259 | -s "ssl_sni_wrapper() returned" \ |
| 4260 | -s "mbedtls_ssl_handshake returned" \ |
| 4261 | -c "mbedtls_ssl_handshake returned" \ |
| 4262 | -c "SSL - A fatal alert message was received from our peer" |
| 4263 | |
| 4264 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4265 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4266 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4267 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4268 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4269 | 0 \ |
| 4270 | -S "skip write certificate request" \ |
| 4271 | -C "skip parse certificate request" \ |
| 4272 | -c "got a certificate request" \ |
| 4273 | -C "skip write certificate" \ |
| 4274 | -C "skip write certificate verify" \ |
| 4275 | -S "skip parse certificate verify" |
| 4276 | |
| 4277 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4278 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4279 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4280 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4281 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4282 | 0 \ |
| 4283 | -S "skip write certificate request" \ |
| 4284 | -C "skip parse certificate request" \ |
| 4285 | -c "got a certificate request" \ |
| 4286 | -C "skip write certificate" \ |
| 4287 | -C "skip write certificate verify" \ |
| 4288 | -S "skip parse certificate verify" |
| 4289 | |
| 4290 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4291 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4292 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4293 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4294 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4295 | 0 \ |
| 4296 | -s "skip write certificate request" \ |
| 4297 | -C "skip parse certificate request" \ |
| 4298 | -c "got no certificate request" \ |
| 4299 | -c "skip write certificate" \ |
| 4300 | -c "skip write certificate verify" \ |
| 4301 | -s "skip parse certificate verify" |
| 4302 | |
| 4303 | run_test "SNI: DTLS, CA no override" \ |
| 4304 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4305 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4306 | ca_file=data_files/test-ca.crt \ |
| 4307 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4308 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4309 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4310 | 1 \ |
| 4311 | -S "skip write certificate request" \ |
| 4312 | -C "skip parse certificate request" \ |
| 4313 | -c "got a certificate request" \ |
| 4314 | -C "skip write certificate" \ |
| 4315 | -C "skip write certificate verify" \ |
| 4316 | -S "skip parse certificate verify" \ |
| 4317 | -s "x509_verify_cert() returned" \ |
| 4318 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4319 | -S "The certificate has been revoked (is on a CRL)" |
| 4320 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4321 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4322 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4323 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4324 | ca_file=data_files/test-ca.crt \ |
| 4325 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4326 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4327 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4328 | 0 \ |
| 4329 | -S "skip write certificate request" \ |
| 4330 | -C "skip parse certificate request" \ |
| 4331 | -c "got a certificate request" \ |
| 4332 | -C "skip write certificate" \ |
| 4333 | -C "skip write certificate verify" \ |
| 4334 | -S "skip parse certificate verify" \ |
| 4335 | -S "x509_verify_cert() returned" \ |
| 4336 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4337 | -S "The certificate has been revoked (is on a CRL)" |
| 4338 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4339 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4340 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4341 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4342 | ca_file=data_files/test-ca.crt \ |
| 4343 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4344 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4345 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4346 | 1 \ |
| 4347 | -S "skip write certificate request" \ |
| 4348 | -C "skip parse certificate request" \ |
| 4349 | -c "got a certificate request" \ |
| 4350 | -C "skip write certificate" \ |
| 4351 | -C "skip write certificate verify" \ |
| 4352 | -S "skip parse certificate verify" \ |
| 4353 | -s "x509_verify_cert() returned" \ |
| 4354 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4355 | -s "The certificate has been revoked (is on a CRL)" |
| 4356 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4357 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4358 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4359 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4360 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4361 | "$P_CLI nbio=2 tickets=0" \ |
| 4362 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4363 | -S "mbedtls_ssl_handshake returned" \ |
| 4364 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4365 | -c "Read from server: .* bytes read" |
| 4366 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4367 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4368 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4369 | "$P_CLI nbio=2 tickets=0" \ |
| 4370 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4371 | -S "mbedtls_ssl_handshake returned" \ |
| 4372 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4373 | -c "Read from server: .* bytes read" |
| 4374 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4375 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4376 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4377 | "$P_CLI nbio=2 tickets=1" \ |
| 4378 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4379 | -S "mbedtls_ssl_handshake returned" \ |
| 4380 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4381 | -c "Read from server: .* bytes read" |
| 4382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4384 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4385 | "$P_CLI nbio=2 tickets=1" \ |
| 4386 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4387 | -S "mbedtls_ssl_handshake returned" \ |
| 4388 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4389 | -c "Read from server: .* bytes read" |
| 4390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4391 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4392 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4393 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4394 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4395 | -S "mbedtls_ssl_handshake returned" \ |
| 4396 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4397 | -c "Read from server: .* bytes read" |
| 4398 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4399 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4400 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4401 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4402 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4403 | -S "mbedtls_ssl_handshake returned" \ |
| 4404 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4405 | -c "Read from server: .* bytes read" |
| 4406 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4407 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4408 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4409 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4410 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4411 | -S "mbedtls_ssl_handshake returned" \ |
| 4412 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4413 | -c "Read from server: .* bytes read" |
| 4414 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4415 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4416 | |
| 4417 | run_test "Event-driven I/O: basic handshake" \ |
| 4418 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4419 | "$P_CLI event=1 tickets=0" \ |
| 4420 | 0 \ |
| 4421 | -S "mbedtls_ssl_handshake returned" \ |
| 4422 | -C "mbedtls_ssl_handshake returned" \ |
| 4423 | -c "Read from server: .* bytes read" |
| 4424 | |
| 4425 | run_test "Event-driven I/O: client auth" \ |
| 4426 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4427 | "$P_CLI event=1 tickets=0" \ |
| 4428 | 0 \ |
| 4429 | -S "mbedtls_ssl_handshake returned" \ |
| 4430 | -C "mbedtls_ssl_handshake returned" \ |
| 4431 | -c "Read from server: .* bytes read" |
| 4432 | |
| 4433 | run_test "Event-driven I/O: ticket" \ |
| 4434 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4435 | "$P_CLI event=1 tickets=1" \ |
| 4436 | 0 \ |
| 4437 | -S "mbedtls_ssl_handshake returned" \ |
| 4438 | -C "mbedtls_ssl_handshake returned" \ |
| 4439 | -c "Read from server: .* bytes read" |
| 4440 | |
| 4441 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4442 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4443 | "$P_CLI event=1 tickets=1" \ |
| 4444 | 0 \ |
| 4445 | -S "mbedtls_ssl_handshake returned" \ |
| 4446 | -C "mbedtls_ssl_handshake returned" \ |
| 4447 | -c "Read from server: .* bytes read" |
| 4448 | |
| 4449 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4450 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4451 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4452 | 0 \ |
| 4453 | -S "mbedtls_ssl_handshake returned" \ |
| 4454 | -C "mbedtls_ssl_handshake returned" \ |
| 4455 | -c "Read from server: .* bytes read" |
| 4456 | |
| 4457 | run_test "Event-driven I/O: ticket + resume" \ |
| 4458 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4459 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4460 | 0 \ |
| 4461 | -S "mbedtls_ssl_handshake returned" \ |
| 4462 | -C "mbedtls_ssl_handshake returned" \ |
| 4463 | -c "Read from server: .* bytes read" |
| 4464 | |
| 4465 | run_test "Event-driven I/O: session-id resume" \ |
| 4466 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4467 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4468 | 0 \ |
| 4469 | -S "mbedtls_ssl_handshake returned" \ |
| 4470 | -C "mbedtls_ssl_handshake returned" \ |
| 4471 | -c "Read from server: .* bytes read" |
| 4472 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4473 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4474 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4475 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4476 | 0 \ |
| 4477 | -c "Read from server: .* bytes read" |
| 4478 | |
| 4479 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4480 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4481 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4482 | 0 \ |
| 4483 | -c "Read from server: .* bytes read" |
| 4484 | |
| 4485 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4486 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4487 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4488 | 0 \ |
| 4489 | -c "Read from server: .* bytes read" |
| 4490 | |
| 4491 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4492 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4493 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4494 | 0 \ |
| 4495 | -c "Read from server: .* bytes read" |
| 4496 | |
| 4497 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4498 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4499 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4500 | 0 \ |
| 4501 | -c "Read from server: .* bytes read" |
| 4502 | |
| 4503 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4504 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4505 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1" \ |
| 4506 | 0 \ |
| 4507 | -c "Read from server: .* bytes read" |
| 4508 | |
| 4509 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4510 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4511 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4512 | 0 \ |
| 4513 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4514 | |
| 4515 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4516 | # During session resumption, the client will send its ApplicationData record |
| 4517 | # within the same datagram as the Finished messages. In this situation, the |
| 4518 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4519 | # because the ApplicationData request has already been queued internally. |
| 4520 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4521 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4522 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4523 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1" \ |
| 4524 | 0 \ |
| 4525 | -c "Read from server: .* bytes read" |
| 4526 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4527 | # Tests for version negotiation |
| 4528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4529 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4530 | "$P_SRV" \ |
| 4531 | "$P_CLI" \ |
| 4532 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4533 | -S "mbedtls_ssl_handshake returned" \ |
| 4534 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4535 | -s "Protocol is TLSv1.2" \ |
| 4536 | -c "Protocol is TLSv1.2" |
| 4537 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4538 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4539 | "$P_SRV" \ |
| 4540 | "$P_CLI max_version=tls1_1" \ |
| 4541 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4542 | -S "mbedtls_ssl_handshake returned" \ |
| 4543 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4544 | -s "Protocol is TLSv1.1" \ |
| 4545 | -c "Protocol is TLSv1.1" |
| 4546 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4547 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4548 | "$P_SRV max_version=tls1_1" \ |
| 4549 | "$P_CLI" \ |
| 4550 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4551 | -S "mbedtls_ssl_handshake returned" \ |
| 4552 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4553 | -s "Protocol is TLSv1.1" \ |
| 4554 | -c "Protocol is TLSv1.1" |
| 4555 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4556 | 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] | 4557 | "$P_SRV max_version=tls1_1" \ |
| 4558 | "$P_CLI max_version=tls1_1" \ |
| 4559 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4560 | -S "mbedtls_ssl_handshake returned" \ |
| 4561 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4562 | -s "Protocol is TLSv1.1" \ |
| 4563 | -c "Protocol is TLSv1.1" |
| 4564 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4565 | 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] | 4566 | "$P_SRV min_version=tls1_1" \ |
| 4567 | "$P_CLI max_version=tls1_1" \ |
| 4568 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4569 | -S "mbedtls_ssl_handshake returned" \ |
| 4570 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4571 | -s "Protocol is TLSv1.1" \ |
| 4572 | -c "Protocol is TLSv1.1" |
| 4573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4574 | 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] | 4575 | "$P_SRV max_version=tls1_1" \ |
| 4576 | "$P_CLI min_version=tls1_1" \ |
| 4577 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4578 | -S "mbedtls_ssl_handshake returned" \ |
| 4579 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4580 | -s "Protocol is TLSv1.1" \ |
| 4581 | -c "Protocol is TLSv1.1" |
| 4582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4583 | 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] | 4584 | "$P_SRV max_version=tls1_1" \ |
| 4585 | "$P_CLI min_version=tls1_2" \ |
| 4586 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4587 | -s "mbedtls_ssl_handshake returned" \ |
| 4588 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4589 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 4590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | 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] | 4592 | "$P_SRV min_version=tls1_2" \ |
| 4593 | "$P_CLI max_version=tls1_1" \ |
| 4594 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4595 | -s "mbedtls_ssl_handshake returned" \ |
| 4596 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4597 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 4598 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4599 | # Tests for ALPN extension |
| 4600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4601 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4602 | "$P_SRV debug_level=3" \ |
| 4603 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4604 | 0 \ |
| 4605 | -C "client hello, adding alpn extension" \ |
| 4606 | -S "found alpn extension" \ |
| 4607 | -C "got an alert message, type: \\[2:120]" \ |
| 4608 | -S "server hello, adding alpn extension" \ |
| 4609 | -C "found alpn extension " \ |
| 4610 | -C "Application Layer Protocol is" \ |
| 4611 | -S "Application Layer Protocol is" |
| 4612 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4613 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4614 | "$P_SRV debug_level=3" \ |
| 4615 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4616 | 0 \ |
| 4617 | -c "client hello, adding alpn extension" \ |
| 4618 | -s "found alpn extension" \ |
| 4619 | -C "got an alert message, type: \\[2:120]" \ |
| 4620 | -S "server hello, adding alpn extension" \ |
| 4621 | -C "found alpn extension " \ |
| 4622 | -c "Application Layer Protocol is (none)" \ |
| 4623 | -S "Application Layer Protocol is" |
| 4624 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4625 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4626 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4627 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4628 | 0 \ |
| 4629 | -C "client hello, adding alpn extension" \ |
| 4630 | -S "found alpn extension" \ |
| 4631 | -C "got an alert message, type: \\[2:120]" \ |
| 4632 | -S "server hello, adding alpn extension" \ |
| 4633 | -C "found alpn extension " \ |
| 4634 | -C "Application Layer Protocol is" \ |
| 4635 | -s "Application Layer Protocol is (none)" |
| 4636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4637 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4638 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4639 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4640 | 0 \ |
| 4641 | -c "client hello, adding alpn extension" \ |
| 4642 | -s "found alpn extension" \ |
| 4643 | -C "got an alert message, type: \\[2:120]" \ |
| 4644 | -s "server hello, adding alpn extension" \ |
| 4645 | -c "found alpn extension" \ |
| 4646 | -c "Application Layer Protocol is abc" \ |
| 4647 | -s "Application Layer Protocol is abc" |
| 4648 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4649 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4650 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4651 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4652 | 0 \ |
| 4653 | -c "client hello, adding alpn extension" \ |
| 4654 | -s "found alpn extension" \ |
| 4655 | -C "got an alert message, type: \\[2:120]" \ |
| 4656 | -s "server hello, adding alpn extension" \ |
| 4657 | -c "found alpn extension" \ |
| 4658 | -c "Application Layer Protocol is abc" \ |
| 4659 | -s "Application Layer Protocol is abc" |
| 4660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4662 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4663 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4664 | 0 \ |
| 4665 | -c "client hello, adding alpn extension" \ |
| 4666 | -s "found alpn extension" \ |
| 4667 | -C "got an alert message, type: \\[2:120]" \ |
| 4668 | -s "server hello, adding alpn extension" \ |
| 4669 | -c "found alpn extension" \ |
| 4670 | -c "Application Layer Protocol is 1234" \ |
| 4671 | -s "Application Layer Protocol is 1234" |
| 4672 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4673 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4674 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4675 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4676 | 1 \ |
| 4677 | -c "client hello, adding alpn extension" \ |
| 4678 | -s "found alpn extension" \ |
| 4679 | -c "got an alert message, type: \\[2:120]" \ |
| 4680 | -S "server hello, adding alpn extension" \ |
| 4681 | -C "found alpn extension" \ |
| 4682 | -C "Application Layer Protocol is 1234" \ |
| 4683 | -S "Application Layer Protocol is 1234" |
| 4684 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4685 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4686 | # Tests for keyUsage in leaf certificates, part 1: |
| 4687 | # server-side certificate/suite selection |
| 4688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4689 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4690 | "$P_SRV key_file=data_files/server2.key \ |
| 4691 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4692 | "$P_CLI" \ |
| 4693 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4694 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4695 | |
| 4696 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4697 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4698 | "$P_SRV key_file=data_files/server2.key \ |
| 4699 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4700 | "$P_CLI" \ |
| 4701 | 0 \ |
| 4702 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4704 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4705 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4706 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4707 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4708 | 1 \ |
| 4709 | -C "Ciphersuite is " |
| 4710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4711 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4712 | "$P_SRV key_file=data_files/server5.key \ |
| 4713 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4714 | "$P_CLI" \ |
| 4715 | 0 \ |
| 4716 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4717 | |
| 4718 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4719 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4720 | "$P_SRV key_file=data_files/server5.key \ |
| 4721 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4722 | "$P_CLI" \ |
| 4723 | 0 \ |
| 4724 | -c "Ciphersuite is TLS-ECDH-" |
| 4725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4726 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4727 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4728 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4729 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4730 | 1 \ |
| 4731 | -C "Ciphersuite is " |
| 4732 | |
| 4733 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4734 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4736 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4737 | "$O_SRV -key data_files/server2.key \ |
| 4738 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4739 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4740 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4741 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4742 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4743 | -C "Processing of the Certificate handshake message failed" \ |
| 4744 | -c "Ciphersuite is TLS-" |
| 4745 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4746 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4747 | "$O_SRV -key data_files/server2.key \ |
| 4748 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4749 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4750 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4751 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4752 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4753 | -C "Processing of the Certificate handshake message failed" \ |
| 4754 | -c "Ciphersuite is TLS-" |
| 4755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4756 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4757 | "$O_SRV -key data_files/server2.key \ |
| 4758 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4759 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4760 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4761 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4762 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4763 | -C "Processing of the Certificate handshake message failed" \ |
| 4764 | -c "Ciphersuite is TLS-" |
| 4765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4766 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4767 | "$O_SRV -key data_files/server2.key \ |
| 4768 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4769 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4770 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4771 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4772 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4773 | -c "Processing of the Certificate handshake message failed" \ |
| 4774 | -C "Ciphersuite is TLS-" |
| 4775 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4776 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4777 | "$O_SRV -key data_files/server2.key \ |
| 4778 | -cert data_files/server2.ku-ke.crt" \ |
| 4779 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4780 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4781 | 0 \ |
| 4782 | -c "bad certificate (usage extensions)" \ |
| 4783 | -C "Processing of the Certificate handshake message failed" \ |
| 4784 | -c "Ciphersuite is TLS-" \ |
| 4785 | -c "! Usage does not match the keyUsage extension" |
| 4786 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4787 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4788 | "$O_SRV -key data_files/server2.key \ |
| 4789 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4790 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4791 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4792 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4793 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4794 | -C "Processing of the Certificate handshake message failed" \ |
| 4795 | -c "Ciphersuite is TLS-" |
| 4796 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4797 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4798 | "$O_SRV -key data_files/server2.key \ |
| 4799 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4800 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4801 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4802 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4803 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4804 | -c "Processing of the Certificate handshake message failed" \ |
| 4805 | -C "Ciphersuite is TLS-" |
| 4806 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4807 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4808 | "$O_SRV -key data_files/server2.key \ |
| 4809 | -cert data_files/server2.ku-ds.crt" \ |
| 4810 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4811 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4812 | 0 \ |
| 4813 | -c "bad certificate (usage extensions)" \ |
| 4814 | -C "Processing of the Certificate handshake message failed" \ |
| 4815 | -c "Ciphersuite is TLS-" \ |
| 4816 | -c "! Usage does not match the keyUsage extension" |
| 4817 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4818 | # Tests for keyUsage in leaf certificates, part 3: |
| 4819 | # server-side checking of client cert |
| 4820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4821 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4822 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4823 | "$O_CLI -key data_files/server2.key \ |
| 4824 | -cert data_files/server2.ku-ds.crt" \ |
| 4825 | 0 \ |
| 4826 | -S "bad certificate (usage extensions)" \ |
| 4827 | -S "Processing of the Certificate handshake message failed" |
| 4828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4829 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4830 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4831 | "$O_CLI -key data_files/server2.key \ |
| 4832 | -cert data_files/server2.ku-ke.crt" \ |
| 4833 | 0 \ |
| 4834 | -s "bad certificate (usage extensions)" \ |
| 4835 | -S "Processing of the Certificate handshake message failed" |
| 4836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4837 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4838 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4839 | "$O_CLI -key data_files/server2.key \ |
| 4840 | -cert data_files/server2.ku-ke.crt" \ |
| 4841 | 1 \ |
| 4842 | -s "bad certificate (usage extensions)" \ |
| 4843 | -s "Processing of the Certificate handshake message failed" |
| 4844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4845 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4846 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4847 | "$O_CLI -key data_files/server5.key \ |
| 4848 | -cert data_files/server5.ku-ds.crt" \ |
| 4849 | 0 \ |
| 4850 | -S "bad certificate (usage extensions)" \ |
| 4851 | -S "Processing of the Certificate handshake message failed" |
| 4852 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4853 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4854 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4855 | "$O_CLI -key data_files/server5.key \ |
| 4856 | -cert data_files/server5.ku-ka.crt" \ |
| 4857 | 0 \ |
| 4858 | -s "bad certificate (usage extensions)" \ |
| 4859 | -S "Processing of the Certificate handshake message failed" |
| 4860 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4861 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4863 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4864 | "$P_SRV key_file=data_files/server5.key \ |
| 4865 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4866 | "$P_CLI" \ |
| 4867 | 0 |
| 4868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4869 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4870 | "$P_SRV key_file=data_files/server5.key \ |
| 4871 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4872 | "$P_CLI" \ |
| 4873 | 0 |
| 4874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4875 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4876 | "$P_SRV key_file=data_files/server5.key \ |
| 4877 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4878 | "$P_CLI" \ |
| 4879 | 0 |
| 4880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4881 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4882 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4883 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4884 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4885 | 1 |
| 4886 | |
| 4887 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4888 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4889 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4890 | "$O_SRV -key data_files/server5.key \ |
| 4891 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4892 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4893 | 0 \ |
| 4894 | -C "bad certificate (usage extensions)" \ |
| 4895 | -C "Processing of the Certificate handshake message failed" \ |
| 4896 | -c "Ciphersuite is TLS-" |
| 4897 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4898 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4899 | "$O_SRV -key data_files/server5.key \ |
| 4900 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4901 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4902 | 0 \ |
| 4903 | -C "bad certificate (usage extensions)" \ |
| 4904 | -C "Processing of the Certificate handshake message failed" \ |
| 4905 | -c "Ciphersuite is TLS-" |
| 4906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4907 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4908 | "$O_SRV -key data_files/server5.key \ |
| 4909 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4910 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4911 | 0 \ |
| 4912 | -C "bad certificate (usage extensions)" \ |
| 4913 | -C "Processing of the Certificate handshake message failed" \ |
| 4914 | -c "Ciphersuite is TLS-" |
| 4915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4916 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4917 | "$O_SRV -key data_files/server5.key \ |
| 4918 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4919 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4920 | 1 \ |
| 4921 | -c "bad certificate (usage extensions)" \ |
| 4922 | -c "Processing of the Certificate handshake message failed" \ |
| 4923 | -C "Ciphersuite is TLS-" |
| 4924 | |
| 4925 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4926 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4927 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4928 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4929 | "$O_CLI -key data_files/server5.key \ |
| 4930 | -cert data_files/server5.eku-cli.crt" \ |
| 4931 | 0 \ |
| 4932 | -S "bad certificate (usage extensions)" \ |
| 4933 | -S "Processing of the Certificate handshake message failed" |
| 4934 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4935 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4936 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4937 | "$O_CLI -key data_files/server5.key \ |
| 4938 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 4939 | 0 \ |
| 4940 | -S "bad certificate (usage extensions)" \ |
| 4941 | -S "Processing of the Certificate handshake message failed" |
| 4942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4943 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4944 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4945 | "$O_CLI -key data_files/server5.key \ |
| 4946 | -cert data_files/server5.eku-cs_any.crt" \ |
| 4947 | 0 \ |
| 4948 | -S "bad certificate (usage extensions)" \ |
| 4949 | -S "Processing of the Certificate handshake message failed" |
| 4950 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4951 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4952 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4953 | "$O_CLI -key data_files/server5.key \ |
| 4954 | -cert data_files/server5.eku-cs.crt" \ |
| 4955 | 0 \ |
| 4956 | -s "bad certificate (usage extensions)" \ |
| 4957 | -S "Processing of the Certificate handshake message failed" |
| 4958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4959 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4960 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4961 | "$O_CLI -key data_files/server5.key \ |
| 4962 | -cert data_files/server5.eku-cs.crt" \ |
| 4963 | 1 \ |
| 4964 | -s "bad certificate (usage extensions)" \ |
| 4965 | -s "Processing of the Certificate handshake message failed" |
| 4966 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4967 | # Tests for DHM parameters loading |
| 4968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4969 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4970 | "$P_SRV" \ |
| 4971 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4972 | debug_level=3" \ |
| 4973 | 0 \ |
| 4974 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 4975 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4977 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4978 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4979 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4980 | debug_level=3" \ |
| 4981 | 0 \ |
| 4982 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4983 | -c "value of 'DHM: G ' (2 bits)" |
| 4984 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4985 | # Tests for DHM client-side size checking |
| 4986 | |
| 4987 | run_test "DHM size: server default, client default, OK" \ |
| 4988 | "$P_SRV" \ |
| 4989 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4990 | debug_level=1" \ |
| 4991 | 0 \ |
| 4992 | -C "DHM prime too short:" |
| 4993 | |
| 4994 | run_test "DHM size: server default, client 2048, OK" \ |
| 4995 | "$P_SRV" \ |
| 4996 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4997 | debug_level=1 dhmlen=2048" \ |
| 4998 | 0 \ |
| 4999 | -C "DHM prime too short:" |
| 5000 | |
| 5001 | run_test "DHM size: server 1024, client default, OK" \ |
| 5002 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5003 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5004 | debug_level=1" \ |
| 5005 | 0 \ |
| 5006 | -C "DHM prime too short:" |
| 5007 | |
| 5008 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5009 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5010 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5011 | debug_level=1" \ |
| 5012 | 1 \ |
| 5013 | -c "DHM prime too short:" |
| 5014 | |
| 5015 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5016 | "$P_SRV" \ |
| 5017 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5018 | debug_level=1 dhmlen=2049" \ |
| 5019 | 1 \ |
| 5020 | -c "DHM prime too short:" |
| 5021 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5022 | # Tests for PSK callback |
| 5023 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5024 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5025 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5026 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5027 | psk_identity=foo psk=abc123" \ |
| 5028 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5029 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5030 | -S "SSL - Unknown identity received" \ |
| 5031 | -S "SSL - Verification of the message MAC failed" |
| 5032 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5033 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5034 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5035 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5036 | "$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] | 5037 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5038 | 0 \ |
| 5039 | -c "skip PMS generation for opaque PSK"\ |
| 5040 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5041 | -C "session hash for extended master secret"\ |
| 5042 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5043 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5044 | -S "SSL - Unknown identity received" \ |
| 5045 | -S "SSL - Verification of the message MAC failed" |
| 5046 | |
| 5047 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5048 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5049 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5050 | "$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] | 5051 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5052 | 0 \ |
| 5053 | -c "skip PMS generation for opaque PSK"\ |
| 5054 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5055 | -C "session hash for extended master secret"\ |
| 5056 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5057 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5058 | -S "SSL - Unknown identity received" \ |
| 5059 | -S "SSL - Verification of the message MAC failed" |
| 5060 | |
| 5061 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5062 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5063 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5064 | "$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] | 5065 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5066 | 0 \ |
| 5067 | -c "skip PMS generation for opaque PSK"\ |
| 5068 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5069 | -c "session hash for extended master secret"\ |
| 5070 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5071 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5072 | -S "SSL - Unknown identity received" \ |
| 5073 | -S "SSL - Verification of the message MAC failed" |
| 5074 | |
| 5075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5076 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5077 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5078 | "$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] | 5079 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5080 | 0 \ |
| 5081 | -c "skip PMS generation for opaque PSK"\ |
| 5082 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5083 | -c "session hash for extended master secret"\ |
| 5084 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5085 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5086 | -S "SSL - Unknown identity received" \ |
| 5087 | -S "SSL - Verification of the message MAC failed" |
| 5088 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5089 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5090 | 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] | 5091 | "$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] | 5092 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5093 | psk_identity=foo psk=abc123" \ |
| 5094 | 0 \ |
| 5095 | -C "skip PMS generation for opaque PSK"\ |
| 5096 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5097 | -C "session hash for extended master secret"\ |
| 5098 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5099 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5100 | -S "SSL - Unknown identity received" \ |
| 5101 | -S "SSL - Verification of the message MAC failed" |
| 5102 | |
| 5103 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5104 | 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] | 5105 | "$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] | 5106 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5107 | psk_identity=foo psk=abc123" \ |
| 5108 | 0 \ |
| 5109 | -C "skip PMS generation for opaque PSK"\ |
| 5110 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5111 | -C "session hash for extended master secret"\ |
| 5112 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5113 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5114 | -S "SSL - Unknown identity received" \ |
| 5115 | -S "SSL - Verification of the message MAC failed" |
| 5116 | |
| 5117 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5118 | 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] | 5119 | "$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] | 5120 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5121 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5122 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5123 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5124 | -c "session hash for extended master secret"\ |
| 5125 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5126 | -C "skip PMS generation for opaque PSK"\ |
| 5127 | -s "skip PMS generation for opaque PSK"\ |
| 5128 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5129 | -S "SSL - Unknown identity received" \ |
| 5130 | -S "SSL - Verification of the message MAC failed" |
| 5131 | |
| 5132 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5133 | 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] | 5134 | "$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] | 5135 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5136 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5137 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5138 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5139 | -c "session hash for extended master secret"\ |
| 5140 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5141 | -C "skip PMS generation for opaque PSK"\ |
| 5142 | -s "skip PMS generation for opaque PSK"\ |
| 5143 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5144 | -S "SSL - Unknown identity received" \ |
| 5145 | -S "SSL - Verification of the message MAC failed" |
| 5146 | |
| 5147 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5148 | 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] | 5149 | "$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] | 5150 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5151 | psk_identity=def psk=beef" \ |
| 5152 | 0 \ |
| 5153 | -C "skip PMS generation for opaque PSK"\ |
| 5154 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5155 | -C "session hash for extended master secret"\ |
| 5156 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5157 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5158 | -S "SSL - Unknown identity received" \ |
| 5159 | -S "SSL - Verification of the message MAC failed" |
| 5160 | |
| 5161 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5162 | 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] | 5163 | "$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] | 5164 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5165 | psk_identity=def psk=beef" \ |
| 5166 | 0 \ |
| 5167 | -C "skip PMS generation for opaque PSK"\ |
| 5168 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5169 | -C "session hash for extended master secret"\ |
| 5170 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5171 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5172 | -S "SSL - Unknown identity received" \ |
| 5173 | -S "SSL - Verification of the message MAC failed" |
| 5174 | |
| 5175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5176 | 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] | 5177 | "$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] | 5178 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5179 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5180 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5181 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5182 | -c "session hash for extended master secret"\ |
| 5183 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5184 | -C "skip PMS generation for opaque PSK"\ |
| 5185 | -s "skip PMS generation for opaque PSK"\ |
| 5186 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5187 | -S "SSL - Unknown identity received" \ |
| 5188 | -S "SSL - Verification of the message MAC failed" |
| 5189 | |
| 5190 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5191 | 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] | 5192 | "$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] | 5193 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5194 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5195 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5196 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5197 | -c "session hash for extended master secret"\ |
| 5198 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5199 | -C "skip PMS generation for opaque PSK"\ |
| 5200 | -s "skip PMS generation for opaque PSK"\ |
| 5201 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5202 | -S "SSL - Unknown identity received" \ |
| 5203 | -S "SSL - Verification of the message MAC failed" |
| 5204 | |
| 5205 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5206 | 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] | 5207 | "$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] | 5208 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5209 | psk_identity=def psk=beef" \ |
| 5210 | 0 \ |
| 5211 | -C "skip PMS generation for opaque PSK"\ |
| 5212 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5213 | -C "session hash for extended master secret"\ |
| 5214 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5215 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5216 | -S "SSL - Unknown identity received" \ |
| 5217 | -S "SSL - Verification of the message MAC failed" |
| 5218 | |
| 5219 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5220 | 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] | 5221 | "$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] | 5222 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5223 | psk_identity=def psk=beef" \ |
| 5224 | 0 \ |
| 5225 | -C "skip PMS generation for opaque PSK"\ |
| 5226 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5227 | -C "session hash for extended master secret"\ |
| 5228 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5229 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5230 | -S "SSL - Unknown identity received" \ |
| 5231 | -S "SSL - Verification of the message MAC failed" |
| 5232 | |
| 5233 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5234 | 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] | 5235 | "$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] | 5236 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5237 | psk_identity=def psk=beef" \ |
| 5238 | 0 \ |
| 5239 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5240 | -C "session hash for extended master secret"\ |
| 5241 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5242 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5243 | -S "SSL - Unknown identity received" \ |
| 5244 | -S "SSL - Verification of the message MAC failed" |
| 5245 | |
| 5246 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5247 | 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] | 5248 | "$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] | 5249 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5250 | psk_identity=def psk=beef" \ |
| 5251 | 0 \ |
| 5252 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5253 | -C "session hash for extended master secret"\ |
| 5254 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5255 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5256 | -S "SSL - Unknown identity received" \ |
| 5257 | -S "SSL - Verification of the message MAC failed" |
| 5258 | |
| 5259 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5260 | 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] | 5261 | "$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] | 5262 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5263 | psk_identity=def psk=beef" \ |
| 5264 | 1 \ |
| 5265 | -s "SSL - Verification of the message MAC failed" |
| 5266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5267 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5268 | "$P_SRV" \ |
| 5269 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5270 | psk_identity=foo psk=abc123" \ |
| 5271 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5272 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5273 | -S "SSL - Unknown identity received" \ |
| 5274 | -S "SSL - Verification of the message MAC failed" |
| 5275 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5276 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5277 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5278 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5279 | psk_identity=foo psk=abc123" \ |
| 5280 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5281 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5282 | -s "SSL - Unknown identity received" \ |
| 5283 | -S "SSL - Verification of the message MAC failed" |
| 5284 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5285 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5286 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5287 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5288 | psk_identity=abc psk=dead" \ |
| 5289 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5290 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5291 | -S "SSL - Unknown identity received" \ |
| 5292 | -S "SSL - Verification of the message MAC failed" |
| 5293 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5294 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5295 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5296 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5297 | psk_identity=def psk=beef" \ |
| 5298 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5299 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5300 | -S "SSL - Unknown identity received" \ |
| 5301 | -S "SSL - Verification of the message MAC failed" |
| 5302 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5303 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5304 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5305 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5306 | psk_identity=ghi psk=beef" \ |
| 5307 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5308 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5309 | -s "SSL - Unknown identity received" \ |
| 5310 | -S "SSL - Verification of the message MAC failed" |
| 5311 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5312 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5313 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5314 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5315 | psk_identity=abc psk=beef" \ |
| 5316 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5317 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5318 | -S "SSL - Unknown identity received" \ |
| 5319 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5320 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5321 | # Tests for EC J-PAKE |
| 5322 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5323 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5324 | run_test "ECJPAKE: client not configured" \ |
| 5325 | "$P_SRV debug_level=3" \ |
| 5326 | "$P_CLI debug_level=3" \ |
| 5327 | 0 \ |
| 5328 | -C "add ciphersuite: c0ff" \ |
| 5329 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5330 | -S "found ecjpake kkpp extension" \ |
| 5331 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5332 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5333 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5334 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5335 | -S "None of the common ciphersuites is usable" |
| 5336 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5337 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5338 | run_test "ECJPAKE: server not configured" \ |
| 5339 | "$P_SRV debug_level=3" \ |
| 5340 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5341 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5342 | 1 \ |
| 5343 | -c "add ciphersuite: c0ff" \ |
| 5344 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5345 | -s "found ecjpake kkpp extension" \ |
| 5346 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5347 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5348 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5349 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5350 | -s "None of the common ciphersuites is usable" |
| 5351 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5352 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5353 | run_test "ECJPAKE: working, TLS" \ |
| 5354 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5355 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5356 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5357 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5358 | -c "add ciphersuite: c0ff" \ |
| 5359 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5360 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5361 | -s "found ecjpake kkpp extension" \ |
| 5362 | -S "skip ecjpake kkpp extension" \ |
| 5363 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5364 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5365 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5366 | -S "None of the common ciphersuites is usable" \ |
| 5367 | -S "SSL - Verification of the message MAC failed" |
| 5368 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5369 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5370 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5371 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5372 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5373 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5374 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5375 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5376 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5377 | -s "SSL - Verification of the message MAC failed" |
| 5378 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5379 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5380 | run_test "ECJPAKE: working, DTLS" \ |
| 5381 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5382 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5383 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5384 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5385 | -c "re-using cached ecjpake parameters" \ |
| 5386 | -S "SSL - Verification of the message MAC failed" |
| 5387 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5388 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5389 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5390 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5391 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5392 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5393 | 0 \ |
| 5394 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5395 | -S "SSL - Verification of the message MAC failed" |
| 5396 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5397 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5398 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5399 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5400 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5401 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5402 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5403 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5404 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5405 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5406 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5407 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5408 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5409 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5410 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5411 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5412 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5413 | 0 |
| 5414 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5415 | # Tests for ciphersuites per version |
| 5416 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5417 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5418 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5419 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5420 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5421 | "$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] | 5422 | "$P_CLI force_version=ssl3" \ |
| 5423 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5424 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5425 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5426 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5427 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5428 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5429 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5430 | "$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] | 5431 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5432 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5433 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5434 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5436 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5437 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5438 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5439 | "$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] | 5440 | "$P_CLI force_version=tls1_1" \ |
| 5441 | 0 \ |
| 5442 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5443 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5444 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5445 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5446 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5447 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5448 | "$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] | 5449 | "$P_CLI force_version=tls1_2" \ |
| 5450 | 0 \ |
| 5451 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5452 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5453 | # Test for ClientHello without extensions |
| 5454 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5455 | requires_gnutls |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5456 | run_test "ClientHello without extensions, SHA-1 allowed" \ |
Ron Eldor | 574ac57 | 2019-01-16 23:14:41 +0200 | [diff] [blame] | 5457 | "$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] | 5458 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5459 | 0 \ |
| 5460 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5461 | |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5462 | requires_gnutls |
| 5463 | run_test "ClientHello without extensions, SHA-1 forbidden in certificates on server" \ |
| 5464 | "$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] | 5465 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5466 | 0 \ |
| 5467 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5468 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5469 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5470 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5471 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5472 | "$P_SRV" \ |
| 5473 | "$P_CLI request_size=100" \ |
| 5474 | 0 \ |
| 5475 | -s "Read from client: 100 bytes read$" |
| 5476 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5477 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5478 | "$P_SRV" \ |
| 5479 | "$P_CLI request_size=500" \ |
| 5480 | 0 \ |
| 5481 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5482 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5483 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5484 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5485 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5486 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5487 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5488 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5489 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5490 | 0 \ |
| 5491 | -s "Read from client: 1 bytes read" |
| 5492 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5493 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5494 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5495 | "$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] | 5496 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5497 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5498 | 0 \ |
| 5499 | -s "Read from client: 1 bytes read" |
| 5500 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5501 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5502 | "$P_SRV" \ |
| 5503 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5505 | 0 \ |
| 5506 | -s "Read from client: 1 bytes read" |
| 5507 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5508 | 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] | 5509 | "$P_SRV" \ |
| 5510 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5511 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5512 | 0 \ |
| 5513 | -s "Read from client: 1 bytes read" |
| 5514 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5515 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5516 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5517 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5518 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5519 | 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] | 5520 | 0 \ |
| 5521 | -s "Read from client: 1 bytes read" |
| 5522 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5523 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5524 | 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] | 5525 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5526 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5527 | 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] | 5528 | 0 \ |
| 5529 | -s "Read from client: 1 bytes read" |
| 5530 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5531 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5532 | "$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] | 5533 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5534 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5535 | 0 \ |
| 5536 | -s "Read from client: 1 bytes read" |
| 5537 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5538 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5539 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5540 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5541 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5542 | 0 \ |
| 5543 | -s "Read from client: 1 bytes read" |
| 5544 | |
| 5545 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5546 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5547 | "$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] | 5548 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5549 | 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] | 5550 | 0 \ |
| 5551 | -s "Read from client: 1 bytes read" |
| 5552 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5553 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5554 | 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] | 5555 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5556 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5557 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5558 | 0 \ |
| 5559 | -s "Read from client: 1 bytes read" |
| 5560 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5561 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5562 | "$P_SRV" \ |
| 5563 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5565 | 0 \ |
| 5566 | -s "Read from client: 1 bytes read" |
| 5567 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5568 | 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] | 5569 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5570 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5571 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5572 | 0 \ |
| 5573 | -s "Read from client: 1 bytes read" |
| 5574 | |
| 5575 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5576 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5577 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5578 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5579 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5580 | 0 \ |
| 5581 | -s "Read from client: 1 bytes read" |
| 5582 | |
| 5583 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5584 | 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] | 5585 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5586 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5587 | 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] | 5588 | 0 \ |
| 5589 | -s "Read from client: 1 bytes read" |
| 5590 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5591 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5592 | "$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] | 5593 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 5594 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5595 | 0 \ |
| 5596 | -s "Read from client: 1 bytes read" |
| 5597 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5598 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5599 | "$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] | 5600 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5601 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5602 | 0 \ |
| 5603 | -s "Read from client: 1 bytes read" |
| 5604 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5605 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5606 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5607 | "$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] | 5608 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5609 | 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] | 5610 | 0 \ |
| 5611 | -s "Read from client: 1 bytes read" |
| 5612 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5613 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5614 | 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] | 5615 | "$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] | 5616 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5617 | 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] | 5618 | 0 \ |
| 5619 | -s "Read from client: 1 bytes read" |
| 5620 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5621 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5622 | "$P_SRV" \ |
| 5623 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5625 | 0 \ |
| 5626 | -s "Read from client: 1 bytes read" |
| 5627 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5628 | 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] | 5629 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5630 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5631 | 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] | 5632 | 0 \ |
| 5633 | -s "Read from client: 1 bytes read" |
| 5634 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5635 | 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] | 5636 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5637 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5638 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5639 | 0 \ |
| 5640 | -s "Read from client: 1 bytes read" |
| 5641 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5643 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5644 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5645 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5646 | 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] | 5647 | 0 \ |
| 5648 | -s "Read from client: 1 bytes read" |
| 5649 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5651 | 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] | 5652 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5653 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5654 | 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] | 5655 | 0 \ |
| 5656 | -s "Read from client: 1 bytes read" |
| 5657 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5658 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5659 | "$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] | 5660 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5661 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5662 | 0 \ |
| 5663 | -s "Read from client: 1 bytes read" |
| 5664 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5665 | 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] | 5666 | "$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] | 5667 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5668 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5669 | 0 \ |
| 5670 | -s "Read from client: 1 bytes read" |
| 5671 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5672 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5673 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5674 | "$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] | 5675 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5676 | 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] | 5677 | 0 \ |
| 5678 | -s "Read from client: 1 bytes read" |
| 5679 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5680 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5681 | 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] | 5682 | "$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] | 5683 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5684 | 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] | 5685 | 0 \ |
| 5686 | -s "Read from client: 1 bytes read" |
| 5687 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5688 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5689 | "$P_SRV" \ |
| 5690 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5691 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5692 | 0 \ |
| 5693 | -s "Read from client: 1 bytes read" |
| 5694 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5695 | 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] | 5696 | "$P_SRV" \ |
| 5697 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5698 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5699 | 0 \ |
| 5700 | -s "Read from client: 1 bytes read" |
| 5701 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5702 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5703 | |
| 5704 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5705 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5706 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 5707 | "$P_CLI dtls=1 request_size=1 \ |
| 5708 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5709 | 0 \ |
| 5710 | -s "Read from client: 1 bytes read" |
| 5711 | |
| 5712 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5713 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5714 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 5715 | "$P_CLI dtls=1 request_size=1 \ |
| 5716 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5717 | 0 \ |
| 5718 | -s "Read from client: 1 bytes read" |
| 5719 | |
| 5720 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5721 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5722 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5723 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 5724 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5726 | 0 \ |
| 5727 | -s "Read from client: 1 bytes read" |
| 5728 | |
| 5729 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5730 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5731 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5732 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5733 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5734 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5735 | 0 \ |
| 5736 | -s "Read from client: 1 bytes read" |
| 5737 | |
| 5738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5739 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5740 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5741 | "$P_CLI dtls=1 request_size=1 \ |
| 5742 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5743 | 0 \ |
| 5744 | -s "Read from client: 1 bytes read" |
| 5745 | |
| 5746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5747 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5748 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5749 | "$P_CLI dtls=1 request_size=1 \ |
| 5750 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5751 | 0 \ |
| 5752 | -s "Read from client: 1 bytes read" |
| 5753 | |
| 5754 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5755 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5756 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5757 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5758 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5759 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5760 | 0 \ |
| 5761 | -s "Read from client: 1 bytes read" |
| 5762 | |
| 5763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5764 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5765 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5766 | "$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] | 5767 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5768 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5769 | 0 \ |
| 5770 | -s "Read from client: 1 bytes read" |
| 5771 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5772 | # Tests for small server packets |
| 5773 | |
| 5774 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5775 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 5776 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 5777 | "$P_CLI force_version=ssl3 \ |
| 5778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5779 | 0 \ |
| 5780 | -c "Read from server: 1 bytes read" |
| 5781 | |
| 5782 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5783 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 5784 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5785 | "$P_CLI force_version=ssl3 \ |
| 5786 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5787 | 0 \ |
| 5788 | -c "Read from server: 1 bytes read" |
| 5789 | |
| 5790 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 5791 | "$P_SRV response_size=1" \ |
| 5792 | "$P_CLI force_version=tls1 \ |
| 5793 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5794 | 0 \ |
| 5795 | -c "Read from server: 1 bytes read" |
| 5796 | |
| 5797 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5798 | "$P_SRV response_size=1" \ |
| 5799 | "$P_CLI force_version=tls1 etm=0 \ |
| 5800 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5801 | 0 \ |
| 5802 | -c "Read from server: 1 bytes read" |
| 5803 | |
| 5804 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5805 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 5806 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5807 | "$P_CLI force_version=tls1 \ |
| 5808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5809 | 0 \ |
| 5810 | -c "Read from server: 1 bytes read" |
| 5811 | |
| 5812 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5813 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 5814 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5815 | "$P_CLI force_version=tls1 \ |
| 5816 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5817 | 0 \ |
| 5818 | -c "Read from server: 1 bytes read" |
| 5819 | |
| 5820 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 5821 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5822 | "$P_CLI force_version=tls1 \ |
| 5823 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5824 | 0 \ |
| 5825 | -c "Read from server: 1 bytes read" |
| 5826 | |
| 5827 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5828 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5829 | "$P_CLI force_version=tls1 \ |
| 5830 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5831 | 0 \ |
| 5832 | -c "Read from server: 1 bytes read" |
| 5833 | |
| 5834 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5835 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5836 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5837 | "$P_CLI force_version=tls1 \ |
| 5838 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5839 | 0 \ |
| 5840 | -c "Read from server: 1 bytes read" |
| 5841 | |
| 5842 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5843 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5844 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5845 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5846 | trunc_hmac=1 etm=0" \ |
| 5847 | 0 \ |
| 5848 | -c "Read from server: 1 bytes read" |
| 5849 | |
| 5850 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 5851 | "$P_SRV response_size=1" \ |
| 5852 | "$P_CLI force_version=tls1_1 \ |
| 5853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5854 | 0 \ |
| 5855 | -c "Read from server: 1 bytes read" |
| 5856 | |
| 5857 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5858 | "$P_SRV response_size=1" \ |
| 5859 | "$P_CLI force_version=tls1_1 \ |
| 5860 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5861 | 0 \ |
| 5862 | -c "Read from server: 1 bytes read" |
| 5863 | |
| 5864 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5865 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 5866 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5867 | "$P_CLI force_version=tls1_1 \ |
| 5868 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5869 | 0 \ |
| 5870 | -c "Read from server: 1 bytes read" |
| 5871 | |
| 5872 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5873 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5874 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5875 | "$P_CLI force_version=tls1_1 \ |
| 5876 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5877 | 0 \ |
| 5878 | -c "Read from server: 1 bytes read" |
| 5879 | |
| 5880 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 5881 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5882 | "$P_CLI force_version=tls1_1 \ |
| 5883 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5884 | 0 \ |
| 5885 | -c "Read from server: 1 bytes read" |
| 5886 | |
| 5887 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5888 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5889 | "$P_CLI force_version=tls1_1 \ |
| 5890 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5891 | 0 \ |
| 5892 | -c "Read from server: 1 bytes read" |
| 5893 | |
| 5894 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5895 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 5896 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5897 | "$P_CLI force_version=tls1_1 \ |
| 5898 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5899 | 0 \ |
| 5900 | -c "Read from server: 1 bytes read" |
| 5901 | |
| 5902 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5903 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5904 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5905 | "$P_CLI force_version=tls1_1 \ |
| 5906 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5907 | 0 \ |
| 5908 | -c "Read from server: 1 bytes read" |
| 5909 | |
| 5910 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5911 | "$P_SRV response_size=1" \ |
| 5912 | "$P_CLI force_version=tls1_2 \ |
| 5913 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5914 | 0 \ |
| 5915 | -c "Read from server: 1 bytes read" |
| 5916 | |
| 5917 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5918 | "$P_SRV response_size=1" \ |
| 5919 | "$P_CLI force_version=tls1_2 \ |
| 5920 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5921 | 0 \ |
| 5922 | -c "Read from server: 1 bytes read" |
| 5923 | |
| 5924 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5925 | "$P_SRV response_size=1" \ |
| 5926 | "$P_CLI force_version=tls1_2 \ |
| 5927 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5928 | 0 \ |
| 5929 | -c "Read from server: 1 bytes read" |
| 5930 | |
| 5931 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5932 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 5933 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5934 | "$P_CLI force_version=tls1_2 \ |
| 5935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 5936 | 0 \ |
| 5937 | -c "Read from server: 1 bytes read" |
| 5938 | |
| 5939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5940 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5941 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 5942 | "$P_CLI force_version=tls1_2 \ |
| 5943 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5944 | 0 \ |
| 5945 | -c "Read from server: 1 bytes read" |
| 5946 | |
| 5947 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 5948 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5949 | "$P_CLI force_version=tls1_2 \ |
| 5950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5951 | 0 \ |
| 5952 | -c "Read from server: 1 bytes read" |
| 5953 | |
| 5954 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5955 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5956 | "$P_CLI force_version=tls1_2 \ |
| 5957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5958 | 0 \ |
| 5959 | -c "Read from server: 1 bytes read" |
| 5960 | |
| 5961 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5962 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 5963 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5964 | "$P_CLI force_version=tls1_2 \ |
| 5965 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5966 | 0 \ |
| 5967 | -c "Read from server: 1 bytes read" |
| 5968 | |
| 5969 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5970 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5971 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5972 | "$P_CLI force_version=tls1_2 \ |
| 5973 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5974 | 0 \ |
| 5975 | -c "Read from server: 1 bytes read" |
| 5976 | |
| 5977 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5978 | "$P_SRV response_size=1" \ |
| 5979 | "$P_CLI force_version=tls1_2 \ |
| 5980 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5981 | 0 \ |
| 5982 | -c "Read from server: 1 bytes read" |
| 5983 | |
| 5984 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5985 | "$P_SRV response_size=1" \ |
| 5986 | "$P_CLI force_version=tls1_2 \ |
| 5987 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5988 | 0 \ |
| 5989 | -c "Read from server: 1 bytes read" |
| 5990 | |
| 5991 | # Tests for small server packets in DTLS |
| 5992 | |
| 5993 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5994 | run_test "Small server packet DTLS 1.0" \ |
| 5995 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 5996 | "$P_CLI dtls=1 \ |
| 5997 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5998 | 0 \ |
| 5999 | -c "Read from server: 1 bytes read" |
| 6000 | |
| 6001 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6002 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6003 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6004 | "$P_CLI dtls=1 \ |
| 6005 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6006 | 0 \ |
| 6007 | -c "Read from server: 1 bytes read" |
| 6008 | |
| 6009 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6010 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6011 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6012 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6013 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6014 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6015 | 0 \ |
| 6016 | -c "Read from server: 1 bytes read" |
| 6017 | |
| 6018 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6019 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6020 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6021 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6022 | "$P_CLI dtls=1 \ |
| 6023 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6024 | 0 \ |
| 6025 | -c "Read from server: 1 bytes read" |
| 6026 | |
| 6027 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6028 | run_test "Small server packet DTLS 1.2" \ |
| 6029 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6030 | "$P_CLI dtls=1 \ |
| 6031 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6032 | 0 \ |
| 6033 | -c "Read from server: 1 bytes read" |
| 6034 | |
| 6035 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6036 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6037 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6038 | "$P_CLI dtls=1 \ |
| 6039 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6040 | 0 \ |
| 6041 | -c "Read from server: 1 bytes read" |
| 6042 | |
| 6043 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6044 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6045 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6046 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6047 | "$P_CLI dtls=1 \ |
| 6048 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6049 | 0 \ |
| 6050 | -c "Read from server: 1 bytes read" |
| 6051 | |
| 6052 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6053 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6054 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6055 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6056 | "$P_CLI dtls=1 \ |
| 6057 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6058 | 0 \ |
| 6059 | -c "Read from server: 1 bytes read" |
| 6060 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6061 | # A test for extensions in SSLv3 |
| 6062 | |
| 6063 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6064 | run_test "SSLv3 with extensions, server side" \ |
| 6065 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6066 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6067 | 0 \ |
| 6068 | -S "dumping 'client hello extensions'" \ |
| 6069 | -S "server hello, total extension length:" |
| 6070 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6071 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6072 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6073 | # How many fragments do we expect to write $1 bytes? |
| 6074 | fragments_for_write() { |
| 6075 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6076 | } |
| 6077 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6078 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6079 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6080 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6081 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6082 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6083 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6084 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6085 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6086 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6087 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6088 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6089 | "$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] | 6090 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6091 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6092 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6093 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6094 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6095 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6096 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6097 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6098 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6099 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6100 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6101 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6102 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6103 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6104 | 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] | 6105 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6106 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6108 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6109 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6110 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6111 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6112 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6113 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6114 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6115 | 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] | 6116 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6117 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6118 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6119 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6120 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6121 | 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] | 6122 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6123 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6124 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6125 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6126 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6127 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6128 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6129 | "$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] | 6130 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6131 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6132 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6133 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6134 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6135 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6136 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6137 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6138 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6139 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6140 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6141 | |
| 6142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6143 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6144 | "$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] | 6145 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6146 | 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] | 6147 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6148 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6149 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6151 | 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] | 6152 | "$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] | 6153 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6154 | 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] | 6155 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6156 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6157 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6158 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6159 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6160 | "$P_SRV" \ |
| 6161 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6163 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6164 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6165 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6166 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6167 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6168 | "$P_SRV" \ |
| 6169 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6171 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6172 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6173 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6175 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6176 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6177 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6178 | 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] | 6179 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6180 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6181 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6182 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6183 | 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] | 6184 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6185 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6186 | 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] | 6187 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6188 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6189 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6190 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6191 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6192 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6193 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6194 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6195 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6196 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6197 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6198 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6199 | "$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] | 6200 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6201 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6202 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6203 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6204 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6205 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6206 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6207 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6208 | "$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] | 6209 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6210 | 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] | 6211 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6212 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6213 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6214 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6215 | 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] | 6216 | "$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] | 6217 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6218 | 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] | 6219 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6220 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6221 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6222 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6223 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6224 | "$P_SRV" \ |
| 6225 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6226 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6227 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6228 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6229 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6230 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6231 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6232 | "$P_SRV" \ |
| 6233 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6234 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6235 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6236 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6237 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6238 | 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] | 6239 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6240 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6241 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6242 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6243 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6244 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6245 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6246 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6247 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6248 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6249 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6250 | 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] | 6251 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6252 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6253 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6255 | 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] | 6256 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6257 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6258 | 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] | 6259 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6260 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6261 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6262 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6263 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6264 | "$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] | 6265 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6266 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6267 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6268 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6269 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6270 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6271 | 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] | 6272 | "$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] | 6273 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6274 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6275 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6276 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6277 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6278 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6279 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6280 | "$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] | 6281 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6282 | 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] | 6283 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6284 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6285 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6286 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6287 | 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] | 6288 | "$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] | 6289 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6290 | 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] | 6291 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6292 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6293 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6294 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6295 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6296 | "$P_SRV" \ |
| 6297 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6298 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6299 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6300 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6301 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6302 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6303 | 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] | 6304 | "$P_SRV" \ |
| 6305 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6306 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6307 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6308 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6309 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6310 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6311 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6312 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6313 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6314 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6315 | "$P_CLI force_version=ssl3 \ |
| 6316 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6317 | 0 \ |
| 6318 | -c "Read from server: 16384 bytes read" |
| 6319 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6320 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6321 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6322 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6323 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6324 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6325 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6326 | 0 \ |
| 6327 | -c "Read from server: 1 bytes read"\ |
| 6328 | -c "16383 bytes read"\ |
| 6329 | -C "Read from server: 16384 bytes read" |
| 6330 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6331 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6332 | "$P_SRV response_size=16384" \ |
| 6333 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6334 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6335 | 0 \ |
| 6336 | -c "Read from server: 1 bytes read"\ |
| 6337 | -c "16383 bytes read"\ |
| 6338 | -C "Read from server: 16384 bytes read" |
| 6339 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6340 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6341 | "$P_SRV response_size=16384" \ |
| 6342 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6343 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6344 | 0 \ |
| 6345 | -c "Read from server: 1 bytes read"\ |
| 6346 | -c "16383 bytes read"\ |
| 6347 | -C "Read from server: 16384 bytes read" |
| 6348 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6349 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6350 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6351 | "$P_SRV response_size=16384" \ |
| 6352 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6353 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6354 | trunc_hmac=1" \ |
| 6355 | 0 \ |
| 6356 | -c "Read from server: 1 bytes read"\ |
| 6357 | -c "16383 bytes read"\ |
| 6358 | -C "Read from server: 16384 bytes read" |
| 6359 | |
| 6360 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6361 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6362 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6363 | "$P_CLI force_version=tls1 \ |
| 6364 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6365 | trunc_hmac=1" \ |
| 6366 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6367 | -s "16384 bytes written in 1 fragments" \ |
| 6368 | -c "Read from server: 16384 bytes read" |
| 6369 | |
| 6370 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6371 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6372 | "$P_CLI force_version=tls1 \ |
| 6373 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6374 | 0 \ |
| 6375 | -s "16384 bytes written in 1 fragments" \ |
| 6376 | -c "Read from server: 16384 bytes read" |
| 6377 | |
| 6378 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6379 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6380 | "$P_CLI force_version=tls1 \ |
| 6381 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6382 | 0 \ |
| 6383 | -s "16384 bytes written in 1 fragments" \ |
| 6384 | -c "Read from server: 16384 bytes read" |
| 6385 | |
| 6386 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6387 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6388 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6389 | "$P_CLI force_version=tls1 \ |
| 6390 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6391 | 0 \ |
| 6392 | -s "16384 bytes written in 1 fragments" \ |
| 6393 | -c "Read from server: 16384 bytes read" |
| 6394 | |
| 6395 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6396 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6397 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6398 | "$P_CLI force_version=tls1 \ |
| 6399 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6400 | 0 \ |
| 6401 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6402 | -c "Read from server: 16384 bytes read" |
| 6403 | |
| 6404 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6405 | "$P_SRV response_size=16384" \ |
| 6406 | "$P_CLI force_version=tls1_1 \ |
| 6407 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6408 | 0 \ |
| 6409 | -c "Read from server: 16384 bytes read" |
| 6410 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6411 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6412 | "$P_SRV response_size=16384" \ |
| 6413 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6414 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6415 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6416 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6417 | -c "Read from server: 16384 bytes read" |
| 6418 | |
| 6419 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6420 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6421 | "$P_SRV response_size=16384" \ |
| 6422 | "$P_CLI force_version=tls1_1 \ |
| 6423 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6424 | trunc_hmac=1" \ |
| 6425 | 0 \ |
| 6426 | -c "Read from server: 16384 bytes read" |
| 6427 | |
| 6428 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6429 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6430 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6431 | "$P_CLI force_version=tls1_1 \ |
| 6432 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6433 | 0 \ |
| 6434 | -s "16384 bytes written in 1 fragments" \ |
| 6435 | -c "Read from server: 16384 bytes read" |
| 6436 | |
| 6437 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6438 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6439 | "$P_CLI force_version=tls1_1 \ |
| 6440 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6441 | 0 \ |
| 6442 | -c "Read from server: 16384 bytes read" |
| 6443 | |
| 6444 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6445 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6446 | "$P_CLI force_version=tls1_1 \ |
| 6447 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6448 | 0 \ |
| 6449 | -s "16384 bytes written in 1 fragments" \ |
| 6450 | -c "Read from server: 16384 bytes read" |
| 6451 | |
| 6452 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6453 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6454 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6455 | "$P_CLI force_version=tls1_1 \ |
| 6456 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6457 | trunc_hmac=1" \ |
| 6458 | 0 \ |
| 6459 | -c "Read from server: 16384 bytes read" |
| 6460 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6461 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6462 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6463 | "$P_CLI force_version=tls1_1 \ |
| 6464 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6465 | 0 \ |
| 6466 | -s "16384 bytes written in 1 fragments" \ |
| 6467 | -c "Read from server: 16384 bytes read" |
| 6468 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6469 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6470 | "$P_SRV response_size=16384" \ |
| 6471 | "$P_CLI force_version=tls1_2 \ |
| 6472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6473 | 0 \ |
| 6474 | -c "Read from server: 16384 bytes read" |
| 6475 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6476 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6477 | "$P_SRV response_size=16384" \ |
| 6478 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6479 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6480 | 0 \ |
| 6481 | -s "16384 bytes written in 1 fragments" \ |
| 6482 | -c "Read from server: 16384 bytes read" |
| 6483 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6484 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6485 | "$P_SRV response_size=16384" \ |
| 6486 | "$P_CLI force_version=tls1_2 \ |
| 6487 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6488 | 0 \ |
| 6489 | -c "Read from server: 16384 bytes read" |
| 6490 | |
| 6491 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6492 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6493 | "$P_SRV response_size=16384" \ |
| 6494 | "$P_CLI force_version=tls1_2 \ |
| 6495 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6496 | trunc_hmac=1" \ |
| 6497 | 0 \ |
| 6498 | -c "Read from server: 16384 bytes read" |
| 6499 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6500 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6501 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6502 | "$P_CLI force_version=tls1_2 \ |
| 6503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6504 | 0 \ |
| 6505 | -s "16384 bytes written in 1 fragments" \ |
| 6506 | -c "Read from server: 16384 bytes read" |
| 6507 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6508 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6509 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6510 | "$P_CLI force_version=tls1_2 \ |
| 6511 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6512 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6513 | -s "16384 bytes written in 1 fragments" \ |
| 6514 | -c "Read from server: 16384 bytes read" |
| 6515 | |
| 6516 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6517 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6518 | "$P_CLI force_version=tls1_2 \ |
| 6519 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6520 | 0 \ |
| 6521 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6522 | -c "Read from server: 16384 bytes read" |
| 6523 | |
| 6524 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6525 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6526 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6527 | "$P_CLI force_version=tls1_2 \ |
| 6528 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6529 | trunc_hmac=1" \ |
| 6530 | 0 \ |
| 6531 | -c "Read from server: 16384 bytes read" |
| 6532 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6534 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6535 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6536 | "$P_CLI force_version=tls1_2 \ |
| 6537 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6538 | 0 \ |
| 6539 | -s "16384 bytes written in 1 fragments" \ |
| 6540 | -c "Read from server: 16384 bytes read" |
| 6541 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6542 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6543 | "$P_SRV response_size=16384" \ |
| 6544 | "$P_CLI force_version=tls1_2 \ |
| 6545 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6546 | 0 \ |
| 6547 | -c "Read from server: 16384 bytes read" |
| 6548 | |
| 6549 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6550 | "$P_SRV response_size=16384" \ |
| 6551 | "$P_CLI force_version=tls1_2 \ |
| 6552 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6553 | 0 \ |
| 6554 | -c "Read from server: 16384 bytes read" |
| 6555 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6556 | # Tests for restartable ECC |
| 6557 | |
| 6558 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6559 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6560 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6561 | "$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] | 6562 | 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] | 6563 | debug_level=1" \ |
| 6564 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6565 | -C "x509_verify_cert.*4b00" \ |
| 6566 | -C "mbedtls_pk_verify.*4b00" \ |
| 6567 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6568 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6569 | |
| 6570 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6571 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6572 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6573 | "$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] | 6574 | 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] | 6575 | debug_level=1 ec_max_ops=0" \ |
| 6576 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6577 | -C "x509_verify_cert.*4b00" \ |
| 6578 | -C "mbedtls_pk_verify.*4b00" \ |
| 6579 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6580 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6581 | |
| 6582 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6583 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6584 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6585 | "$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] | 6586 | 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] | 6587 | debug_level=1 ec_max_ops=65535" \ |
| 6588 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6589 | -C "x509_verify_cert.*4b00" \ |
| 6590 | -C "mbedtls_pk_verify.*4b00" \ |
| 6591 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6592 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6593 | |
| 6594 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6595 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6596 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6597 | "$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] | 6598 | 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] | 6599 | debug_level=1 ec_max_ops=1000" \ |
| 6600 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6601 | -c "x509_verify_cert.*4b00" \ |
| 6602 | -c "mbedtls_pk_verify.*4b00" \ |
| 6603 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6604 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6605 | |
| 6606 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6607 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 6608 | "$P_SRV auth_mode=required \ |
| 6609 | crt_file=data_files/server5-badsign.crt \ |
| 6610 | key_file=data_files/server5.key" \ |
| 6611 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6612 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6613 | debug_level=1 ec_max_ops=1000" \ |
| 6614 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6615 | -c "x509_verify_cert.*4b00" \ |
| 6616 | -C "mbedtls_pk_verify.*4b00" \ |
| 6617 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6618 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6619 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6620 | -c "! mbedtls_ssl_handshake returned" \ |
| 6621 | -c "X509 - Certificate verification failed" |
| 6622 | |
| 6623 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6624 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 6625 | "$P_SRV auth_mode=required \ |
| 6626 | crt_file=data_files/server5-badsign.crt \ |
| 6627 | key_file=data_files/server5.key" \ |
| 6628 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6629 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6630 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6631 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6632 | -c "x509_verify_cert.*4b00" \ |
| 6633 | -c "mbedtls_pk_verify.*4b00" \ |
| 6634 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6635 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6636 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6637 | -C "! mbedtls_ssl_handshake returned" \ |
| 6638 | -C "X509 - Certificate verification failed" |
| 6639 | |
| 6640 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6641 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 6642 | "$P_SRV auth_mode=required \ |
| 6643 | crt_file=data_files/server5-badsign.crt \ |
| 6644 | key_file=data_files/server5.key" \ |
| 6645 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6646 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6647 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6648 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6649 | -C "x509_verify_cert.*4b00" \ |
| 6650 | -c "mbedtls_pk_verify.*4b00" \ |
| 6651 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6652 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6653 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6654 | -C "! mbedtls_ssl_handshake returned" \ |
| 6655 | -C "X509 - Certificate verification failed" |
| 6656 | |
| 6657 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6658 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6659 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6660 | "$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] | 6661 | 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] | 6662 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6663 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6664 | -c "x509_verify_cert.*4b00" \ |
| 6665 | -c "mbedtls_pk_verify.*4b00" \ |
| 6666 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6667 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6668 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6669 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6670 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 6671 | "$P_SRV" \ |
| 6672 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6673 | debug_level=1 ec_max_ops=1000" \ |
| 6674 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6675 | -c "x509_verify_cert.*4b00" \ |
| 6676 | -c "mbedtls_pk_verify.*4b00" \ |
| 6677 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6678 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6679 | |
| 6680 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 6681 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 6682 | "$P_SRV psk=abc123" \ |
| 6683 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6684 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6685 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6686 | -C "x509_verify_cert.*4b00" \ |
| 6687 | -C "mbedtls_pk_verify.*4b00" \ |
| 6688 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6689 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6690 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6691 | # Tests of asynchronous private key support in SSL |
| 6692 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6693 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6694 | run_test "SSL async private: sign, delay=0" \ |
| 6695 | "$P_SRV \ |
| 6696 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6697 | "$P_CLI" \ |
| 6698 | 0 \ |
| 6699 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6700 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6701 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6702 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6703 | run_test "SSL async private: sign, delay=1" \ |
| 6704 | "$P_SRV \ |
| 6705 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6706 | "$P_CLI" \ |
| 6707 | 0 \ |
| 6708 | -s "Async sign callback: using key slot " \ |
| 6709 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6710 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6711 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6712 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6713 | run_test "SSL async private: sign, delay=2" \ |
| 6714 | "$P_SRV \ |
| 6715 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6716 | "$P_CLI" \ |
| 6717 | 0 \ |
| 6718 | -s "Async sign callback: using key slot " \ |
| 6719 | -U "Async sign callback: using key slot " \ |
| 6720 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6721 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6722 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6723 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 6724 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 6725 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 6726 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6727 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6728 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 6729 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 6730 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 6731 | "$P_CLI force_version=tls1_1" \ |
| 6732 | 0 \ |
| 6733 | -s "Async sign callback: using key slot " \ |
| 6734 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6735 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6736 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6737 | run_test "SSL async private: sign, SNI" \ |
| 6738 | "$P_SRV debug_level=3 \ |
| 6739 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6740 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6741 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6742 | "$P_CLI server_name=polarssl.example" \ |
| 6743 | 0 \ |
| 6744 | -s "Async sign callback: using key slot " \ |
| 6745 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6746 | -s "parse ServerName extension" \ |
| 6747 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6748 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6749 | |
| 6750 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6751 | run_test "SSL async private: decrypt, delay=0" \ |
| 6752 | "$P_SRV \ |
| 6753 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6754 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6755 | 0 \ |
| 6756 | -s "Async decrypt callback: using key slot " \ |
| 6757 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6758 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6759 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6760 | run_test "SSL async private: decrypt, delay=1" \ |
| 6761 | "$P_SRV \ |
| 6762 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6763 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6764 | 0 \ |
| 6765 | -s "Async decrypt callback: using key slot " \ |
| 6766 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6767 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6768 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6769 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6770 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6771 | "$P_SRV psk=abc123 \ |
| 6772 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6773 | "$P_CLI psk=abc123 \ |
| 6774 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6775 | 0 \ |
| 6776 | -s "Async decrypt callback: using key slot " \ |
| 6777 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6778 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6779 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6780 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6781 | "$P_SRV psk=abc123 \ |
| 6782 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6783 | "$P_CLI psk=abc123 \ |
| 6784 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6785 | 0 \ |
| 6786 | -s "Async decrypt callback: using key slot " \ |
| 6787 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6788 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6789 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6790 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6791 | run_test "SSL async private: sign callback not present" \ |
| 6792 | "$P_SRV \ |
| 6793 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6794 | "$P_CLI; [ \$? -eq 1 ] && |
| 6795 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6796 | 0 \ |
| 6797 | -S "Async sign callback" \ |
| 6798 | -s "! mbedtls_ssl_handshake returned" \ |
| 6799 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6800 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6801 | -s "Successful connection" |
| 6802 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6803 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6804 | run_test "SSL async private: decrypt callback not present" \ |
| 6805 | "$P_SRV debug_level=1 \ |
| 6806 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6807 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6808 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6809 | 0 \ |
| 6810 | -S "Async decrypt callback" \ |
| 6811 | -s "! mbedtls_ssl_handshake returned" \ |
| 6812 | -s "got no RSA private key" \ |
| 6813 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6814 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6815 | |
| 6816 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6817 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6818 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6819 | "$P_SRV \ |
| 6820 | async_operations=s async_private_delay1=1 \ |
| 6821 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6822 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6823 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6824 | 0 \ |
| 6825 | -s "Async sign callback: using key slot 0," \ |
| 6826 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6827 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6828 | |
| 6829 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6830 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6831 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6832 | "$P_SRV \ |
| 6833 | async_operations=s async_private_delay2=1 \ |
| 6834 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6835 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6836 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6837 | 0 \ |
| 6838 | -s "Async sign callback: using key slot 0," \ |
| 6839 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6840 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6841 | |
| 6842 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6843 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6844 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6845 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6846 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6847 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6848 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6849 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6850 | 0 \ |
| 6851 | -s "Async sign callback: using key slot 1," \ |
| 6852 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6853 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6854 | |
| 6855 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6856 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6857 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6858 | "$P_SRV \ |
| 6859 | async_operations=s async_private_delay1=1 \ |
| 6860 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6861 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6862 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6863 | 0 \ |
| 6864 | -s "Async sign callback: no key matches this certificate." |
| 6865 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6867 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6868 | "$P_SRV \ |
| 6869 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6870 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6871 | "$P_CLI" \ |
| 6872 | 1 \ |
| 6873 | -s "Async sign callback: injected error" \ |
| 6874 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6875 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6876 | -s "! mbedtls_ssl_handshake returned" |
| 6877 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6879 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6880 | "$P_SRV \ |
| 6881 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6882 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6883 | "$P_CLI" \ |
| 6884 | 1 \ |
| 6885 | -s "Async sign callback: using key slot " \ |
| 6886 | -S "Async resume" \ |
| 6887 | -s "Async cancel" |
| 6888 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6889 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6890 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6891 | "$P_SRV \ |
| 6892 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6893 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6894 | "$P_CLI" \ |
| 6895 | 1 \ |
| 6896 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6897 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6898 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6899 | -s "! mbedtls_ssl_handshake returned" |
| 6900 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6901 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6902 | run_test "SSL async private: decrypt, error in start" \ |
| 6903 | "$P_SRV \ |
| 6904 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6905 | async_private_error=1" \ |
| 6906 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6907 | 1 \ |
| 6908 | -s "Async decrypt callback: injected error" \ |
| 6909 | -S "Async resume" \ |
| 6910 | -S "Async cancel" \ |
| 6911 | -s "! mbedtls_ssl_handshake returned" |
| 6912 | |
| 6913 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6914 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6915 | "$P_SRV \ |
| 6916 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6917 | async_private_error=2" \ |
| 6918 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6919 | 1 \ |
| 6920 | -s "Async decrypt callback: using key slot " \ |
| 6921 | -S "Async resume" \ |
| 6922 | -s "Async cancel" |
| 6923 | |
| 6924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6925 | run_test "SSL async private: decrypt, error in resume" \ |
| 6926 | "$P_SRV \ |
| 6927 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6928 | async_private_error=3" \ |
| 6929 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6930 | 1 \ |
| 6931 | -s "Async decrypt callback: using key slot " \ |
| 6932 | -s "Async resume callback: decrypt done but injected error" \ |
| 6933 | -S "Async cancel" \ |
| 6934 | -s "! mbedtls_ssl_handshake returned" |
| 6935 | |
| 6936 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6937 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6938 | "$P_SRV \ |
| 6939 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6940 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6941 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6942 | 0 \ |
| 6943 | -s "Async cancel" \ |
| 6944 | -s "! mbedtls_ssl_handshake returned" \ |
| 6945 | -s "Async resume" \ |
| 6946 | -s "Successful connection" |
| 6947 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6949 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6950 | "$P_SRV \ |
| 6951 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6952 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6953 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6954 | 0 \ |
| 6955 | -s "! mbedtls_ssl_handshake returned" \ |
| 6956 | -s "Async resume" \ |
| 6957 | -s "Successful connection" |
| 6958 | |
| 6959 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6960 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6961 | 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] | 6962 | "$P_SRV \ |
| 6963 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6964 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6965 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6966 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6967 | [ \$? -eq 1 ] && |
| 6968 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6969 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6970 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6971 | -S "Async resume" \ |
| 6972 | -s "Async cancel" \ |
| 6973 | -s "! mbedtls_ssl_handshake returned" \ |
| 6974 | -s "Async sign callback: no key matches this certificate." \ |
| 6975 | -s "Successful connection" |
| 6976 | |
| 6977 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6978 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6979 | 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] | 6980 | "$P_SRV \ |
| 6981 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6982 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6983 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6984 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6985 | [ \$? -eq 1 ] && |
| 6986 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6987 | 0 \ |
| 6988 | -s "Async resume" \ |
| 6989 | -s "! mbedtls_ssl_handshake returned" \ |
| 6990 | -s "Async sign callback: no key matches this certificate." \ |
| 6991 | -s "Successful connection" |
| 6992 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6994 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6995 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 6996 | "$P_SRV \ |
| 6997 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6998 | exchanges=2 renegotiation=1" \ |
| 6999 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7000 | 0 \ |
| 7001 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7002 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7003 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7004 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7006 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 7007 | "$P_SRV \ |
| 7008 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7009 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7010 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7011 | 0 \ |
| 7012 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7013 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7014 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7015 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7017 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 7018 | "$P_SRV \ |
| 7019 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7020 | exchanges=2 renegotiation=1" \ |
| 7021 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7022 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7023 | 0 \ |
| 7024 | -s "Async decrypt callback: using key slot " \ |
| 7025 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7026 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7027 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7028 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7029 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 7030 | "$P_SRV \ |
| 7031 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7032 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7033 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7034 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7035 | 0 \ |
| 7036 | -s "Async decrypt callback: using key slot " \ |
| 7037 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7038 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7039 | # Tests for ECC extensions (rfc 4492) |
| 7040 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7041 | requires_config_enabled MBEDTLS_AES_C |
| 7042 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7043 | requires_config_enabled MBEDTLS_SHA256_C |
| 7044 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7045 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7046 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7047 | "$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] | 7048 | 0 \ |
| 7049 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7050 | -C "client hello, adding supported_point_formats extension" \ |
| 7051 | -S "found supported elliptic curves extension" \ |
| 7052 | -S "found supported point formats extension" |
| 7053 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7054 | requires_config_enabled MBEDTLS_AES_C |
| 7055 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7056 | requires_config_enabled MBEDTLS_SHA256_C |
| 7057 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7058 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7059 | "$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] | 7060 | "$P_CLI debug_level=3" \ |
| 7061 | 0 \ |
| 7062 | -C "found supported_point_formats extension" \ |
| 7063 | -S "server hello, supported_point_formats extension" |
| 7064 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_AES_C |
| 7066 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7067 | requires_config_enabled MBEDTLS_SHA256_C |
| 7068 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7069 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7070 | "$P_SRV debug_level=3" \ |
| 7071 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7072 | 0 \ |
| 7073 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7074 | -c "client hello, adding supported_point_formats extension" \ |
| 7075 | -s "found supported elliptic curves extension" \ |
| 7076 | -s "found supported point formats extension" |
| 7077 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7078 | requires_config_enabled MBEDTLS_AES_C |
| 7079 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7080 | requires_config_enabled MBEDTLS_SHA256_C |
| 7081 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7082 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7083 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7084 | "$P_CLI debug_level=3" \ |
| 7085 | 0 \ |
| 7086 | -c "found supported_point_formats extension" \ |
| 7087 | -s "server hello, supported_point_formats extension" |
| 7088 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7089 | # Tests for DTLS HelloVerifyRequest |
| 7090 | |
| 7091 | run_test "DTLS cookie: enabled" \ |
| 7092 | "$P_SRV dtls=1 debug_level=2" \ |
| 7093 | "$P_CLI dtls=1 debug_level=2" \ |
| 7094 | 0 \ |
| 7095 | -s "cookie verification failed" \ |
| 7096 | -s "cookie verification passed" \ |
| 7097 | -S "cookie verification skipped" \ |
| 7098 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7099 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7100 | -S "SSL - The requested feature is not available" |
| 7101 | |
| 7102 | run_test "DTLS cookie: disabled" \ |
| 7103 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7104 | "$P_CLI dtls=1 debug_level=2" \ |
| 7105 | 0 \ |
| 7106 | -S "cookie verification failed" \ |
| 7107 | -S "cookie verification passed" \ |
| 7108 | -s "cookie verification skipped" \ |
| 7109 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7110 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7111 | -S "SSL - The requested feature is not available" |
| 7112 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7113 | run_test "DTLS cookie: default (failing)" \ |
| 7114 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7115 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7116 | 1 \ |
| 7117 | -s "cookie verification failed" \ |
| 7118 | -S "cookie verification passed" \ |
| 7119 | -S "cookie verification skipped" \ |
| 7120 | -C "received hello verify request" \ |
| 7121 | -S "hello verification requested" \ |
| 7122 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7123 | |
| 7124 | requires_ipv6 |
| 7125 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7126 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7127 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7128 | 0 \ |
| 7129 | -s "cookie verification failed" \ |
| 7130 | -s "cookie verification passed" \ |
| 7131 | -S "cookie verification skipped" \ |
| 7132 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7133 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7134 | -S "SSL - The requested feature is not available" |
| 7135 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7136 | run_test "DTLS cookie: enabled, nbio" \ |
| 7137 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7138 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7139 | 0 \ |
| 7140 | -s "cookie verification failed" \ |
| 7141 | -s "cookie verification passed" \ |
| 7142 | -S "cookie verification skipped" \ |
| 7143 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7144 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7145 | -S "SSL - The requested feature is not available" |
| 7146 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7147 | # Tests for client reconnecting from the same port with DTLS |
| 7148 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7149 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7150 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7151 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7152 | "$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] | 7153 | 0 \ |
| 7154 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7155 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7156 | -S "Client initiated reconnection from same port" |
| 7157 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7158 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7159 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7160 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000" \ |
| 7161 | "$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] | 7162 | 0 \ |
| 7163 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7164 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7165 | -s "Client initiated reconnection from same port" |
| 7166 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7167 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7168 | 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] | 7169 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7170 | "$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] | 7171 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7172 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7173 | -s "Client initiated reconnection from same port" |
| 7174 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7175 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7176 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7177 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7178 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7179 | 0 \ |
| 7180 | -S "The operation timed out" \ |
| 7181 | -s "Client initiated reconnection from same port" |
| 7182 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7183 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7184 | "$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] | 7185 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7186 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7187 | -s "The operation timed out" \ |
| 7188 | -S "Client initiated reconnection from same port" |
| 7189 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7190 | # Tests for various cases of client authentication with DTLS |
| 7191 | # (focused on handshake flows and message parsing) |
| 7192 | |
| 7193 | run_test "DTLS client auth: required" \ |
| 7194 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7195 | "$P_CLI dtls=1" \ |
| 7196 | 0 \ |
| 7197 | -s "Verifying peer X.509 certificate... ok" |
| 7198 | |
| 7199 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7200 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7201 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7202 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7203 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7204 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7205 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7206 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7207 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7208 | 0 \ |
| 7209 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7210 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7211 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7212 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7213 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7214 | "$P_CLI dtls=1 psk=abc124" \ |
| 7215 | 1 \ |
| 7216 | -s "SSL - Verification of the message MAC failed" \ |
| 7217 | -c "SSL - A fatal alert message was received from our peer" |
| 7218 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7219 | # Tests for receiving fragmented handshake messages with DTLS |
| 7220 | |
| 7221 | requires_gnutls |
| 7222 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7223 | "$G_SRV -u --mtu 2048 -a" \ |
| 7224 | "$P_CLI dtls=1 debug_level=2" \ |
| 7225 | 0 \ |
| 7226 | -C "found fragmented DTLS handshake message" \ |
| 7227 | -C "error" |
| 7228 | |
| 7229 | requires_gnutls |
| 7230 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7231 | "$G_SRV -u --mtu 512" \ |
| 7232 | "$P_CLI dtls=1 debug_level=2" \ |
| 7233 | 0 \ |
| 7234 | -c "found fragmented DTLS handshake message" \ |
| 7235 | -C "error" |
| 7236 | |
| 7237 | requires_gnutls |
| 7238 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7239 | "$G_SRV -u --mtu 128" \ |
| 7240 | "$P_CLI dtls=1 debug_level=2" \ |
| 7241 | 0 \ |
| 7242 | -c "found fragmented DTLS handshake message" \ |
| 7243 | -C "error" |
| 7244 | |
| 7245 | requires_gnutls |
| 7246 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7247 | "$G_SRV -u --mtu 128" \ |
| 7248 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7249 | 0 \ |
| 7250 | -c "found fragmented DTLS handshake message" \ |
| 7251 | -C "error" |
| 7252 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7253 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7254 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7255 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7256 | "$G_SRV -u --mtu 256" \ |
| 7257 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7258 | 0 \ |
| 7259 | -c "found fragmented DTLS handshake message" \ |
| 7260 | -c "client hello, adding renegotiation extension" \ |
| 7261 | -c "found renegotiation extension" \ |
| 7262 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7263 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7264 | -C "error" \ |
| 7265 | -s "Extra-header:" |
| 7266 | |
| 7267 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7268 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7269 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7270 | "$G_SRV -u --mtu 256" \ |
| 7271 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7272 | 0 \ |
| 7273 | -c "found fragmented DTLS handshake message" \ |
| 7274 | -c "client hello, adding renegotiation extension" \ |
| 7275 | -c "found renegotiation extension" \ |
| 7276 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7277 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7278 | -C "error" \ |
| 7279 | -s "Extra-header:" |
| 7280 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7281 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7282 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7283 | "$P_CLI dtls=1 debug_level=2" \ |
| 7284 | 0 \ |
| 7285 | -C "found fragmented DTLS handshake message" \ |
| 7286 | -C "error" |
| 7287 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7288 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7289 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7290 | "$P_CLI dtls=1 debug_level=2" \ |
| 7291 | 0 \ |
| 7292 | -c "found fragmented DTLS handshake message" \ |
| 7293 | -C "error" |
| 7294 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7295 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7296 | "$O_SRV -dtls1 -mtu 256" \ |
| 7297 | "$P_CLI dtls=1 debug_level=2" \ |
| 7298 | 0 \ |
| 7299 | -c "found fragmented DTLS handshake message" \ |
| 7300 | -C "error" |
| 7301 | |
| 7302 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7303 | "$O_SRV -dtls1 -mtu 256" \ |
| 7304 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7305 | 0 \ |
| 7306 | -c "found fragmented DTLS handshake message" \ |
| 7307 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7308 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7309 | # Tests for sending fragmented handshake messages with DTLS |
| 7310 | # |
| 7311 | # Use client auth when we need the client to send large messages, |
| 7312 | # and use large cert chains on both sides too (the long chains we have all use |
| 7313 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7314 | # Sizes reached (UDP payload): |
| 7315 | # - 2037B for server certificate |
| 7316 | # - 1542B for client certificate |
| 7317 | # - 1013B for newsessionticket |
| 7318 | # - all others below 512B |
| 7319 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7320 | |
| 7321 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7322 | requires_config_enabled MBEDTLS_RSA_C |
| 7323 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7324 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7325 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7326 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7327 | crt_file=data_files/server7_int-ca.crt \ |
| 7328 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7329 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7330 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7331 | "$P_CLI dtls=1 debug_level=2 \ |
| 7332 | crt_file=data_files/server8_int-ca2.crt \ |
| 7333 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7334 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7335 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7336 | 0 \ |
| 7337 | -S "found fragmented DTLS handshake message" \ |
| 7338 | -C "found fragmented DTLS handshake message" \ |
| 7339 | -C "error" |
| 7340 | |
| 7341 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7342 | requires_config_enabled MBEDTLS_RSA_C |
| 7343 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7344 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7345 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7346 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7347 | crt_file=data_files/server7_int-ca.crt \ |
| 7348 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7349 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7350 | max_frag_len=1024" \ |
| 7351 | "$P_CLI dtls=1 debug_level=2 \ |
| 7352 | crt_file=data_files/server8_int-ca2.crt \ |
| 7353 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7354 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7355 | max_frag_len=2048" \ |
| 7356 | 0 \ |
| 7357 | -S "found fragmented DTLS handshake message" \ |
| 7358 | -c "found fragmented DTLS handshake message" \ |
| 7359 | -C "error" |
| 7360 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7361 | # With the MFL extension, the server has no way of forcing |
| 7362 | # the client to not exceed a certain MTU; hence, the following |
| 7363 | # test can't be replicated with an MTU proxy such as the one |
| 7364 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7365 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7366 | requires_config_enabled MBEDTLS_RSA_C |
| 7367 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7368 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7369 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7370 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7371 | crt_file=data_files/server7_int-ca.crt \ |
| 7372 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7373 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7374 | max_frag_len=512" \ |
| 7375 | "$P_CLI dtls=1 debug_level=2 \ |
| 7376 | crt_file=data_files/server8_int-ca2.crt \ |
| 7377 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7378 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7379 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7380 | 0 \ |
| 7381 | -S "found fragmented DTLS handshake message" \ |
| 7382 | -c "found fragmented DTLS handshake message" \ |
| 7383 | -C "error" |
| 7384 | |
| 7385 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7386 | requires_config_enabled MBEDTLS_RSA_C |
| 7387 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7388 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7389 | 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] | 7390 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7391 | crt_file=data_files/server7_int-ca.crt \ |
| 7392 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7393 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7394 | max_frag_len=2048" \ |
| 7395 | "$P_CLI dtls=1 debug_level=2 \ |
| 7396 | crt_file=data_files/server8_int-ca2.crt \ |
| 7397 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7398 | hs_timeout=2500-60000 \ |
| 7399 | max_frag_len=1024" \ |
| 7400 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7401 | -S "found fragmented DTLS handshake message" \ |
| 7402 | -c "found fragmented DTLS handshake message" \ |
| 7403 | -C "error" |
| 7404 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7405 | # While not required by the standard defining the MFL extension |
| 7406 | # (according to which it only applies to records, not to datagrams), |
| 7407 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7408 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7409 | # to the peer. |
| 7410 | # The next test checks that no datagrams significantly larger than the |
| 7411 | # negotiated MFL are sent. |
| 7412 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7413 | requires_config_enabled MBEDTLS_RSA_C |
| 7414 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7415 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7416 | 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] | 7417 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7418 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7419 | crt_file=data_files/server7_int-ca.crt \ |
| 7420 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7421 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7422 | max_frag_len=2048" \ |
| 7423 | "$P_CLI dtls=1 debug_level=2 \ |
| 7424 | crt_file=data_files/server8_int-ca2.crt \ |
| 7425 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7426 | hs_timeout=2500-60000 \ |
| 7427 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7428 | 0 \ |
| 7429 | -S "found fragmented DTLS handshake message" \ |
| 7430 | -c "found fragmented DTLS handshake message" \ |
| 7431 | -C "error" |
| 7432 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7433 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7434 | requires_config_enabled MBEDTLS_RSA_C |
| 7435 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7436 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7437 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7438 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7439 | crt_file=data_files/server7_int-ca.crt \ |
| 7440 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7441 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7442 | max_frag_len=2048" \ |
| 7443 | "$P_CLI dtls=1 debug_level=2 \ |
| 7444 | crt_file=data_files/server8_int-ca2.crt \ |
| 7445 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7446 | hs_timeout=2500-60000 \ |
| 7447 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7448 | 0 \ |
| 7449 | -s "found fragmented DTLS handshake message" \ |
| 7450 | -c "found fragmented DTLS handshake message" \ |
| 7451 | -C "error" |
| 7452 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7453 | # While not required by the standard defining the MFL extension |
| 7454 | # (according to which it only applies to records, not to datagrams), |
| 7455 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7456 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7457 | # to the peer. |
| 7458 | # The next test checks that no datagrams significantly larger than the |
| 7459 | # negotiated MFL are sent. |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7461 | requires_config_enabled MBEDTLS_RSA_C |
| 7462 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7463 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7464 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7465 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7466 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7467 | crt_file=data_files/server7_int-ca.crt \ |
| 7468 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7469 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7470 | max_frag_len=2048" \ |
| 7471 | "$P_CLI dtls=1 debug_level=2 \ |
| 7472 | crt_file=data_files/server8_int-ca2.crt \ |
| 7473 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7474 | hs_timeout=2500-60000 \ |
| 7475 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7476 | 0 \ |
| 7477 | -s "found fragmented DTLS handshake message" \ |
| 7478 | -c "found fragmented DTLS handshake message" \ |
| 7479 | -C "error" |
| 7480 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7482 | requires_config_enabled MBEDTLS_RSA_C |
| 7483 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7484 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7485 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7486 | crt_file=data_files/server7_int-ca.crt \ |
| 7487 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7488 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7489 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7490 | "$P_CLI dtls=1 debug_level=2 \ |
| 7491 | crt_file=data_files/server8_int-ca2.crt \ |
| 7492 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7493 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7494 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7495 | 0 \ |
| 7496 | -S "found fragmented DTLS handshake message" \ |
| 7497 | -C "found fragmented DTLS handshake message" \ |
| 7498 | -C "error" |
| 7499 | |
| 7500 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7501 | requires_config_enabled MBEDTLS_RSA_C |
| 7502 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7503 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7504 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7505 | crt_file=data_files/server7_int-ca.crt \ |
| 7506 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7507 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7508 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7509 | "$P_CLI dtls=1 debug_level=2 \ |
| 7510 | crt_file=data_files/server8_int-ca2.crt \ |
| 7511 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7512 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7513 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7514 | 0 \ |
| 7515 | -s "found fragmented DTLS handshake message" \ |
| 7516 | -C "found fragmented DTLS handshake message" \ |
| 7517 | -C "error" |
| 7518 | |
| 7519 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7520 | requires_config_enabled MBEDTLS_RSA_C |
| 7521 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7522 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7523 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7524 | crt_file=data_files/server7_int-ca.crt \ |
| 7525 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7526 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7527 | mtu=512" \ |
| 7528 | "$P_CLI dtls=1 debug_level=2 \ |
| 7529 | crt_file=data_files/server8_int-ca2.crt \ |
| 7530 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7531 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7532 | mtu=2048" \ |
| 7533 | 0 \ |
| 7534 | -S "found fragmented DTLS handshake message" \ |
| 7535 | -c "found fragmented DTLS handshake message" \ |
| 7536 | -C "error" |
| 7537 | |
| 7538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7539 | requires_config_enabled MBEDTLS_RSA_C |
| 7540 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7541 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7542 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7543 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7544 | crt_file=data_files/server7_int-ca.crt \ |
| 7545 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7546 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7547 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7548 | "$P_CLI dtls=1 debug_level=2 \ |
| 7549 | crt_file=data_files/server8_int-ca2.crt \ |
| 7550 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7551 | hs_timeout=2500-60000 \ |
| 7552 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7553 | 0 \ |
| 7554 | -s "found fragmented DTLS handshake message" \ |
| 7555 | -c "found fragmented DTLS handshake message" \ |
| 7556 | -C "error" |
| 7557 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7558 | # 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] | 7559 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7560 | requires_config_enabled MBEDTLS_RSA_C |
| 7561 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7562 | requires_config_enabled MBEDTLS_SHA256_C |
| 7563 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7564 | requires_config_enabled MBEDTLS_AES_C |
| 7565 | requires_config_enabled MBEDTLS_GCM_C |
| 7566 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7567 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7568 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7569 | crt_file=data_files/server7_int-ca.crt \ |
| 7570 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7571 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7572 | mtu=512" \ |
| 7573 | "$P_CLI dtls=1 debug_level=2 \ |
| 7574 | crt_file=data_files/server8_int-ca2.crt \ |
| 7575 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7576 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7577 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7578 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7579 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7580 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7581 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7582 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7583 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7584 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7585 | # 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] | 7586 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7587 | # retransmissions, but in some cases (like both the server and client using |
| 7588 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7589 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7590 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7591 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7592 | requires_config_enabled MBEDTLS_RSA_C |
| 7593 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7594 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7595 | requires_config_enabled MBEDTLS_AES_C |
| 7596 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7597 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7598 | -p "$P_PXY mtu=508" \ |
| 7599 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7600 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7601 | key_file=data_files/server7.key \ |
| 7602 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7603 | "$P_CLI dtls=1 debug_level=2 \ |
| 7604 | crt_file=data_files/server8_int-ca2.crt \ |
| 7605 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7606 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7607 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7608 | 0 \ |
| 7609 | -s "found fragmented DTLS handshake message" \ |
| 7610 | -c "found fragmented DTLS handshake message" \ |
| 7611 | -C "error" |
| 7612 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7613 | # 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] | 7614 | only_with_valgrind |
| 7615 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7616 | requires_config_enabled MBEDTLS_RSA_C |
| 7617 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7618 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7619 | requires_config_enabled MBEDTLS_AES_C |
| 7620 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7621 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 7622 | -p "$P_PXY mtu=508" \ |
| 7623 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7624 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7625 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7626 | hs_timeout=250-10000" \ |
| 7627 | "$P_CLI dtls=1 debug_level=2 \ |
| 7628 | crt_file=data_files/server8_int-ca2.crt \ |
| 7629 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7630 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7631 | hs_timeout=250-10000" \ |
| 7632 | 0 \ |
| 7633 | -s "found fragmented DTLS handshake message" \ |
| 7634 | -c "found fragmented DTLS handshake message" \ |
| 7635 | -C "error" |
| 7636 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7637 | # 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] | 7638 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7639 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7640 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7642 | requires_config_enabled MBEDTLS_RSA_C |
| 7643 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7644 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7645 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7646 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7647 | crt_file=data_files/server7_int-ca.crt \ |
| 7648 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7649 | hs_timeout=10000-60000 \ |
| 7650 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7651 | "$P_CLI dtls=1 debug_level=2 \ |
| 7652 | crt_file=data_files/server8_int-ca2.crt \ |
| 7653 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7654 | hs_timeout=10000-60000 \ |
| 7655 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7656 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7657 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7658 | -s "found fragmented DTLS handshake message" \ |
| 7659 | -c "found fragmented DTLS handshake message" \ |
| 7660 | -C "error" |
| 7661 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7662 | # 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] | 7663 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7664 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7665 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7666 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7667 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7668 | requires_config_enabled MBEDTLS_RSA_C |
| 7669 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7670 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7671 | requires_config_enabled MBEDTLS_AES_C |
| 7672 | requires_config_enabled MBEDTLS_GCM_C |
| 7673 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7674 | -p "$P_PXY mtu=512" \ |
| 7675 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7676 | crt_file=data_files/server7_int-ca.crt \ |
| 7677 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7678 | hs_timeout=10000-60000 \ |
| 7679 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7680 | "$P_CLI dtls=1 debug_level=2 \ |
| 7681 | crt_file=data_files/server8_int-ca2.crt \ |
| 7682 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7683 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7684 | hs_timeout=10000-60000 \ |
| 7685 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7686 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7687 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7688 | -s "found fragmented DTLS handshake message" \ |
| 7689 | -c "found fragmented DTLS handshake message" \ |
| 7690 | -C "error" |
| 7691 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7692 | not_with_valgrind # spurious autoreduction due to timeout |
| 7693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7694 | requires_config_enabled MBEDTLS_RSA_C |
| 7695 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7696 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7697 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7698 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7699 | crt_file=data_files/server7_int-ca.crt \ |
| 7700 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7701 | hs_timeout=10000-60000 \ |
| 7702 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7703 | "$P_CLI dtls=1 debug_level=2 \ |
| 7704 | crt_file=data_files/server8_int-ca2.crt \ |
| 7705 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7706 | hs_timeout=10000-60000 \ |
| 7707 | mtu=1024 nbio=2" \ |
| 7708 | 0 \ |
| 7709 | -S "autoreduction" \ |
| 7710 | -s "found fragmented DTLS handshake message" \ |
| 7711 | -c "found fragmented DTLS handshake message" \ |
| 7712 | -C "error" |
| 7713 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7714 | # 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] | 7715 | not_with_valgrind # spurious autoreduction due to timeout |
| 7716 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7717 | requires_config_enabled MBEDTLS_RSA_C |
| 7718 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7719 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7720 | requires_config_enabled MBEDTLS_AES_C |
| 7721 | requires_config_enabled MBEDTLS_GCM_C |
| 7722 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7723 | -p "$P_PXY mtu=512" \ |
| 7724 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7725 | crt_file=data_files/server7_int-ca.crt \ |
| 7726 | key_file=data_files/server7.key \ |
| 7727 | hs_timeout=10000-60000 \ |
| 7728 | mtu=512 nbio=2" \ |
| 7729 | "$P_CLI dtls=1 debug_level=2 \ |
| 7730 | crt_file=data_files/server8_int-ca2.crt \ |
| 7731 | key_file=data_files/server8.key \ |
| 7732 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7733 | hs_timeout=10000-60000 \ |
| 7734 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7735 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7736 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7737 | -s "found fragmented DTLS handshake message" \ |
| 7738 | -c "found fragmented DTLS handshake message" \ |
| 7739 | -C "error" |
| 7740 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7741 | # 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] | 7742 | # This ensures things still work after session_reset(). |
| 7743 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7744 | # Since we don't support reading fragmented ClientHello yet, |
| 7745 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7746 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7747 | # An autoreduction on the client-side might happen if the server is |
| 7748 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7749 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7750 | # resumed listening, which would result in a spurious autoreduction. |
| 7751 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7753 | requires_config_enabled MBEDTLS_RSA_C |
| 7754 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7755 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7756 | requires_config_enabled MBEDTLS_AES_C |
| 7757 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7758 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7759 | -p "$P_PXY mtu=1450" \ |
| 7760 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7761 | crt_file=data_files/server7_int-ca.crt \ |
| 7762 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7763 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7764 | mtu=1450" \ |
| 7765 | "$P_CLI dtls=1 debug_level=2 \ |
| 7766 | crt_file=data_files/server8_int-ca2.crt \ |
| 7767 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7768 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7769 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7770 | mtu=1450 reconnect=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7771 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7772 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7773 | -s "found fragmented DTLS handshake message" \ |
| 7774 | -c "found fragmented DTLS handshake message" \ |
| 7775 | -C "error" |
| 7776 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7777 | # An autoreduction on the client-side might happen if the server is |
| 7778 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7779 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7780 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7781 | requires_config_enabled MBEDTLS_RSA_C |
| 7782 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7783 | requires_config_enabled MBEDTLS_SHA256_C |
| 7784 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7786 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7787 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7788 | -p "$P_PXY mtu=512" \ |
| 7789 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7790 | crt_file=data_files/server7_int-ca.crt \ |
| 7791 | key_file=data_files/server7.key \ |
| 7792 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7793 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7794 | mtu=512" \ |
| 7795 | "$P_CLI dtls=1 debug_level=2 \ |
| 7796 | crt_file=data_files/server8_int-ca2.crt \ |
| 7797 | key_file=data_files/server8.key \ |
| 7798 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7799 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7800 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7801 | mtu=512" \ |
| 7802 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7803 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7804 | -s "found fragmented DTLS handshake message" \ |
| 7805 | -c "found fragmented DTLS handshake message" \ |
| 7806 | -C "error" |
| 7807 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7808 | # An autoreduction on the client-side might happen if the server is |
| 7809 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7810 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7811 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7812 | requires_config_enabled MBEDTLS_RSA_C |
| 7813 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7814 | requires_config_enabled MBEDTLS_SHA256_C |
| 7815 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7816 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7817 | requires_config_enabled MBEDTLS_AES_C |
| 7818 | requires_config_enabled MBEDTLS_GCM_C |
| 7819 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7820 | -p "$P_PXY mtu=512" \ |
| 7821 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7822 | crt_file=data_files/server7_int-ca.crt \ |
| 7823 | key_file=data_files/server7.key \ |
| 7824 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7825 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7826 | mtu=512" \ |
| 7827 | "$P_CLI dtls=1 debug_level=2 \ |
| 7828 | crt_file=data_files/server8_int-ca2.crt \ |
| 7829 | key_file=data_files/server8.key \ |
| 7830 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7831 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7832 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7833 | mtu=512" \ |
| 7834 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7835 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7836 | -s "found fragmented DTLS handshake message" \ |
| 7837 | -c "found fragmented DTLS handshake message" \ |
| 7838 | -C "error" |
| 7839 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7840 | # An autoreduction on the client-side might happen if the server is |
| 7841 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7842 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7843 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7844 | requires_config_enabled MBEDTLS_RSA_C |
| 7845 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7846 | requires_config_enabled MBEDTLS_SHA256_C |
| 7847 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7848 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7849 | requires_config_enabled MBEDTLS_AES_C |
| 7850 | requires_config_enabled MBEDTLS_CCM_C |
| 7851 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7852 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7853 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7854 | crt_file=data_files/server7_int-ca.crt \ |
| 7855 | key_file=data_files/server7.key \ |
| 7856 | exchanges=2 renegotiation=1 \ |
| 7857 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7858 | hs_timeout=10000-60000 \ |
| 7859 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7860 | "$P_CLI dtls=1 debug_level=2 \ |
| 7861 | crt_file=data_files/server8_int-ca2.crt \ |
| 7862 | key_file=data_files/server8.key \ |
| 7863 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7864 | hs_timeout=10000-60000 \ |
| 7865 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7866 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7867 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7868 | -s "found fragmented DTLS handshake message" \ |
| 7869 | -c "found fragmented DTLS handshake message" \ |
| 7870 | -C "error" |
| 7871 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7872 | # An autoreduction on the client-side might happen if the server is |
| 7873 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7874 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7875 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7876 | requires_config_enabled MBEDTLS_RSA_C |
| 7877 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7878 | requires_config_enabled MBEDTLS_SHA256_C |
| 7879 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7880 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7881 | requires_config_enabled MBEDTLS_AES_C |
| 7882 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7883 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7884 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7885 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7886 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7887 | crt_file=data_files/server7_int-ca.crt \ |
| 7888 | key_file=data_files/server7.key \ |
| 7889 | exchanges=2 renegotiation=1 \ |
| 7890 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7891 | hs_timeout=10000-60000 \ |
| 7892 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7893 | "$P_CLI dtls=1 debug_level=2 \ |
| 7894 | crt_file=data_files/server8_int-ca2.crt \ |
| 7895 | key_file=data_files/server8.key \ |
| 7896 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7897 | hs_timeout=10000-60000 \ |
| 7898 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7899 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7900 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7901 | -s "found fragmented DTLS handshake message" \ |
| 7902 | -c "found fragmented DTLS handshake message" \ |
| 7903 | -C "error" |
| 7904 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7905 | # An autoreduction on the client-side might happen if the server is |
| 7906 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7907 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7908 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7909 | requires_config_enabled MBEDTLS_RSA_C |
| 7910 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7911 | requires_config_enabled MBEDTLS_SHA256_C |
| 7912 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7913 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7914 | requires_config_enabled MBEDTLS_AES_C |
| 7915 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7916 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7917 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7918 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7919 | crt_file=data_files/server7_int-ca.crt \ |
| 7920 | key_file=data_files/server7.key \ |
| 7921 | exchanges=2 renegotiation=1 \ |
| 7922 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7923 | hs_timeout=10000-60000 \ |
| 7924 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7925 | "$P_CLI dtls=1 debug_level=2 \ |
| 7926 | crt_file=data_files/server8_int-ca2.crt \ |
| 7927 | key_file=data_files/server8.key \ |
| 7928 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7929 | hs_timeout=10000-60000 \ |
| 7930 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7931 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7932 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7933 | -s "found fragmented DTLS handshake message" \ |
| 7934 | -c "found fragmented DTLS handshake message" \ |
| 7935 | -C "error" |
| 7936 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7937 | # 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] | 7938 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7939 | requires_config_enabled MBEDTLS_RSA_C |
| 7940 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7941 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7942 | requires_config_enabled MBEDTLS_AES_C |
| 7943 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7944 | client_needs_more_time 2 |
| 7945 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7946 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7947 | "$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] | 7948 | crt_file=data_files/server7_int-ca.crt \ |
| 7949 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7950 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7951 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7952 | crt_file=data_files/server8_int-ca2.crt \ |
| 7953 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7954 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7955 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7956 | 0 \ |
| 7957 | -s "found fragmented DTLS handshake message" \ |
| 7958 | -c "found fragmented DTLS handshake message" \ |
| 7959 | -C "error" |
| 7960 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7961 | # 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] | 7962 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7963 | requires_config_enabled MBEDTLS_RSA_C |
| 7964 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7965 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7966 | requires_config_enabled MBEDTLS_AES_C |
| 7967 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7968 | client_needs_more_time 2 |
| 7969 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7970 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7971 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7972 | crt_file=data_files/server7_int-ca.crt \ |
| 7973 | key_file=data_files/server7.key \ |
| 7974 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7975 | "$P_CLI dtls=1 debug_level=2 \ |
| 7976 | crt_file=data_files/server8_int-ca2.crt \ |
| 7977 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7978 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7979 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7980 | 0 \ |
| 7981 | -s "found fragmented DTLS handshake message" \ |
| 7982 | -c "found fragmented DTLS handshake message" \ |
| 7983 | -C "error" |
| 7984 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7985 | # interop tests for DTLS fragmentating with reliable connection |
| 7986 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7987 | # here and below we just want to test that the we fragment in a way that |
| 7988 | # pleases other implementations, so we don't need the peer to fragment |
| 7989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7990 | requires_config_enabled MBEDTLS_RSA_C |
| 7991 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7993 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7994 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7995 | "$G_SRV -u" \ |
| 7996 | "$P_CLI dtls=1 debug_level=2 \ |
| 7997 | crt_file=data_files/server8_int-ca2.crt \ |
| 7998 | key_file=data_files/server8.key \ |
| 7999 | mtu=512 force_version=dtls1_2" \ |
| 8000 | 0 \ |
| 8001 | -c "fragmenting handshake message" \ |
| 8002 | -C "error" |
| 8003 | |
| 8004 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8005 | requires_config_enabled MBEDTLS_RSA_C |
| 8006 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8007 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8008 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8009 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8010 | "$G_SRV -u" \ |
| 8011 | "$P_CLI dtls=1 debug_level=2 \ |
| 8012 | crt_file=data_files/server8_int-ca2.crt \ |
| 8013 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8014 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8015 | 0 \ |
| 8016 | -c "fragmenting handshake message" \ |
| 8017 | -C "error" |
| 8018 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8019 | # We use --insecure for the GnuTLS client because it expects |
| 8020 | # the hostname / IP it connects to to be the name used in the |
| 8021 | # certificate obtained from the server. Here, however, it |
| 8022 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8023 | # as the server name in the certificate. This will make the |
| 8024 | # certifiate validation fail, but passing --insecure makes |
| 8025 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8026 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8027 | requires_config_enabled MBEDTLS_RSA_C |
| 8028 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8029 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8030 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8031 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8032 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8033 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8034 | crt_file=data_files/server7_int-ca.crt \ |
| 8035 | key_file=data_files/server7.key \ |
| 8036 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8037 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8038 | 0 \ |
| 8039 | -s "fragmenting handshake message" |
| 8040 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8041 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8042 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8043 | requires_config_enabled MBEDTLS_RSA_C |
| 8044 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8045 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8046 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8047 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8048 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8049 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8050 | crt_file=data_files/server7_int-ca.crt \ |
| 8051 | key_file=data_files/server7.key \ |
| 8052 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8053 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8054 | 0 \ |
| 8055 | -s "fragmenting handshake message" |
| 8056 | |
| 8057 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8058 | requires_config_enabled MBEDTLS_RSA_C |
| 8059 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8061 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8062 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8063 | "$P_CLI dtls=1 debug_level=2 \ |
| 8064 | crt_file=data_files/server8_int-ca2.crt \ |
| 8065 | key_file=data_files/server8.key \ |
| 8066 | mtu=512 force_version=dtls1_2" \ |
| 8067 | 0 \ |
| 8068 | -c "fragmenting handshake message" \ |
| 8069 | -C "error" |
| 8070 | |
| 8071 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8072 | requires_config_enabled MBEDTLS_RSA_C |
| 8073 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8074 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8075 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8076 | "$O_SRV -dtls1 -verify 10" \ |
| 8077 | "$P_CLI dtls=1 debug_level=2 \ |
| 8078 | crt_file=data_files/server8_int-ca2.crt \ |
| 8079 | key_file=data_files/server8.key \ |
| 8080 | mtu=512 force_version=dtls1" \ |
| 8081 | 0 \ |
| 8082 | -c "fragmenting handshake message" \ |
| 8083 | -C "error" |
| 8084 | |
| 8085 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8086 | requires_config_enabled MBEDTLS_RSA_C |
| 8087 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8089 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8090 | "$P_SRV dtls=1 debug_level=2 \ |
| 8091 | crt_file=data_files/server7_int-ca.crt \ |
| 8092 | key_file=data_files/server7.key \ |
| 8093 | mtu=512 force_version=dtls1_2" \ |
| 8094 | "$O_CLI -dtls1_2" \ |
| 8095 | 0 \ |
| 8096 | -s "fragmenting handshake message" |
| 8097 | |
| 8098 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8099 | requires_config_enabled MBEDTLS_RSA_C |
| 8100 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8101 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8102 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8103 | "$P_SRV dtls=1 debug_level=2 \ |
| 8104 | crt_file=data_files/server7_int-ca.crt \ |
| 8105 | key_file=data_files/server7.key \ |
| 8106 | mtu=512 force_version=dtls1" \ |
| 8107 | "$O_CLI -dtls1" \ |
| 8108 | 0 \ |
| 8109 | -s "fragmenting handshake message" |
| 8110 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8111 | # interop tests for DTLS fragmentating with unreliable connection |
| 8112 | # |
| 8113 | # again we just want to test that the we fragment in a way that |
| 8114 | # pleases other implementations, so we don't need the peer to fragment |
| 8115 | requires_gnutls_next |
| 8116 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8117 | requires_config_enabled MBEDTLS_RSA_C |
| 8118 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8119 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8120 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8121 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8122 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8123 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8124 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8125 | crt_file=data_files/server8_int-ca2.crt \ |
| 8126 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8127 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8128 | 0 \ |
| 8129 | -c "fragmenting handshake message" \ |
| 8130 | -C "error" |
| 8131 | |
| 8132 | requires_gnutls_next |
| 8133 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8134 | requires_config_enabled MBEDTLS_RSA_C |
| 8135 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8137 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8138 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8139 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8140 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8141 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8142 | crt_file=data_files/server8_int-ca2.crt \ |
| 8143 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8144 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8145 | 0 \ |
| 8146 | -c "fragmenting handshake message" \ |
| 8147 | -C "error" |
| 8148 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8149 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8150 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8151 | requires_config_enabled MBEDTLS_RSA_C |
| 8152 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8153 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8154 | client_needs_more_time 4 |
| 8155 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8156 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8157 | "$P_SRV dtls=1 debug_level=2 \ |
| 8158 | crt_file=data_files/server7_int-ca.crt \ |
| 8159 | key_file=data_files/server7.key \ |
| 8160 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8161 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8162 | 0 \ |
| 8163 | -s "fragmenting handshake message" |
| 8164 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8165 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8167 | requires_config_enabled MBEDTLS_RSA_C |
| 8168 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8169 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8170 | client_needs_more_time 4 |
| 8171 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8172 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8173 | "$P_SRV dtls=1 debug_level=2 \ |
| 8174 | crt_file=data_files/server7_int-ca.crt \ |
| 8175 | key_file=data_files/server7.key \ |
| 8176 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8177 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8178 | 0 \ |
| 8179 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8180 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8181 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8182 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8183 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8184 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8185 | ## (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] | 8186 | skip_next_test |
| 8187 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8188 | requires_config_enabled MBEDTLS_RSA_C |
| 8189 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8191 | client_needs_more_time 4 |
| 8192 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8193 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8194 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8195 | "$P_CLI dtls=1 debug_level=2 \ |
| 8196 | crt_file=data_files/server8_int-ca2.crt \ |
| 8197 | key_file=data_files/server8.key \ |
| 8198 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8199 | 0 \ |
| 8200 | -c "fragmenting handshake message" \ |
| 8201 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8202 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8203 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8204 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8205 | requires_config_enabled MBEDTLS_RSA_C |
| 8206 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8208 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8209 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8210 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8211 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8212 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8213 | crt_file=data_files/server8_int-ca2.crt \ |
| 8214 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8215 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8216 | 0 \ |
| 8217 | -c "fragmenting handshake message" \ |
| 8218 | -C "error" |
| 8219 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8220 | skip_next_test |
| 8221 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8222 | requires_config_enabled MBEDTLS_RSA_C |
| 8223 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8225 | client_needs_more_time 4 |
| 8226 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8227 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8228 | "$P_SRV dtls=1 debug_level=2 \ |
| 8229 | crt_file=data_files/server7_int-ca.crt \ |
| 8230 | key_file=data_files/server7.key \ |
| 8231 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8232 | "$O_CLI -dtls1_2" \ |
| 8233 | 0 \ |
| 8234 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8235 | |
| 8236 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8237 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8238 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8239 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8240 | requires_config_enabled MBEDTLS_RSA_C |
| 8241 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8242 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8243 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8244 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8245 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8246 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8247 | crt_file=data_files/server7_int-ca.crt \ |
| 8248 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8249 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8250 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8251 | 0 \ |
| 8252 | -s "fragmenting handshake message" |
| 8253 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8254 | # Tests for specific things with "unreliable" UDP connection |
| 8255 | |
| 8256 | not_with_valgrind # spurious resend due to timeout |
| 8257 | run_test "DTLS proxy: reference" \ |
| 8258 | -p "$P_PXY" \ |
| 8259 | "$P_SRV dtls=1 debug_level=2" \ |
| 8260 | "$P_CLI dtls=1 debug_level=2" \ |
| 8261 | 0 \ |
| 8262 | -C "replayed record" \ |
| 8263 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8264 | -C "Buffer record from epoch" \ |
| 8265 | -S "Buffer record from epoch" \ |
| 8266 | -C "ssl_buffer_message" \ |
| 8267 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8268 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8269 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8270 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8271 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8272 | -c "HTTP/1.0 200 OK" |
| 8273 | |
| 8274 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8275 | run_test "DTLS proxy: duplicate every packet" \ |
| 8276 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8277 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8278 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8279 | 0 \ |
| 8280 | -c "replayed record" \ |
| 8281 | -s "replayed record" \ |
| 8282 | -c "record from another epoch" \ |
| 8283 | -s "record from another epoch" \ |
| 8284 | -S "resend" \ |
| 8285 | -s "Extra-header:" \ |
| 8286 | -c "HTTP/1.0 200 OK" |
| 8287 | |
| 8288 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8289 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8290 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8291 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8292 | 0 \ |
| 8293 | -c "replayed record" \ |
| 8294 | -S "replayed record" \ |
| 8295 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8296 | -s "record from another epoch" \ |
| 8297 | -c "resend" \ |
| 8298 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8299 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8300 | -c "HTTP/1.0 200 OK" |
| 8301 | |
| 8302 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8303 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8304 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8305 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8306 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8307 | -c "next record in same datagram" \ |
| 8308 | -s "next record in same datagram" |
| 8309 | |
| 8310 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8311 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8312 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8313 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8314 | 0 \ |
| 8315 | -c "next record in same datagram" \ |
| 8316 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8317 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8318 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8319 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8320 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8321 | "$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] | 8322 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8323 | -c "discarding invalid record (mac)" \ |
| 8324 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8325 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8326 | -c "HTTP/1.0 200 OK" \ |
| 8327 | -S "too many records with bad MAC" \ |
| 8328 | -S "Verification of the message MAC failed" |
| 8329 | |
| 8330 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8331 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8332 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8333 | "$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] | 8334 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8335 | -C "discarding invalid record (mac)" \ |
| 8336 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8337 | -S "Extra-header:" \ |
| 8338 | -C "HTTP/1.0 200 OK" \ |
| 8339 | -s "too many records with bad MAC" \ |
| 8340 | -s "Verification of the message MAC failed" |
| 8341 | |
| 8342 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8343 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8344 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8345 | "$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] | 8346 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8347 | -c "discarding invalid record (mac)" \ |
| 8348 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8349 | -s "Extra-header:" \ |
| 8350 | -c "HTTP/1.0 200 OK" \ |
| 8351 | -S "too many records with bad MAC" \ |
| 8352 | -S "Verification of the message MAC failed" |
| 8353 | |
| 8354 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8355 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8356 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8357 | "$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] | 8358 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8359 | -c "discarding invalid record (mac)" \ |
| 8360 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8361 | -s "Extra-header:" \ |
| 8362 | -c "HTTP/1.0 200 OK" \ |
| 8363 | -s "too many records with bad MAC" \ |
| 8364 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8365 | |
| 8366 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8367 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8368 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8369 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8370 | 0 \ |
| 8371 | -c "record from another epoch" \ |
| 8372 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8373 | -s "Extra-header:" \ |
| 8374 | -c "HTTP/1.0 200 OK" |
| 8375 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8376 | # Tests for reordering support with DTLS |
| 8377 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8378 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8379 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8380 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8381 | hs_timeout=2500-60000" \ |
| 8382 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8383 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8384 | 0 \ |
| 8385 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8386 | -c "Next handshake message has been buffered - load"\ |
| 8387 | -S "Buffering HS message" \ |
| 8388 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8389 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8390 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8391 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8392 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8393 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8394 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8395 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8396 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8397 | hs_timeout=2500-60000" \ |
| 8398 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8399 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8400 | 0 \ |
| 8401 | -c "Buffering HS message" \ |
| 8402 | -c "found fragmented DTLS handshake message"\ |
| 8403 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8404 | -c "Next handshake message has been buffered - load"\ |
| 8405 | -S "Buffering HS message" \ |
| 8406 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8407 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8408 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8409 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8410 | -S "Remember CCS message" |
| 8411 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8412 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8413 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8414 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8415 | # while keeping the ServerKeyExchange. |
| 8416 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8417 | 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] | 8418 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8419 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8420 | hs_timeout=2500-60000" \ |
| 8421 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8422 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8423 | 0 \ |
| 8424 | -c "Buffering HS message" \ |
| 8425 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8426 | -C "attempt to make space by freeing buffered messages" \ |
| 8427 | -S "Buffering HS message" \ |
| 8428 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8429 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8430 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8431 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8432 | -S "Remember CCS message" |
| 8433 | |
| 8434 | # The size constraints ensure that the delayed certificate message can't |
| 8435 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8436 | # when dropping it first. |
| 8437 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8438 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8439 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8440 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8441 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8442 | hs_timeout=2500-60000" \ |
| 8443 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8444 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8445 | 0 \ |
| 8446 | -c "Buffering HS message" \ |
| 8447 | -c "attempt to make space by freeing buffered future messages" \ |
| 8448 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8449 | -S "Buffering HS message" \ |
| 8450 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8451 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8452 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8453 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8454 | -S "Remember CCS message" |
| 8455 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8456 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8457 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8458 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8459 | hs_timeout=2500-60000" \ |
| 8460 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8461 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8462 | 0 \ |
| 8463 | -C "Buffering HS message" \ |
| 8464 | -C "Next handshake message has been buffered - load"\ |
| 8465 | -s "Buffering HS message" \ |
| 8466 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8467 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8468 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8469 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8470 | -S "Remember CCS message" |
| 8471 | |
| 8472 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8473 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8474 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8475 | hs_timeout=2500-60000" \ |
| 8476 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8477 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8478 | 0 \ |
| 8479 | -C "Buffering HS message" \ |
| 8480 | -C "Next handshake message has been buffered - load"\ |
| 8481 | -S "Buffering HS message" \ |
| 8482 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8483 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8484 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8485 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8486 | -S "Remember CCS message" |
| 8487 | |
| 8488 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8489 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8490 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8491 | hs_timeout=2500-60000" \ |
| 8492 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8493 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8494 | 0 \ |
| 8495 | -C "Buffering HS message" \ |
| 8496 | -C "Next handshake message has been buffered - load"\ |
| 8497 | -S "Buffering HS message" \ |
| 8498 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8499 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8500 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8501 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8502 | -s "Remember CCS message" |
| 8503 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8504 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8505 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8506 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8507 | hs_timeout=2500-60000" \ |
| 8508 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8509 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8510 | 0 \ |
| 8511 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8512 | -s "Found buffered record from current epoch - load" \ |
| 8513 | -c "Buffer record from epoch 1" \ |
| 8514 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8515 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8516 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8517 | # from the server are delayed, so that the encrypted Finished message |
| 8518 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8519 | # in afterwards, the encrypted Finished message must be freed in order |
| 8520 | # to make space for the NewSessionTicket to be reassembled. |
| 8521 | # This works only in very particular circumstances: |
| 8522 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8523 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8524 | # the encrypted Finished message. |
| 8525 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8526 | # needs to be fragmented. |
| 8527 | # - All messages sent by the server must be small enough to be either sent |
| 8528 | # without fragmentation or be reassembled within the bounds of |
| 8529 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8530 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8531 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8532 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8533 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8534 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8535 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8536 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8537 | 0 \ |
| 8538 | -s "Buffer record from epoch 1" \ |
| 8539 | -s "Found buffered record from current epoch - load" \ |
| 8540 | -c "Buffer record from epoch 1" \ |
| 8541 | -C "Found buffered record from current epoch - load" \ |
| 8542 | -c "Enough space available after freeing future epoch record" |
| 8543 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8544 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8545 | |
| 8546 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8547 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8548 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8549 | "$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] | 8550 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8551 | "$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] | 8552 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8553 | 0 \ |
| 8554 | -s "Extra-header:" \ |
| 8555 | -c "HTTP/1.0 200 OK" |
| 8556 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8557 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8558 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8559 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8560 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8561 | "$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] | 8562 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8563 | 0 \ |
| 8564 | -s "Extra-header:" \ |
| 8565 | -c "HTTP/1.0 200 OK" |
| 8566 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8567 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8568 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8569 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8570 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8571 | "$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] | 8572 | 0 \ |
| 8573 | -s "Extra-header:" \ |
| 8574 | -c "HTTP/1.0 200 OK" |
| 8575 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8576 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8577 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8578 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8579 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8580 | "$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] | 8581 | 0 \ |
| 8582 | -s "Extra-header:" \ |
| 8583 | -c "HTTP/1.0 200 OK" |
| 8584 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8585 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8586 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8587 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8588 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8589 | "$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] | 8590 | 0 \ |
| 8591 | -s "Extra-header:" \ |
| 8592 | -c "HTTP/1.0 200 OK" |
| 8593 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8594 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8595 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8596 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8597 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8598 | "$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] | 8599 | 0 \ |
| 8600 | -s "Extra-header:" \ |
| 8601 | -c "HTTP/1.0 200 OK" |
| 8602 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8603 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8604 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8605 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8606 | "$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] | 8607 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8608 | "$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] | 8609 | 0 \ |
| 8610 | -s "Extra-header:" \ |
| 8611 | -c "HTTP/1.0 200 OK" |
| 8612 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8613 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8614 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8615 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8616 | "$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] | 8617 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8618 | "$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] | 8619 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8620 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8621 | 0 \ |
| 8622 | -s "a session has been resumed" \ |
| 8623 | -c "a session has been resumed" \ |
| 8624 | -s "Extra-header:" \ |
| 8625 | -c "HTTP/1.0 200 OK" |
| 8626 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8627 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8628 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8629 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8630 | "$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] | 8631 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8632 | "$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] | 8633 | debug_level=3 reconnect=1 read_timeout=1000 max_resend=10 \ |
| 8634 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8635 | 0 \ |
| 8636 | -s "a session has been resumed" \ |
| 8637 | -c "a session has been resumed" \ |
| 8638 | -s "Extra-header:" \ |
| 8639 | -c "HTTP/1.0 200 OK" |
| 8640 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8641 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8642 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8643 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8644 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8645 | "$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] | 8646 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8647 | "$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] | 8648 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8649 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8650 | 0 \ |
| 8651 | -c "=> renegotiate" \ |
| 8652 | -s "=> renegotiate" \ |
| 8653 | -s "Extra-header:" \ |
| 8654 | -c "HTTP/1.0 200 OK" |
| 8655 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8656 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8657 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8658 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8659 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8660 | "$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] | 8661 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8662 | "$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] | 8663 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8664 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8665 | 0 \ |
| 8666 | -c "=> renegotiate" \ |
| 8667 | -s "=> renegotiate" \ |
| 8668 | -s "Extra-header:" \ |
| 8669 | -c "HTTP/1.0 200 OK" |
| 8670 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8671 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8673 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8674 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8675 | "$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] | 8676 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8677 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8678 | "$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] | 8679 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8680 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8681 | 0 \ |
| 8682 | -c "=> renegotiate" \ |
| 8683 | -s "=> renegotiate" \ |
| 8684 | -s "Extra-header:" \ |
| 8685 | -c "HTTP/1.0 200 OK" |
| 8686 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8687 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8688 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8689 | 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] | 8690 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8691 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8692 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8693 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8694 | "$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] | 8695 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8696 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8697 | 0 \ |
| 8698 | -c "=> renegotiate" \ |
| 8699 | -s "=> renegotiate" \ |
| 8700 | -s "Extra-header:" \ |
| 8701 | -c "HTTP/1.0 200 OK" |
| 8702 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8703 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8704 | ## all versions installed on the CI machines), reported here: |
| 8705 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8706 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8707 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8708 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8709 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8710 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8711 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8712 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8713 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8714 | "$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] | 8715 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8716 | -c "HTTP/1.0 200 OK" |
| 8717 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8718 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8719 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8720 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8721 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8722 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8723 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8724 | "$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] | 8725 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8726 | -c "HTTP/1.0 200 OK" |
| 8727 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8728 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8729 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8730 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8731 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8732 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8733 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8734 | "$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] | 8735 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8736 | -c "HTTP/1.0 200 OK" |
| 8737 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8738 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8739 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8740 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8741 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8742 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8743 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8744 | "$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] | 8745 | 0 \ |
| 8746 | -s "Extra-header:" \ |
| 8747 | -c "Extra-header:" |
| 8748 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8749 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8750 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8751 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8752 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8753 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8754 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8755 | "$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] | 8756 | 0 \ |
| 8757 | -s "Extra-header:" \ |
| 8758 | -c "Extra-header:" |
| 8759 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8760 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8761 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8762 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8763 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8764 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8765 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8766 | "$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] | 8767 | 0 \ |
| 8768 | -s "Extra-header:" \ |
| 8769 | -c "Extra-header:" |
| 8770 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8771 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8772 | run_test "export keys functionality" \ |
| 8773 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8774 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8775 | 0 \ |
| 8776 | -s "exported maclen is " \ |
| 8777 | -s "exported keylen is " \ |
| 8778 | -s "exported ivlen is " \ |
| 8779 | -c "exported maclen is " \ |
| 8780 | -c "exported keylen is " \ |
| 8781 | -c "exported ivlen is " |
| 8782 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8783 | # Final report |
| 8784 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8785 | echo "------------------------------------------------------------------------" |
| 8786 | |
| 8787 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8788 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8789 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8790 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8791 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8792 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8793 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8794 | |
| 8795 | exit $FAILS |