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 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
| 20 | # This file is part of Mbed TLS (https://tls.mbed.org) |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 21 | # |
| 22 | # Purpose |
| 23 | # |
| 24 | # Executes tests to prove various TLS/SSL options and extensions. |
| 25 | # |
| 26 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 27 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 28 | # (session resumption from cache or ticket, renego, etc). |
| 29 | # |
| 30 | # The tests assume a build with default options, with exceptions expressed |
| 31 | # with a dependency. The tests focus on functionality and do not consider |
| 32 | # performance. |
| 33 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 34 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 35 | set -u |
| 36 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 37 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 38 | # where it may output seemingly unlimited length error logs. |
| 39 | ulimit -f 20971520 |
| 40 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 41 | ORIGINAL_PWD=$PWD |
| 42 | if ! cd "$(dirname "$0")"; then |
| 43 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 44 | fi |
| 45 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 46 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 47 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 48 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 49 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 50 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 51 | : ${GNUTLS_CLI:=gnutls-cli} |
| 52 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 53 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 54 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | guess_config_name() { |
| 56 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 57 | echo "default" |
| 58 | else |
| 59 | echo "unknown" |
| 60 | fi |
| 61 | } |
| 62 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 63 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 64 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 65 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 66 | 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] | 67 | 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] | 68 | 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] | 69 | 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] | 70 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 71 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 72 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 73 | |
| 74 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 75 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 76 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 77 | else |
| 78 | O_LEGACY_SRV=false |
| 79 | O_LEGACY_CLI=false |
| 80 | fi |
| 81 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 82 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 83 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 84 | else |
| 85 | G_NEXT_SRV=false |
| 86 | fi |
| 87 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 88 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 89 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 90 | else |
| 91 | G_NEXT_CLI=false |
| 92 | fi |
| 93 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 94 | TESTS=0 |
| 95 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 96 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 97 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 98 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 99 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 100 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 101 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 102 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 103 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 104 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 105 | RUN_TEST_NUMBER='' |
| 106 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 107 | PRESERVE_LOGS=0 |
| 108 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 109 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 110 | # port which is this plus 10000. Each port number may be independently |
| 111 | # overridden by a command line option. |
| 112 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 113 | PXY_PORT=$((SRV_PORT + 10000)) |
| 114 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 115 | print_usage() { |
| 116 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 117 | printf " -h|--help\tPrint this help.\n" |
| 118 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 119 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 120 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 121 | 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] | 122 | 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] | 123 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 124 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 125 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 126 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 127 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 128 | 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] | 129 | } |
| 130 | |
| 131 | get_options() { |
| 132 | while [ $# -gt 0 ]; do |
| 133 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 134 | -f|--filter) |
| 135 | shift; FILTER=$1 |
| 136 | ;; |
| 137 | -e|--exclude) |
| 138 | shift; EXCLUDE=$1 |
| 139 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | -m|--memcheck) |
| 141 | MEMCHECK=1 |
| 142 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | -n|--number) |
| 144 | shift; RUN_TEST_NUMBER=$1 |
| 145 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 146 | -s|--show-numbers) |
| 147 | SHOW_TEST_NUMBER=1 |
| 148 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 149 | -p|--preserve-logs) |
| 150 | PRESERVE_LOGS=1 |
| 151 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 152 | --port) |
| 153 | shift; SRV_PORT=$1 |
| 154 | ;; |
| 155 | --proxy-port) |
| 156 | shift; PXY_PORT=$1 |
| 157 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 158 | --seed) |
| 159 | shift; SEED="$1" |
| 160 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 161 | -h|--help) |
| 162 | print_usage |
| 163 | exit 0 |
| 164 | ;; |
| 165 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 166 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 167 | print_usage |
| 168 | exit 1 |
| 169 | ;; |
| 170 | esac |
| 171 | shift |
| 172 | done |
| 173 | } |
| 174 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 175 | # Make the outcome file path relative to the original directory, not |
| 176 | # to .../tests |
| 177 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 178 | [!/]*) |
| 179 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 180 | ;; |
| 181 | esac |
| 182 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 183 | # Skip next test; use this macro to skip tests which are legitimate |
| 184 | # in theory and expected to be re-introduced at some point, but |
| 185 | # aren't expected to succeed at the moment due to problems outside |
| 186 | # our control (such as bugs in other TLS implementations). |
| 187 | skip_next_test() { |
| 188 | SKIP_NEXT="YES" |
| 189 | } |
| 190 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 191 | # skip next test if the flag is not enabled in config.h |
| 192 | requires_config_enabled() { |
| 193 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 194 | SKIP_NEXT="YES" |
| 195 | fi |
| 196 | } |
| 197 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 198 | # skip next test if the flag is enabled in config.h |
| 199 | requires_config_disabled() { |
| 200 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 201 | SKIP_NEXT="YES" |
| 202 | fi |
| 203 | } |
| 204 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 205 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 206 | # This function uses the query_config command line option to query the |
| 207 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 208 | # program. The command will always return a success value if the |
| 209 | # configuration is defined and the value will be printed to stdout. |
| 210 | # |
| 211 | # Note that if the configuration is not defined or is defined to nothing, |
| 212 | # the output of this function will be an empty string. |
| 213 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 217 | VAL="$( get_config_value_or_default "$1" )" |
| 218 | if [ -z "$VAL" ]; then |
| 219 | # Should never happen |
| 220 | echo "Mbed TLS configuration $1 is not defined" |
| 221 | exit 1 |
| 222 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 223 | SKIP_NEXT="YES" |
| 224 | fi |
| 225 | } |
| 226 | |
| 227 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 228 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 229 | if [ -z "$VAL" ]; then |
| 230 | # Should never happen |
| 231 | echo "Mbed TLS configuration $1 is not defined" |
| 232 | exit 1 |
| 233 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 234 | SKIP_NEXT="YES" |
| 235 | fi |
| 236 | } |
| 237 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 238 | requires_ciphersuite_enabled() { |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 239 | if [ -z "$($P_CLI --help 2>/dev/null | grep $1)" ]; then |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 244 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 245 | # If CMD (call to a TLS client or server program) requires a specific |
| 246 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 247 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 248 | # mismatch. |
| 249 | maybe_requires_ciphersuite_enabled() { |
| 250 | case "$1" in |
| 251 | *\ force_ciphersuite=*) :;; |
| 252 | *) return;; # No specific required ciphersuite |
| 253 | esac |
| 254 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 255 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 256 | shift |
| 257 | |
| 258 | case "$*" in |
| 259 | *"-s SSL - The server has no ciphersuites in common"*) |
| 260 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 261 | # require the ciphersuite to be enabled. |
| 262 | ;; |
| 263 | *) |
| 264 | requires_ciphersuite_enabled "$ciphersuite" |
| 265 | ;; |
| 266 | esac |
| 267 | |
| 268 | unset ciphersuite |
| 269 | } |
| 270 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 271 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 272 | requires_openssl_with_fallback_scsv() { |
| 273 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 274 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 275 | then |
| 276 | OPENSSL_HAS_FBSCSV="YES" |
| 277 | else |
| 278 | OPENSSL_HAS_FBSCSV="NO" |
| 279 | fi |
| 280 | fi |
| 281 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 282 | SKIP_NEXT="YES" |
| 283 | fi |
| 284 | } |
| 285 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 286 | # skip next test if GnuTLS isn't available |
| 287 | requires_gnutls() { |
| 288 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 289 | 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] | 290 | GNUTLS_AVAILABLE="YES" |
| 291 | else |
| 292 | GNUTLS_AVAILABLE="NO" |
| 293 | fi |
| 294 | fi |
| 295 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 296 | SKIP_NEXT="YES" |
| 297 | fi |
| 298 | } |
| 299 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 300 | # skip next test if GnuTLS-next isn't available |
| 301 | requires_gnutls_next() { |
| 302 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 303 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 304 | GNUTLS_NEXT_AVAILABLE="YES" |
| 305 | else |
| 306 | GNUTLS_NEXT_AVAILABLE="NO" |
| 307 | fi |
| 308 | fi |
| 309 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 310 | SKIP_NEXT="YES" |
| 311 | fi |
| 312 | } |
| 313 | |
| 314 | # skip next test if OpenSSL-legacy isn't available |
| 315 | requires_openssl_legacy() { |
| 316 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 317 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 318 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 319 | else |
| 320 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 321 | fi |
| 322 | fi |
| 323 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 324 | SKIP_NEXT="YES" |
| 325 | fi |
| 326 | } |
| 327 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 328 | # skip next test if IPv6 isn't available on this host |
| 329 | requires_ipv6() { |
| 330 | if [ -z "${HAS_IPV6:-}" ]; then |
| 331 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 332 | SRV_PID=$! |
| 333 | sleep 1 |
| 334 | kill $SRV_PID >/dev/null 2>&1 |
| 335 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 336 | HAS_IPV6="NO" |
| 337 | else |
| 338 | HAS_IPV6="YES" |
| 339 | fi |
| 340 | rm -r $SRV_OUT |
| 341 | fi |
| 342 | |
| 343 | if [ "$HAS_IPV6" = "NO" ]; then |
| 344 | SKIP_NEXT="YES" |
| 345 | fi |
| 346 | } |
| 347 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 348 | # skip next test if it's i686 or uname is not available |
| 349 | requires_not_i686() { |
| 350 | if [ -z "${IS_I686:-}" ]; then |
| 351 | IS_I686="YES" |
| 352 | if which "uname" >/dev/null 2>&1; then |
| 353 | if [ -z "$(uname -a | grep i686)" ]; then |
| 354 | IS_I686="NO" |
| 355 | fi |
| 356 | fi |
| 357 | fi |
| 358 | if [ "$IS_I686" = "YES" ]; then |
| 359 | SKIP_NEXT="YES" |
| 360 | fi |
| 361 | } |
| 362 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 363 | # Calculate the input & output maximum content lengths set in the config |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 364 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 365 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 366 | 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] | 367 | |
| 368 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 369 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 370 | fi |
| 371 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 372 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 373 | fi |
| 374 | |
| 375 | # skip the next test if the SSL output buffer is less than 16KB |
| 376 | requires_full_size_output_buffer() { |
| 377 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 378 | SKIP_NEXT="YES" |
| 379 | fi |
| 380 | } |
| 381 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 382 | # skip the next test if valgrind is in use |
| 383 | not_with_valgrind() { |
| 384 | if [ "$MEMCHECK" -gt 0 ]; then |
| 385 | SKIP_NEXT="YES" |
| 386 | fi |
| 387 | } |
| 388 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 389 | # skip the next test if valgrind is NOT in use |
| 390 | only_with_valgrind() { |
| 391 | if [ "$MEMCHECK" -eq 0 ]; then |
| 392 | SKIP_NEXT="YES" |
| 393 | fi |
| 394 | } |
| 395 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 396 | # 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] | 397 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 398 | CLI_DELAY_FACTOR=$1 |
| 399 | } |
| 400 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 401 | # wait for the given seconds after the client finished in the next test |
| 402 | server_needs_more_time() { |
| 403 | SRV_DELAY_SECONDS=$1 |
| 404 | } |
| 405 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 406 | # print_name <name> |
| 407 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 408 | TESTS=$(( $TESTS + 1 )) |
| 409 | LINE="" |
| 410 | |
| 411 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 412 | LINE="$TESTS " |
| 413 | fi |
| 414 | |
| 415 | LINE="$LINE$1" |
| 416 | printf "$LINE " |
| 417 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 418 | for i in `seq 1 $LEN`; do printf '.'; done |
| 419 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 420 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 421 | } |
| 422 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 423 | # record_outcome <outcome> [<failure-reason>] |
| 424 | # The test name must be in $NAME. |
| 425 | record_outcome() { |
| 426 | echo "$1" |
| 427 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 428 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 429 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 430 | "ssl-opt" "$NAME" \ |
| 431 | "$1" "${2-}" \ |
| 432 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 433 | fi |
| 434 | } |
| 435 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 436 | # fail <message> |
| 437 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 438 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 439 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 440 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 441 | mv $SRV_OUT o-srv-${TESTS}.log |
| 442 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 443 | if [ -n "$PXY_CMD" ]; then |
| 444 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 445 | fi |
| 446 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 447 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 448 | 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] | 449 | echo " ! server output:" |
| 450 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 451 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 452 | echo " ! client output:" |
| 453 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 454 | if [ -n "$PXY_CMD" ]; then |
| 455 | echo " ! ========================================================" |
| 456 | echo " ! proxy output:" |
| 457 | cat o-pxy-${TESTS}.log |
| 458 | fi |
| 459 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 460 | fi |
| 461 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 462 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 463 | } |
| 464 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 465 | # is_polar <cmd_line> |
| 466 | is_polar() { |
| 467 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 468 | } |
| 469 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 470 | # openssl s_server doesn't have -www with DTLS |
| 471 | check_osrv_dtls() { |
| 472 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 473 | NEEDS_INPUT=1 |
| 474 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 475 | else |
| 476 | NEEDS_INPUT=0 |
| 477 | fi |
| 478 | } |
| 479 | |
| 480 | # provide input to commands that need it |
| 481 | provide_input() { |
| 482 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 483 | return |
| 484 | fi |
| 485 | |
| 486 | while true; do |
| 487 | echo "HTTP/1.0 200 OK" |
| 488 | sleep 1 |
| 489 | done |
| 490 | } |
| 491 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 492 | # has_mem_err <log_file_name> |
| 493 | has_mem_err() { |
| 494 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 495 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 496 | then |
| 497 | return 1 # false: does not have errors |
| 498 | else |
| 499 | return 0 # true: has errors |
| 500 | fi |
| 501 | } |
| 502 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 503 | # 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] | 504 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 505 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 506 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 507 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 508 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 509 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 510 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 511 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 512 | # Make a tight loop, server normally takes less than 1s to start. |
| 513 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 514 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 515 | echo "$3 START TIMEOUT" |
| 516 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 517 | break |
| 518 | fi |
| 519 | # Linux and *BSD support decimal arguments to sleep. On other |
| 520 | # OSes this may be a tight loop. |
| 521 | sleep 0.1 2>/dev/null || true |
| 522 | done |
| 523 | } |
| 524 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 525 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 526 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 527 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 528 | } |
| 529 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 530 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 531 | # Wait for server process $2 to be listening on port $1. |
| 532 | wait_server_start() { |
| 533 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 534 | } |
| 535 | |
| 536 | # Wait for proxy process $2 to be listening on port $1. |
| 537 | wait_proxy_start() { |
| 538 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 539 | } |
| 540 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 541 | # 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] | 542 | # 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] | 543 | # acceptable bounds |
| 544 | check_server_hello_time() { |
| 545 | # 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] | 546 | 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] | 547 | # Get the Unix timestamp for now |
| 548 | CUR_TIME=$(date +'%s') |
| 549 | THRESHOLD_IN_SECS=300 |
| 550 | |
| 551 | # Check if the ServerHello time was printed |
| 552 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 553 | return 1 |
| 554 | fi |
| 555 | |
| 556 | # Check the time in ServerHello is within acceptable bounds |
| 557 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 558 | # The time in ServerHello is at least 5 minutes before now |
| 559 | return 1 |
| 560 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 561 | # 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] | 562 | return 1 |
| 563 | else |
| 564 | return 0 |
| 565 | fi |
| 566 | } |
| 567 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 568 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 569 | handshake_memory_get() { |
| 570 | OUTPUT_VARIABLE="$1" |
| 571 | OUTPUT_FILE="$2" |
| 572 | |
| 573 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 574 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 575 | |
| 576 | # Check if memory usage was read |
| 577 | if [ -z "$MEM_USAGE" ]; then |
| 578 | echo "Error: Can not read the value of handshake memory usage" |
| 579 | return 1 |
| 580 | else |
| 581 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 582 | return 0 |
| 583 | fi |
| 584 | } |
| 585 | |
| 586 | # Get handshake memory usage from server or client output and check if this value |
| 587 | # is not higher than the maximum given by the first argument |
| 588 | handshake_memory_check() { |
| 589 | MAX_MEMORY="$1" |
| 590 | OUTPUT_FILE="$2" |
| 591 | |
| 592 | # Get memory usage |
| 593 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 594 | return 1 |
| 595 | fi |
| 596 | |
| 597 | # Check if memory usage is below max value |
| 598 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 599 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 600 | "but should be below $MAX_MEMORY bytes" |
| 601 | return 1 |
| 602 | else |
| 603 | return 0 |
| 604 | fi |
| 605 | } |
| 606 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 607 | # wait for client to terminate and set CLI_EXIT |
| 608 | # must be called right after starting the client |
| 609 | wait_client_done() { |
| 610 | CLI_PID=$! |
| 611 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 612 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 613 | CLI_DELAY_FACTOR=1 |
| 614 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 615 | ( 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] | 616 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 617 | |
| 618 | wait $CLI_PID |
| 619 | CLI_EXIT=$? |
| 620 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 621 | kill $DOG_PID >/dev/null 2>&1 |
| 622 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 623 | |
| 624 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 625 | |
| 626 | sleep $SRV_DELAY_SECONDS |
| 627 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 628 | } |
| 629 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 630 | # check if the given command uses dtls and sets global variable DTLS |
| 631 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 632 | 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] | 633 | DTLS=1 |
| 634 | else |
| 635 | DTLS=0 |
| 636 | fi |
| 637 | } |
| 638 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 639 | # 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] | 640 | # Options: -s pattern pattern that must be present in server output |
| 641 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 642 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 643 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 644 | # -S pattern pattern that must be absent in server output |
| 645 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 646 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 647 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 648 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 649 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 650 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 651 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 652 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 653 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 654 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 655 | # There was no request to run the test, so don't record its outcome. |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 656 | return |
| 657 | fi |
| 658 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 659 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 661 | # Do we only run numbered tests? |
| 662 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 663 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 664 | else |
| 665 | SKIP_NEXT="YES" |
| 666 | fi |
| 667 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 668 | # does this test use a proxy? |
| 669 | if [ "X$1" = "X-p" ]; then |
| 670 | PXY_CMD="$2" |
| 671 | shift 2 |
| 672 | else |
| 673 | PXY_CMD="" |
| 674 | fi |
| 675 | |
| 676 | # get commands and client output |
| 677 | SRV_CMD="$1" |
| 678 | CLI_CMD="$2" |
| 679 | CLI_EXPECT="$3" |
| 680 | shift 3 |
| 681 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 682 | # Check if test uses files |
| 683 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 684 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 685 | requires_config_enabled MBEDTLS_FS_IO |
| 686 | fi |
| 687 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 688 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 689 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 690 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 691 | |
| 692 | # should we skip? |
| 693 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 694 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 695 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 696 | SKIPS=$(( $SKIPS + 1 )) |
| 697 | return |
| 698 | fi |
| 699 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 700 | # fix client port |
| 701 | if [ -n "$PXY_CMD" ]; then |
| 702 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 703 | else |
| 704 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 705 | fi |
| 706 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 707 | # update DTLS variable |
| 708 | detect_dtls "$SRV_CMD" |
| 709 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 710 | # prepend valgrind to our commands if active |
| 711 | if [ "$MEMCHECK" -gt 0 ]; then |
| 712 | if is_polar "$SRV_CMD"; then |
| 713 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 714 | fi |
| 715 | if is_polar "$CLI_CMD"; then |
| 716 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 717 | fi |
| 718 | fi |
| 719 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 720 | TIMES_LEFT=2 |
| 721 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 722 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 723 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 724 | # run the commands |
| 725 | if [ -n "$PXY_CMD" ]; then |
| 726 | echo "$PXY_CMD" > $PXY_OUT |
| 727 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 728 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 729 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 730 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 731 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 732 | check_osrv_dtls |
| 733 | echo "$SRV_CMD" > $SRV_OUT |
| 734 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 735 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 736 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 737 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 738 | echo "$CLI_CMD" > $CLI_OUT |
| 739 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 740 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 741 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 742 | sleep 0.05 |
| 743 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 744 | # terminate the server (and the proxy) |
| 745 | kill $SRV_PID |
| 746 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 747 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 748 | if [ -n "$PXY_CMD" ]; then |
| 749 | kill $PXY_PID >/dev/null 2>&1 |
| 750 | wait $PXY_PID |
| 751 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 752 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 753 | # retry only on timeouts |
| 754 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 755 | printf "RETRY " |
| 756 | else |
| 757 | TIMES_LEFT=0 |
| 758 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 759 | done |
| 760 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 761 | # 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] | 762 | # (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] | 763 | # expected client exit to incorrectly succeed in case of catastrophic |
| 764 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 765 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 766 | 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] | 767 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 768 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 769 | return |
| 770 | fi |
| 771 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 772 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 773 | 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] | 774 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 775 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 776 | return |
| 777 | fi |
| 778 | fi |
| 779 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 780 | # check server exit code |
| 781 | if [ $? != 0 ]; then |
| 782 | fail "server fail" |
| 783 | return |
| 784 | fi |
| 785 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 786 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 787 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 788 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 789 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 790 | 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] | 791 | return |
| 792 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 793 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 794 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 795 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 796 | # 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] | 797 | while [ $# -gt 0 ] |
| 798 | do |
| 799 | case $1 in |
| 800 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 801 | 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] | 802 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 803 | return |
| 804 | fi |
| 805 | ;; |
| 806 | |
| 807 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 808 | 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] | 809 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 810 | return |
| 811 | fi |
| 812 | ;; |
| 813 | |
| 814 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 815 | 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] | 816 | 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] | 817 | return |
| 818 | fi |
| 819 | ;; |
| 820 | |
| 821 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 822 | 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] | 823 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 824 | return |
| 825 | fi |
| 826 | ;; |
| 827 | |
| 828 | # The filtering in the following two options (-u and -U) do the following |
| 829 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 830 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 831 | # - keep one of each non-unique line |
| 832 | # - count how many lines remain |
| 833 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 834 | # if there were no duplicates. |
| 835 | "-U") |
| 836 | 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 |
| 837 | fail "lines following pattern '$2' must be unique in Server output" |
| 838 | return |
| 839 | fi |
| 840 | ;; |
| 841 | |
| 842 | "-u") |
| 843 | 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 |
| 844 | 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] | 845 | return |
| 846 | fi |
| 847 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 848 | "-F") |
| 849 | if ! $2 "$SRV_OUT"; then |
| 850 | fail "function call to '$2' failed on Server output" |
| 851 | return |
| 852 | fi |
| 853 | ;; |
| 854 | "-f") |
| 855 | if ! $2 "$CLI_OUT"; then |
| 856 | fail "function call to '$2' failed on Client output" |
| 857 | return |
| 858 | fi |
| 859 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 860 | |
| 861 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 862 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 863 | exit 1 |
| 864 | esac |
| 865 | shift 2 |
| 866 | done |
| 867 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 868 | # check valgrind's results |
| 869 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 870 | 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] | 871 | fail "Server has memory errors" |
| 872 | return |
| 873 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 874 | 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] | 875 | fail "Client has memory errors" |
| 876 | return |
| 877 | fi |
| 878 | fi |
| 879 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 880 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 881 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 882 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 883 | mv $SRV_OUT o-srv-${TESTS}.log |
| 884 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 885 | if [ -n "$PXY_CMD" ]; then |
| 886 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 887 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 888 | fi |
| 889 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 890 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 891 | } |
| 892 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 893 | run_test_psa() { |
| 894 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 895 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 896 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 897 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 898 | 0 \ |
| 899 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 900 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 901 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 902 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 903 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 904 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 905 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 906 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 907 | -C "Failed to setup PSA-based cipher context"\ |
| 908 | -S "Failed to setup PSA-based cipher context"\ |
| 909 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 910 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 911 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 912 | -S "error" \ |
| 913 | -C "error" |
| 914 | } |
| 915 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 916 | run_test_psa_force_curve() { |
| 917 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 918 | run_test "PSA - ECDH with $1" \ |
| 919 | "$P_SRV debug_level=4 force_version=tls1_2" \ |
| 920 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 921 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 922 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 923 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 924 | -c "PSA calc verify" \ |
| 925 | -c "calc PSA finished" \ |
| 926 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 927 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 928 | -s "PSA calc verify" \ |
| 929 | -s "calc PSA finished" \ |
| 930 | -C "Failed to setup PSA-based cipher context"\ |
| 931 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 932 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 933 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 934 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 935 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 936 | -C "error" |
| 937 | } |
| 938 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 939 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 940 | # a maximum fragment length. |
| 941 | # first argument ($1) is MFL for SSL client |
| 942 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 943 | run_test_memory_after_hanshake_with_mfl() |
| 944 | { |
| 945 | # The test passes if the difference is around 2*(16k-MFL) |
| 946 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
| 947 | |
| 948 | # Leave some margin for robustness |
| 949 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 950 | |
| 951 | run_test "Handshake memory usage (MFL $1)" \ |
| 952 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 953 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 954 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 955 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 956 | 0 \ |
| 957 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 958 | } |
| 959 | |
| 960 | |
| 961 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 962 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 963 | run_tests_memory_after_hanshake() |
| 964 | { |
| 965 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 966 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 967 | |
| 968 | # first test with default MFU is to get reference memory usage |
| 969 | MEMORY_USAGE_MFL_16K=0 |
| 970 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 971 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 972 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 973 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 974 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 975 | 0 \ |
| 976 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 977 | |
| 978 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 979 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 980 | |
| 981 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 982 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 983 | |
| 984 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 985 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 986 | |
| 987 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 988 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 989 | } |
| 990 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 991 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 992 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 993 | rm -f context_srv.txt |
| 994 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 995 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 996 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 997 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 998 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 999 | exit 1 |
| 1000 | } |
| 1001 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1002 | # |
| 1003 | # MAIN |
| 1004 | # |
| 1005 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1006 | get_options "$@" |
| 1007 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1008 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1009 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1010 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1011 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1012 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1013 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1014 | exit 1 |
| 1015 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1016 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1017 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1018 | exit 1 |
| 1019 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1020 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1021 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1022 | exit 1 |
| 1023 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1024 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1025 | if which valgrind >/dev/null 2>&1; then :; else |
| 1026 | echo "Memcheck not possible. Valgrind not found" |
| 1027 | exit 1 |
| 1028 | fi |
| 1029 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1030 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1031 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1032 | exit 1 |
| 1033 | fi |
| 1034 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1035 | # used by watchdog |
| 1036 | MAIN_PID="$$" |
| 1037 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1038 | # We use somewhat arbitrary delays for tests: |
| 1039 | # - how long do we wait for the server to start (when lsof not available)? |
| 1040 | # - how long do we allow for the client to finish? |
| 1041 | # (not to check performance, just to avoid waiting indefinitely) |
| 1042 | # Things are slower with valgrind, so give extra time here. |
| 1043 | # |
| 1044 | # Note: without lsof, there is a trade-off between the running time of this |
| 1045 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1046 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1047 | # the script, only the case where a client or server gets stuck. |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1048 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1049 | START_DELAY=6 |
| 1050 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1051 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1052 | START_DELAY=2 |
| 1053 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1054 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1055 | |
| 1056 | # some particular tests need more time: |
| 1057 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1058 | # - for the server, we sleep for a number of seconds after the client exits |
| 1059 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1060 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1061 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1062 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1063 | # fix commands to use this port, force IPv4 while at it |
Manuel Pégourié-Gonnard | 0af1ba3 | 2015-01-21 11:44:33 +0000 | [diff] [blame] | 1064 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1065 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1066 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 1067 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 1068 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1069 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 1070 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1071 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1072 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1073 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1074 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1075 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1076 | fi |
| 1077 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1078 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1079 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1080 | fi |
| 1081 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1082 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1083 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1084 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1085 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1086 | # Allow SHA-1, because many of our test certificates use it |
| 1087 | P_SRV="$P_SRV allow_sha1=1" |
| 1088 | P_CLI="$P_CLI allow_sha1=1" |
| 1089 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1090 | # Also pick a unique name for intermediate files |
| 1091 | SRV_OUT="srv_out.$$" |
| 1092 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1093 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1094 | SESSION="session.$$" |
| 1095 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1096 | SKIP_NEXT="NO" |
| 1097 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1098 | trap cleanup INT TERM HUP |
| 1099 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1100 | # Basic test |
| 1101 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1102 | # Checks that: |
| 1103 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1104 | # - the expected (highest security) parameters are selected |
| 1105 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1106 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1107 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1108 | "$P_CLI" \ |
| 1109 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1110 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1111 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1112 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1113 | -s "ECDHE curve: secp521r1" \ |
| 1114 | -S "error" \ |
| 1115 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1116 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1117 | run_test "Default, DTLS" \ |
| 1118 | "$P_SRV dtls=1" \ |
| 1119 | "$P_CLI dtls=1" \ |
| 1120 | 0 \ |
| 1121 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1122 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1123 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame^] | 1124 | run_test "TLS client auth: required" \ |
| 1125 | "$P_SRV auth_mode=required" \ |
| 1126 | "$P_CLI" \ |
| 1127 | 0 \ |
| 1128 | -s "Verifying peer X.509 certificate... ok" |
| 1129 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1130 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1131 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1132 | requires_config_enabled MBEDTLS_SHA256_C |
| 1133 | run_test "TLS: password protected client key" \ |
| 1134 | "$P_SRV auth_mode=required" \ |
| 1135 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1136 | 0 |
| 1137 | |
| 1138 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1139 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1140 | requires_config_enabled MBEDTLS_SHA256_C |
| 1141 | run_test "TLS: password protected server key" \ |
| 1142 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1143 | "$P_CLI" \ |
| 1144 | 0 |
| 1145 | |
| 1146 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1147 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1148 | requires_config_enabled MBEDTLS_RSA_C |
| 1149 | requires_config_enabled MBEDTLS_SHA256_C |
| 1150 | run_test "TLS: password protected server key, two certificates" \ |
| 1151 | "$P_SRV \ |
| 1152 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1153 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1154 | "$P_CLI" \ |
| 1155 | 0 |
| 1156 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1157 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1158 | run_test "Default (compression enabled)" \ |
| 1159 | "$P_SRV debug_level=3" \ |
| 1160 | "$P_CLI debug_level=3" \ |
| 1161 | 0 \ |
| 1162 | -s "Allocating compression buffer" \ |
| 1163 | -c "Allocating compression buffer" \ |
| 1164 | -s "Record expansion is unknown (compression)" \ |
| 1165 | -c "Record expansion is unknown (compression)" \ |
| 1166 | -S "error" \ |
| 1167 | -C "error" |
| 1168 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1169 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1170 | run_test "CA callback on client" \ |
| 1171 | "$P_SRV debug_level=3" \ |
| 1172 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1173 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1174 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1175 | -S "error" \ |
| 1176 | -C "error" |
| 1177 | |
| 1178 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1179 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1180 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1181 | requires_config_enabled MBEDTLS_SHA256_C |
| 1182 | run_test "CA callback on server" \ |
| 1183 | "$P_SRV auth_mode=required" \ |
| 1184 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1185 | key_file=data_files/server5.key" \ |
| 1186 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1187 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1188 | -s "Verifying peer X.509 certificate... ok" \ |
| 1189 | -S "error" \ |
| 1190 | -C "error" |
| 1191 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1192 | # Test using an opaque private key for client authentication |
| 1193 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1194 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1195 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1196 | requires_config_enabled MBEDTLS_SHA256_C |
| 1197 | run_test "Opaque key for client authentication" \ |
| 1198 | "$P_SRV auth_mode=required" \ |
| 1199 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1200 | key_file=data_files/server5.key" \ |
| 1201 | 0 \ |
| 1202 | -c "key type: Opaque" \ |
| 1203 | -s "Verifying peer X.509 certificate... ok" \ |
| 1204 | -S "error" \ |
| 1205 | -C "error" |
| 1206 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1207 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1208 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1209 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1210 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1211 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1212 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1213 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1214 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1215 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1216 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1217 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1218 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1219 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1220 | run_test_psa_force_curve "secp521r1" |
| 1221 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1222 | run_test_psa_force_curve "brainpoolP512r1" |
| 1223 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1224 | run_test_psa_force_curve "secp384r1" |
| 1225 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1226 | run_test_psa_force_curve "brainpoolP384r1" |
| 1227 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1228 | run_test_psa_force_curve "secp256r1" |
| 1229 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1230 | run_test_psa_force_curve "secp256k1" |
| 1231 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1232 | run_test_psa_force_curve "brainpoolP256r1" |
| 1233 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1234 | run_test_psa_force_curve "secp224r1" |
| 1235 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1236 | run_test_psa_force_curve "secp224k1" |
| 1237 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1238 | run_test_psa_force_curve "secp192r1" |
| 1239 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1240 | run_test_psa_force_curve "secp192k1" |
| 1241 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1242 | # Test current time in ServerHello |
| 1243 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1244 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1245 | "$P_SRV debug_level=3" \ |
| 1246 | "$P_CLI debug_level=3" \ |
| 1247 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1248 | -f "check_server_hello_time" \ |
| 1249 | -F "check_server_hello_time" |
| 1250 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1251 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1252 | run_test "Unique IV in GCM" \ |
| 1253 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1254 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1255 | 0 \ |
| 1256 | -u "IV used" \ |
| 1257 | -U "IV used" |
| 1258 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1259 | # Tests for certificate verification callback |
| 1260 | run_test "Configuration-specific CRT verification callback" \ |
| 1261 | "$P_SRV debug_level=3" \ |
| 1262 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1263 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1264 | -S "error" \ |
| 1265 | -c "Verify requested for " \ |
| 1266 | -c "Use configuration-specific verification callback" \ |
| 1267 | -C "Use context-specific verification callback" \ |
| 1268 | -C "error" |
| 1269 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1270 | run_test "Context-specific CRT verification callback" \ |
| 1271 | "$P_SRV debug_level=3" \ |
| 1272 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1273 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1274 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1275 | -c "Verify requested for " \ |
| 1276 | -c "Use context-specific verification callback" \ |
| 1277 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1278 | -C "error" |
| 1279 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1280 | # Tests for rc4 option |
| 1281 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1282 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1283 | run_test "RC4: server disabled, client enabled" \ |
| 1284 | "$P_SRV" \ |
| 1285 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1286 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1287 | -s "SSL - The server has no ciphersuites in common" |
| 1288 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1289 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1290 | run_test "RC4: server half, client enabled" \ |
| 1291 | "$P_SRV arc4=1" \ |
| 1292 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1293 | 1 \ |
| 1294 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1295 | |
| 1296 | run_test "RC4: server enabled, client disabled" \ |
| 1297 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1298 | "$P_CLI" \ |
| 1299 | 1 \ |
| 1300 | -s "SSL - The server has no ciphersuites in common" |
| 1301 | |
| 1302 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1303 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1304 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1305 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1306 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1307 | -S "SSL - The server has no ciphersuites in common" |
| 1308 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1309 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1310 | |
| 1311 | requires_gnutls |
| 1312 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1313 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1314 | "$G_SRV"\ |
| 1315 | "$P_CLI force_version=tls1_1" \ |
| 1316 | 0 |
| 1317 | |
| 1318 | requires_gnutls |
| 1319 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1320 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1321 | "$G_SRV"\ |
| 1322 | "$P_CLI force_version=tls1" \ |
| 1323 | 0 |
| 1324 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1325 | # Tests for SHA-1 support |
| 1326 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1327 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1328 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1329 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1330 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1331 | 1 \ |
| 1332 | -c "The certificate is signed with an unacceptable hash" |
| 1333 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1334 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1335 | run_test "SHA-1 allowed by default in server certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1336 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1337 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1338 | 0 |
| 1339 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1340 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1341 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1342 | "$P_CLI allow_sha1=1" \ |
| 1343 | 0 |
| 1344 | |
| 1345 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1346 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1347 | "$P_CLI allow_sha1=0" \ |
| 1348 | 0 |
| 1349 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1350 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1351 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1352 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1353 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1354 | 1 \ |
| 1355 | -s "The certificate is signed with an unacceptable hash" |
| 1356 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1357 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1358 | run_test "SHA-1 allowed by default in client certificate" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1359 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1360 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1361 | 0 |
| 1362 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1363 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1364 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1365 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1366 | 0 |
| 1367 | |
| 1368 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1369 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1370 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1371 | 0 |
| 1372 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1373 | # Tests for datagram packing |
| 1374 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1375 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1376 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1377 | 0 \ |
| 1378 | -c "next record in same datagram" \ |
| 1379 | -s "next record in same datagram" |
| 1380 | |
| 1381 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1382 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1383 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1384 | 0 \ |
| 1385 | -s "next record in same datagram" \ |
| 1386 | -C "next record in same datagram" |
| 1387 | |
| 1388 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1389 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1390 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1391 | 0 \ |
| 1392 | -S "next record in same datagram" \ |
| 1393 | -c "next record in same datagram" |
| 1394 | |
| 1395 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1396 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1397 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1398 | 0 \ |
| 1399 | -S "next record in same datagram" \ |
| 1400 | -C "next record in same datagram" |
| 1401 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1402 | # Tests for Truncated HMAC extension |
| 1403 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1404 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1405 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1406 | "$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] | 1407 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1408 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1409 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1410 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1411 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1412 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1413 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1414 | "$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] | 1415 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1416 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1417 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1418 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1419 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1420 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1421 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1422 | "$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] | 1423 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1424 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1425 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1426 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1427 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1428 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1429 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1430 | "$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] | 1431 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1432 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1433 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1434 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1435 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1436 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1437 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1438 | "$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] | 1439 | 0 \ |
| 1440 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1441 | -S "dumping 'expected mac' (10 bytes)" |
| 1442 | |
| 1443 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1444 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1445 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1446 | "$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] | 1447 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1448 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1449 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1450 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1451 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1452 | "$P_SRV dtls=1 debug_level=4" \ |
| 1453 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1454 | 0 \ |
| 1455 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1456 | -S "dumping 'expected mac' (10 bytes)" |
| 1457 | |
| 1458 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1459 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1460 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1461 | "$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] | 1462 | 0 \ |
| 1463 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1464 | -S "dumping 'expected mac' (10 bytes)" |
| 1465 | |
| 1466 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1467 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1468 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1469 | "$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] | 1470 | 0 \ |
| 1471 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1472 | -S "dumping 'expected mac' (10 bytes)" |
| 1473 | |
| 1474 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1475 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1476 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1477 | "$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] | 1478 | 0 \ |
| 1479 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1480 | -S "dumping 'expected mac' (10 bytes)" |
| 1481 | |
| 1482 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1483 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1484 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1485 | "$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] | 1486 | 0 \ |
| 1487 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1488 | -S "dumping 'expected mac' (10 bytes)" |
| 1489 | |
| 1490 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1491 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1492 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1493 | "$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] | 1494 | 0 \ |
| 1495 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1496 | -s "dumping 'expected mac' (10 bytes)" |
| 1497 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1498 | # Tests for Context serialization |
| 1499 | |
| 1500 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1501 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1502 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1503 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1504 | 0 \ |
| 1505 | -c "Deserializing connection..." \ |
| 1506 | -S "Deserializing connection..." |
| 1507 | |
| 1508 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1509 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1510 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1511 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1512 | 0 \ |
| 1513 | -c "Deserializing connection..." \ |
| 1514 | -S "Deserializing connection..." |
| 1515 | |
| 1516 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1517 | run_test "Context serialization, client serializes, GCM" \ |
| 1518 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1519 | "$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] | 1520 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1521 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1522 | -S "Deserializing connection..." |
| 1523 | |
| 1524 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1525 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1526 | run_test "Context serialization, client serializes, with CID" \ |
| 1527 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1528 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1529 | 0 \ |
| 1530 | -c "Deserializing connection..." \ |
| 1531 | -S "Deserializing connection..." |
| 1532 | |
| 1533 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1534 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1535 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1536 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1537 | 0 \ |
| 1538 | -C "Deserializing connection..." \ |
| 1539 | -s "Deserializing connection..." |
| 1540 | |
| 1541 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1542 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1543 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1544 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1545 | 0 \ |
| 1546 | -C "Deserializing connection..." \ |
| 1547 | -s "Deserializing connection..." |
| 1548 | |
| 1549 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1550 | run_test "Context serialization, server serializes, GCM" \ |
| 1551 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1552 | "$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] | 1553 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1554 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1555 | -s "Deserializing connection..." |
| 1556 | |
| 1557 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1558 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1559 | run_test "Context serialization, server serializes, with CID" \ |
| 1560 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1561 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1562 | 0 \ |
| 1563 | -C "Deserializing connection..." \ |
| 1564 | -s "Deserializing connection..." |
| 1565 | |
| 1566 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1567 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1568 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1569 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1570 | 0 \ |
| 1571 | -c "Deserializing connection..." \ |
| 1572 | -s "Deserializing connection..." |
| 1573 | |
| 1574 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1575 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1576 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1577 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1578 | 0 \ |
| 1579 | -c "Deserializing connection..." \ |
| 1580 | -s "Deserializing connection..." |
| 1581 | |
| 1582 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1583 | run_test "Context serialization, both serialize, GCM" \ |
| 1584 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1585 | "$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] | 1586 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1587 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1588 | -s "Deserializing connection..." |
| 1589 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1590 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1591 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1592 | run_test "Context serialization, both serialize, with CID" \ |
| 1593 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1594 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1595 | 0 \ |
| 1596 | -c "Deserializing connection..." \ |
| 1597 | -s "Deserializing connection..." |
| 1598 | |
| 1599 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1600 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1601 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1602 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1603 | 0 \ |
| 1604 | -c "Deserializing connection..." \ |
| 1605 | -S "Deserializing connection..." |
| 1606 | |
| 1607 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1608 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1609 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1610 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1611 | 0 \ |
| 1612 | -c "Deserializing connection..." \ |
| 1613 | -S "Deserializing connection..." |
| 1614 | |
| 1615 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1616 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1617 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1618 | "$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] | 1619 | 0 \ |
| 1620 | -c "Deserializing connection..." \ |
| 1621 | -S "Deserializing connection..." |
| 1622 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1623 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1624 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1625 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1626 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1627 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1628 | 0 \ |
| 1629 | -c "Deserializing connection..." \ |
| 1630 | -S "Deserializing connection..." |
| 1631 | |
| 1632 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1633 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1634 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1635 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1636 | 0 \ |
| 1637 | -C "Deserializing connection..." \ |
| 1638 | -s "Deserializing connection..." |
| 1639 | |
| 1640 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1641 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1642 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1643 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1644 | 0 \ |
| 1645 | -C "Deserializing connection..." \ |
| 1646 | -s "Deserializing connection..." |
| 1647 | |
| 1648 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1649 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1650 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1651 | "$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] | 1652 | 0 \ |
| 1653 | -C "Deserializing connection..." \ |
| 1654 | -s "Deserializing connection..." |
| 1655 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1656 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1657 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1658 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1659 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1660 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1661 | 0 \ |
| 1662 | -C "Deserializing connection..." \ |
| 1663 | -s "Deserializing connection..." |
| 1664 | |
| 1665 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1666 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1667 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1668 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1669 | 0 \ |
| 1670 | -c "Deserializing connection..." \ |
| 1671 | -s "Deserializing connection..." |
| 1672 | |
| 1673 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1674 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1675 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1676 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1677 | 0 \ |
| 1678 | -c "Deserializing connection..." \ |
| 1679 | -s "Deserializing connection..." |
| 1680 | |
| 1681 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1682 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1683 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1684 | "$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] | 1685 | 0 \ |
| 1686 | -c "Deserializing connection..." \ |
| 1687 | -s "Deserializing connection..." |
| 1688 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1689 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1690 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1691 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1692 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1693 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1694 | 0 \ |
| 1695 | -c "Deserializing connection..." \ |
| 1696 | -s "Deserializing connection..." |
| 1697 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1698 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1699 | run_test "Saving the serialized context to a file" \ |
| 1700 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1701 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1702 | 0 \ |
| 1703 | -s "Save serialized context to a file... ok" \ |
| 1704 | -c "Save serialized context to a file... ok" |
| 1705 | rm -f context_srv.txt |
| 1706 | rm -f context_cli.txt |
| 1707 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1708 | # Tests for DTLS Connection ID extension |
| 1709 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1710 | # So far, the CID API isn't implemented, so we can't |
| 1711 | # grep for output witnessing its use. This needs to be |
| 1712 | # changed once the CID extension is implemented. |
| 1713 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1714 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1715 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1716 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1717 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1718 | 0 \ |
| 1719 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1720 | -s "found CID extension" \ |
| 1721 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1722 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1723 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1724 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1725 | -C "found CID extension" \ |
| 1726 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1727 | -C "Copy CIDs into SSL transform" \ |
| 1728 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1729 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1730 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1731 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1732 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1733 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1734 | 0 \ |
| 1735 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1736 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1737 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1738 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1739 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1740 | -C "found CID extension" \ |
| 1741 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1742 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1743 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1744 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1745 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1746 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1747 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1748 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1749 | 0 \ |
| 1750 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1751 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1752 | -c "client hello, adding CID extension" \ |
| 1753 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1754 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1755 | -s "server hello, adding CID extension" \ |
| 1756 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1757 | -c "Use of CID extension negotiated" \ |
| 1758 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1759 | -c "Copy CIDs into SSL transform" \ |
| 1760 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1761 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1762 | -s "Use of Connection ID has been negotiated" \ |
| 1763 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1764 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1765 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1766 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1767 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1768 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1769 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1770 | 0 \ |
| 1771 | -c "Enable use of CID extension." \ |
| 1772 | -s "Enable use of CID extension." \ |
| 1773 | -c "client hello, adding CID extension" \ |
| 1774 | -s "found CID extension" \ |
| 1775 | -s "Use of CID extension negotiated" \ |
| 1776 | -s "server hello, adding CID extension" \ |
| 1777 | -c "found CID extension" \ |
| 1778 | -c "Use of CID extension negotiated" \ |
| 1779 | -s "Copy CIDs into SSL transform" \ |
| 1780 | -c "Copy CIDs into SSL transform" \ |
| 1781 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1782 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1783 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1784 | -c "Use of Connection ID has been negotiated" \ |
| 1785 | -c "ignoring unexpected CID" \ |
| 1786 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1787 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1788 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1789 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1790 | -p "$P_PXY mtu=800" \ |
| 1791 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1792 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1793 | 0 \ |
| 1794 | -c "Enable use of CID extension." \ |
| 1795 | -s "Enable use of CID extension." \ |
| 1796 | -c "client hello, adding CID extension" \ |
| 1797 | -s "found CID extension" \ |
| 1798 | -s "Use of CID extension negotiated" \ |
| 1799 | -s "server hello, adding CID extension" \ |
| 1800 | -c "found CID extension" \ |
| 1801 | -c "Use of CID extension negotiated" \ |
| 1802 | -s "Copy CIDs into SSL transform" \ |
| 1803 | -c "Copy CIDs into SSL transform" \ |
| 1804 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1805 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1806 | -s "Use of Connection ID has been negotiated" \ |
| 1807 | -c "Use of Connection ID has been negotiated" |
| 1808 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1809 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1810 | 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] | 1811 | -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] | 1812 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1813 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1814 | 0 \ |
| 1815 | -c "Enable use of CID extension." \ |
| 1816 | -s "Enable use of CID extension." \ |
| 1817 | -c "client hello, adding CID extension" \ |
| 1818 | -s "found CID extension" \ |
| 1819 | -s "Use of CID extension negotiated" \ |
| 1820 | -s "server hello, adding CID extension" \ |
| 1821 | -c "found CID extension" \ |
| 1822 | -c "Use of CID extension negotiated" \ |
| 1823 | -s "Copy CIDs into SSL transform" \ |
| 1824 | -c "Copy CIDs into SSL transform" \ |
| 1825 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1826 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1827 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1828 | -c "Use of Connection ID has been negotiated" \ |
| 1829 | -c "ignoring unexpected CID" \ |
| 1830 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1831 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1832 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1833 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1834 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1835 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1836 | 0 \ |
| 1837 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1838 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1839 | -c "client hello, adding CID extension" \ |
| 1840 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1841 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1842 | -s "server hello, adding CID extension" \ |
| 1843 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1844 | -c "Use of CID extension negotiated" \ |
| 1845 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1846 | -c "Copy CIDs into SSL transform" \ |
| 1847 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1848 | -s "Peer CID (length 0 Bytes):" \ |
| 1849 | -s "Use of Connection ID has been negotiated" \ |
| 1850 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1851 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1852 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1853 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1854 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1855 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1856 | 0 \ |
| 1857 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1858 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1859 | -c "client hello, adding CID extension" \ |
| 1860 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1861 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1862 | -s "server hello, adding CID extension" \ |
| 1863 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1864 | -c "Use of CID extension negotiated" \ |
| 1865 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1866 | -c "Copy CIDs into SSL transform" \ |
| 1867 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1868 | -c "Peer CID (length 0 Bytes):" \ |
| 1869 | -s "Use of Connection ID has been negotiated" \ |
| 1870 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1871 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1872 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1873 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1874 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1875 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1876 | 0 \ |
| 1877 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1878 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1879 | -c "client hello, adding CID extension" \ |
| 1880 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1881 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1882 | -s "server hello, adding CID extension" \ |
| 1883 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1884 | -c "Use of CID extension negotiated" \ |
| 1885 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1886 | -c "Copy CIDs into SSL transform" \ |
| 1887 | -S "Use of Connection ID has been negotiated" \ |
| 1888 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1889 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1890 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1891 | 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] | 1892 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1893 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1894 | 0 \ |
| 1895 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1896 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1897 | -c "client hello, adding CID extension" \ |
| 1898 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1899 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1900 | -s "server hello, adding CID extension" \ |
| 1901 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1902 | -c "Use of CID extension negotiated" \ |
| 1903 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1904 | -c "Copy CIDs into SSL transform" \ |
| 1905 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1906 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1907 | -s "Use of Connection ID has been negotiated" \ |
| 1908 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1909 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1910 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1911 | 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] | 1912 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1913 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1914 | 0 \ |
| 1915 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1916 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1917 | -c "client hello, adding CID extension" \ |
| 1918 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1919 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1920 | -s "server hello, adding CID extension" \ |
| 1921 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1922 | -c "Use of CID extension negotiated" \ |
| 1923 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1924 | -c "Copy CIDs into SSL transform" \ |
| 1925 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1926 | -s "Peer CID (length 0 Bytes):" \ |
| 1927 | -s "Use of Connection ID has been negotiated" \ |
| 1928 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1929 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1930 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1931 | 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] | 1932 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1933 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1934 | 0 \ |
| 1935 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1936 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1937 | -c "client hello, adding CID extension" \ |
| 1938 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1939 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1940 | -s "server hello, adding CID extension" \ |
| 1941 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1942 | -c "Use of CID extension negotiated" \ |
| 1943 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1944 | -c "Copy CIDs into SSL transform" \ |
| 1945 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1946 | -c "Peer CID (length 0 Bytes):" \ |
| 1947 | -s "Use of Connection ID has been negotiated" \ |
| 1948 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1949 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1951 | 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] | 1952 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1953 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1954 | 0 \ |
| 1955 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1956 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1957 | -c "client hello, adding CID extension" \ |
| 1958 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1959 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1960 | -s "server hello, adding CID extension" \ |
| 1961 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1962 | -c "Use of CID extension negotiated" \ |
| 1963 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1964 | -c "Copy CIDs into SSL transform" \ |
| 1965 | -S "Use of Connection ID has been negotiated" \ |
| 1966 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1967 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1969 | 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] | 1970 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1971 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1972 | 0 \ |
| 1973 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1974 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1975 | -c "client hello, adding CID extension" \ |
| 1976 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1977 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1978 | -s "server hello, adding CID extension" \ |
| 1979 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1980 | -c "Use of CID extension negotiated" \ |
| 1981 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1982 | -c "Copy CIDs into SSL transform" \ |
| 1983 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1984 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1985 | -s "Use of Connection ID has been negotiated" \ |
| 1986 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1987 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1988 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1989 | 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] | 1990 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1991 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1992 | 0 \ |
| 1993 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1994 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1995 | -c "client hello, adding CID extension" \ |
| 1996 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1997 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1998 | -s "server hello, adding CID extension" \ |
| 1999 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2000 | -c "Use of CID extension negotiated" \ |
| 2001 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2002 | -c "Copy CIDs into SSL transform" \ |
| 2003 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2004 | -s "Peer CID (length 0 Bytes):" \ |
| 2005 | -s "Use of Connection ID has been negotiated" \ |
| 2006 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2007 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2008 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2009 | 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] | 2010 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2011 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2012 | 0 \ |
| 2013 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2014 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2015 | -c "client hello, adding CID extension" \ |
| 2016 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2017 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2018 | -s "server hello, adding CID extension" \ |
| 2019 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2020 | -c "Use of CID extension negotiated" \ |
| 2021 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2022 | -c "Copy CIDs into SSL transform" \ |
| 2023 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2024 | -c "Peer CID (length 0 Bytes):" \ |
| 2025 | -s "Use of Connection ID has been negotiated" \ |
| 2026 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2027 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2029 | 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] | 2030 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2031 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2032 | 0 \ |
| 2033 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2034 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2035 | -c "client hello, adding CID extension" \ |
| 2036 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2037 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2038 | -s "server hello, adding CID extension" \ |
| 2039 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2040 | -c "Use of CID extension negotiated" \ |
| 2041 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2042 | -c "Copy CIDs into SSL transform" \ |
| 2043 | -S "Use of Connection ID has been negotiated" \ |
| 2044 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2045 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2048 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2049 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2050 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2051 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2052 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2053 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2054 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2055 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2056 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2057 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2058 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2059 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2060 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2061 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2063 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2064 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2065 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2066 | 0 \ |
| 2067 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2068 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2069 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2070 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2071 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2072 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2073 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2074 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2075 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2076 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2077 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2078 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2079 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2080 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2081 | 0 \ |
| 2082 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2083 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2084 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2085 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2086 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2087 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2088 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2089 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2090 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2091 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2092 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2093 | 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] | 2094 | -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] | 2095 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2096 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2097 | 0 \ |
| 2098 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2099 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2100 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2101 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2102 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2103 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2104 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2105 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2106 | -c "ignoring unexpected CID" \ |
| 2107 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2108 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2110 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2111 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2112 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2113 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2114 | 0 \ |
| 2115 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2116 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2117 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2118 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2119 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2120 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2121 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2122 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2123 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2124 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2125 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2126 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2127 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2128 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2129 | 0 \ |
| 2130 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2131 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2132 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2133 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2134 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2135 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2136 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2137 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2138 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2141 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2142 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2143 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2144 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2145 | 0 \ |
| 2146 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2147 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2148 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2149 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2150 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2151 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2152 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2153 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2154 | -c "ignoring unexpected CID" \ |
| 2155 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2156 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2158 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2159 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2160 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2161 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2162 | 0 \ |
| 2163 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2164 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2165 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2166 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2167 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2168 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2169 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2170 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2172 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2173 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2174 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2175 | 0 \ |
| 2176 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2177 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2178 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2179 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2180 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2181 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2182 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2185 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2186 | -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] | 2187 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2188 | "$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" \ |
| 2189 | 0 \ |
| 2190 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2191 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2192 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2193 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2194 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2195 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2196 | -c "ignoring unexpected CID" \ |
| 2197 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2198 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2200 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2201 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2202 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2203 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2204 | 0 \ |
| 2205 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2206 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2207 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2208 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2209 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2210 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2211 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2212 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2213 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2214 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2217 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2218 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2219 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2220 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2221 | 0 \ |
| 2222 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2223 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2224 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2225 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2226 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2228 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2229 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2230 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2231 | -c "ignoring unexpected CID" \ |
| 2232 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2233 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2234 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2236 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2237 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2238 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2239 | 0 \ |
| 2240 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2241 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2242 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2243 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2244 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2245 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2246 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2247 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2248 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2249 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2250 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2251 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2252 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2253 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2254 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2255 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2256 | 0 \ |
| 2257 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2260 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2261 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2262 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2263 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2264 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2265 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2266 | -c "ignoring unexpected CID" \ |
| 2267 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2268 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2269 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2270 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2271 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2272 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2273 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2274 | 0 \ |
| 2275 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2276 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2277 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2278 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2279 | -s "Reallocating in_buf" \ |
| 2280 | -s "Reallocating out_buf" |
| 2281 | |
| 2282 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2283 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2284 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2285 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2286 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2287 | 0 \ |
| 2288 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2289 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2290 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2291 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2292 | -s "Reallocating in_buf" \ |
| 2293 | -s "Reallocating out_buf" |
| 2294 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2295 | # Tests for Encrypt-then-MAC extension |
| 2296 | |
| 2297 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 \ |
| 2299 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2300 | "$P_CLI debug_level=3" \ |
| 2301 | 0 \ |
| 2302 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2303 | -s "found encrypt then mac extension" \ |
| 2304 | -s "server hello, adding encrypt then mac extension" \ |
| 2305 | -c "found encrypt_then_mac extension" \ |
| 2306 | -c "using encrypt then mac" \ |
| 2307 | -s "using encrypt then mac" |
| 2308 | |
| 2309 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2310 | "$P_SRV debug_level=3 etm=0 \ |
| 2311 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2312 | "$P_CLI debug_level=3 etm=1" \ |
| 2313 | 0 \ |
| 2314 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2315 | -s "found encrypt then mac extension" \ |
| 2316 | -S "server hello, adding encrypt then mac extension" \ |
| 2317 | -C "found encrypt_then_mac extension" \ |
| 2318 | -C "using encrypt then mac" \ |
| 2319 | -S "using encrypt then mac" |
| 2320 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2321 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2322 | "$P_SRV debug_level=3 etm=1 \ |
| 2323 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2324 | "$P_CLI debug_level=3 etm=1" \ |
| 2325 | 0 \ |
| 2326 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2327 | -s "found encrypt then mac extension" \ |
| 2328 | -S "server hello, adding encrypt then mac extension" \ |
| 2329 | -C "found encrypt_then_mac extension" \ |
| 2330 | -C "using encrypt then mac" \ |
| 2331 | -S "using encrypt then mac" |
| 2332 | |
| 2333 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2334 | "$P_SRV debug_level=3 etm=1 \ |
| 2335 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2336 | "$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] | 2337 | 0 \ |
| 2338 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2339 | -s "found encrypt then mac extension" \ |
| 2340 | -S "server hello, adding encrypt then mac extension" \ |
| 2341 | -C "found encrypt_then_mac extension" \ |
| 2342 | -C "using encrypt then mac" \ |
| 2343 | -S "using encrypt then mac" |
| 2344 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2345 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2346 | "$P_SRV debug_level=3 etm=1 \ |
| 2347 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2348 | "$P_CLI debug_level=3 etm=0" \ |
| 2349 | 0 \ |
| 2350 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2351 | -S "found encrypt then mac extension" \ |
| 2352 | -S "server hello, adding encrypt then mac extension" \ |
| 2353 | -C "found encrypt_then_mac extension" \ |
| 2354 | -C "using encrypt then mac" \ |
| 2355 | -S "using encrypt then mac" |
| 2356 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2358 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2359 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2360 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2361 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2362 | 0 \ |
| 2363 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2364 | -S "found encrypt then mac extension" \ |
| 2365 | -S "server hello, adding encrypt then mac extension" \ |
| 2366 | -C "found encrypt_then_mac extension" \ |
| 2367 | -C "using encrypt then mac" \ |
| 2368 | -S "using encrypt then mac" |
| 2369 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2371 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2372 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2373 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2374 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2375 | 0 \ |
| 2376 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2377 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2378 | -S "server hello, adding encrypt then mac extension" \ |
| 2379 | -C "found encrypt_then_mac extension" \ |
| 2380 | -C "using encrypt then mac" \ |
| 2381 | -S "using encrypt then mac" |
| 2382 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2383 | # Tests for Extended Master Secret extension |
| 2384 | |
| 2385 | run_test "Extended Master Secret: default" \ |
| 2386 | "$P_SRV debug_level=3" \ |
| 2387 | "$P_CLI debug_level=3" \ |
| 2388 | 0 \ |
| 2389 | -c "client hello, adding extended_master_secret extension" \ |
| 2390 | -s "found extended master secret extension" \ |
| 2391 | -s "server hello, adding extended master secret extension" \ |
| 2392 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2393 | -c "session hash for extended master secret" \ |
| 2394 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2395 | |
| 2396 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2397 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2398 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2399 | 0 \ |
| 2400 | -c "client hello, adding extended_master_secret extension" \ |
| 2401 | -s "found extended master secret extension" \ |
| 2402 | -S "server hello, adding extended master secret extension" \ |
| 2403 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2404 | -C "session hash for extended master secret" \ |
| 2405 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2406 | |
| 2407 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2408 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2409 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2410 | 0 \ |
| 2411 | -C "client hello, adding extended_master_secret extension" \ |
| 2412 | -S "found extended master secret extension" \ |
| 2413 | -S "server hello, adding extended master secret extension" \ |
| 2414 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2415 | -C "session hash for extended master secret" \ |
| 2416 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2417 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2418 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2419 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2420 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2421 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2422 | 0 \ |
| 2423 | -C "client hello, adding extended_master_secret extension" \ |
| 2424 | -S "found extended master secret extension" \ |
| 2425 | -S "server hello, adding extended master secret extension" \ |
| 2426 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2427 | -C "session hash for extended master secret" \ |
| 2428 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2429 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2431 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2432 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2433 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2434 | 0 \ |
| 2435 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2436 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2437 | -S "server hello, adding extended master secret extension" \ |
| 2438 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2439 | -C "session hash for extended master secret" \ |
| 2440 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2441 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2442 | # Tests for FALLBACK_SCSV |
| 2443 | |
| 2444 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2445 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2446 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2447 | 0 \ |
| 2448 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2449 | -S "received FALLBACK_SCSV" \ |
| 2450 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2451 | -C "is a fatal alert message (msg 86)" |
| 2452 | |
| 2453 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2454 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2455 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2456 | 0 \ |
| 2457 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2458 | -S "received FALLBACK_SCSV" \ |
| 2459 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2460 | -C "is a fatal alert message (msg 86)" |
| 2461 | |
| 2462 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2463 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2464 | "$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] | 2465 | 1 \ |
| 2466 | -c "adding FALLBACK_SCSV" \ |
| 2467 | -s "received FALLBACK_SCSV" \ |
| 2468 | -s "inapropriate fallback" \ |
| 2469 | -c "is a fatal alert message (msg 86)" |
| 2470 | |
| 2471 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2472 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2473 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2474 | 0 \ |
| 2475 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2476 | -s "received FALLBACK_SCSV" \ |
| 2477 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2478 | -C "is a fatal alert message (msg 86)" |
| 2479 | |
| 2480 | requires_openssl_with_fallback_scsv |
| 2481 | run_test "Fallback SCSV: default, openssl server" \ |
| 2482 | "$O_SRV" \ |
| 2483 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2484 | 0 \ |
| 2485 | -C "adding FALLBACK_SCSV" \ |
| 2486 | -C "is a fatal alert message (msg 86)" |
| 2487 | |
| 2488 | requires_openssl_with_fallback_scsv |
| 2489 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2490 | "$O_SRV" \ |
| 2491 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2492 | 1 \ |
| 2493 | -c "adding FALLBACK_SCSV" \ |
| 2494 | -c "is a fatal alert message (msg 86)" |
| 2495 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2496 | requires_openssl_with_fallback_scsv |
| 2497 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2498 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2499 | "$O_CLI -tls1_1" \ |
| 2500 | 0 \ |
| 2501 | -S "received FALLBACK_SCSV" \ |
| 2502 | -S "inapropriate fallback" |
| 2503 | |
| 2504 | requires_openssl_with_fallback_scsv |
| 2505 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2506 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2507 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2508 | 1 \ |
| 2509 | -s "received FALLBACK_SCSV" \ |
| 2510 | -s "inapropriate fallback" |
| 2511 | |
| 2512 | requires_openssl_with_fallback_scsv |
| 2513 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2514 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2515 | "$O_CLI -fallback_scsv" \ |
| 2516 | 0 \ |
| 2517 | -s "received FALLBACK_SCSV" \ |
| 2518 | -S "inapropriate fallback" |
| 2519 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2520 | # Test sending and receiving empty application data records |
| 2521 | |
| 2522 | run_test "Encrypt then MAC: empty application data record" \ |
| 2523 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2524 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2525 | 0 \ |
| 2526 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2527 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2528 | -c "0 bytes written in 1 fragments" |
| 2529 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2530 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2531 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2532 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2533 | 0 \ |
| 2534 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2535 | -c "0 bytes written in 1 fragments" |
| 2536 | |
| 2537 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2538 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2539 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2540 | 0 \ |
| 2541 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2542 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2543 | -c "0 bytes written in 1 fragments" |
| 2544 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2545 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2546 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2547 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2548 | 0 \ |
| 2549 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2550 | -c "0 bytes written in 1 fragments" |
| 2551 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2552 | ## ClientHello generated with |
| 2553 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2554 | ## then manually twiddling the ciphersuite list. |
| 2555 | ## The ClientHello content is spelled out below as a hex string as |
| 2556 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2557 | ## The expected response is an inappropriate_fallback alert. |
| 2558 | requires_openssl_with_fallback_scsv |
| 2559 | run_test "Fallback SCSV: beginning of list" \ |
| 2560 | "$P_SRV debug_level=2" \ |
| 2561 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2562 | 0 \ |
| 2563 | -s "received FALLBACK_SCSV" \ |
| 2564 | -s "inapropriate fallback" |
| 2565 | |
| 2566 | requires_openssl_with_fallback_scsv |
| 2567 | run_test "Fallback SCSV: end of list" \ |
| 2568 | "$P_SRV debug_level=2" \ |
| 2569 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2570 | 0 \ |
| 2571 | -s "received FALLBACK_SCSV" \ |
| 2572 | -s "inapropriate fallback" |
| 2573 | |
| 2574 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2575 | requires_openssl_with_fallback_scsv |
| 2576 | run_test "Fallback SCSV: not in list" \ |
| 2577 | "$P_SRV debug_level=2" \ |
| 2578 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2579 | 0 \ |
| 2580 | -S "received FALLBACK_SCSV" \ |
| 2581 | -S "inapropriate fallback" |
| 2582 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2583 | # Tests for CBC 1/n-1 record splitting |
| 2584 | |
| 2585 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2586 | "$P_SRV" \ |
| 2587 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2588 | request_size=123 force_version=tls1_2" \ |
| 2589 | 0 \ |
| 2590 | -s "Read from client: 123 bytes read" \ |
| 2591 | -S "Read from client: 1 bytes read" \ |
| 2592 | -S "122 bytes read" |
| 2593 | |
| 2594 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2595 | "$P_SRV" \ |
| 2596 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2597 | request_size=123 force_version=tls1_1" \ |
| 2598 | 0 \ |
| 2599 | -s "Read from client: 123 bytes read" \ |
| 2600 | -S "Read from client: 1 bytes read" \ |
| 2601 | -S "122 bytes read" |
| 2602 | |
| 2603 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2604 | "$P_SRV" \ |
| 2605 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2606 | request_size=123 force_version=tls1" \ |
| 2607 | 0 \ |
| 2608 | -S "Read from client: 123 bytes read" \ |
| 2609 | -s "Read from client: 1 bytes read" \ |
| 2610 | -s "122 bytes read" |
| 2611 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2612 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2613 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2614 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2615 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2616 | request_size=123 force_version=ssl3" \ |
| 2617 | 0 \ |
| 2618 | -S "Read from client: 123 bytes read" \ |
| 2619 | -s "Read from client: 1 bytes read" \ |
| 2620 | -s "122 bytes read" |
| 2621 | |
| 2622 | 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] | 2623 | "$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] | 2624 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2625 | request_size=123 force_version=tls1" \ |
| 2626 | 0 \ |
| 2627 | -s "Read from client: 123 bytes read" \ |
| 2628 | -S "Read from client: 1 bytes read" \ |
| 2629 | -S "122 bytes read" |
| 2630 | |
| 2631 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2632 | "$P_SRV" \ |
| 2633 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2634 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2635 | 0 \ |
| 2636 | -s "Read from client: 123 bytes read" \ |
| 2637 | -S "Read from client: 1 bytes read" \ |
| 2638 | -S "122 bytes read" |
| 2639 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2640 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2641 | "$P_SRV nbio=2" \ |
| 2642 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2643 | request_size=123 force_version=tls1" \ |
| 2644 | 0 \ |
| 2645 | -S "Read from client: 123 bytes read" \ |
| 2646 | -s "Read from client: 1 bytes read" \ |
| 2647 | -s "122 bytes read" |
| 2648 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2649 | # Tests for Session Tickets |
| 2650 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2651 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2652 | "$P_SRV debug_level=3 tickets=1" \ |
| 2653 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2654 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2655 | -c "client hello, adding session ticket extension" \ |
| 2656 | -s "found session ticket extension" \ |
| 2657 | -s "server hello, adding session ticket extension" \ |
| 2658 | -c "found session_ticket extension" \ |
| 2659 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2660 | -S "session successfully restored from cache" \ |
| 2661 | -s "session successfully restored from ticket" \ |
| 2662 | -s "a session has been resumed" \ |
| 2663 | -c "a session has been resumed" |
| 2664 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2665 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2666 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2667 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2668 | 0 \ |
| 2669 | -c "client hello, adding session ticket extension" \ |
| 2670 | -s "found session ticket extension" \ |
| 2671 | -s "server hello, adding session ticket extension" \ |
| 2672 | -c "found session_ticket extension" \ |
| 2673 | -c "parse new session ticket" \ |
| 2674 | -S "session successfully restored from cache" \ |
| 2675 | -s "session successfully restored from ticket" \ |
| 2676 | -s "a session has been resumed" \ |
| 2677 | -c "a session has been resumed" |
| 2678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2679 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2680 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2681 | "$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] | 2682 | 0 \ |
| 2683 | -c "client hello, adding session ticket extension" \ |
| 2684 | -s "found session ticket extension" \ |
| 2685 | -s "server hello, adding session ticket extension" \ |
| 2686 | -c "found session_ticket extension" \ |
| 2687 | -c "parse new session ticket" \ |
| 2688 | -S "session successfully restored from cache" \ |
| 2689 | -S "session successfully restored from ticket" \ |
| 2690 | -S "a session has been resumed" \ |
| 2691 | -C "a session has been resumed" |
| 2692 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2693 | run_test "Session resume using tickets: session copy" \ |
| 2694 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2695 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2696 | 0 \ |
| 2697 | -c "client hello, adding session ticket extension" \ |
| 2698 | -s "found session ticket extension" \ |
| 2699 | -s "server hello, adding session ticket extension" \ |
| 2700 | -c "found session_ticket extension" \ |
| 2701 | -c "parse new session ticket" \ |
| 2702 | -S "session successfully restored from cache" \ |
| 2703 | -s "session successfully restored from ticket" \ |
| 2704 | -s "a session has been resumed" \ |
| 2705 | -c "a session has been resumed" |
| 2706 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2707 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2708 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2709 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2710 | 0 \ |
| 2711 | -c "client hello, adding session ticket extension" \ |
| 2712 | -c "found session_ticket extension" \ |
| 2713 | -c "parse new session ticket" \ |
| 2714 | -c "a session has been resumed" |
| 2715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2716 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2717 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2718 | "( $O_CLI -sess_out $SESSION; \ |
| 2719 | $O_CLI -sess_in $SESSION; \ |
| 2720 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2721 | 0 \ |
| 2722 | -s "found session ticket extension" \ |
| 2723 | -s "server hello, adding session ticket extension" \ |
| 2724 | -S "session successfully restored from cache" \ |
| 2725 | -s "session successfully restored from ticket" \ |
| 2726 | -s "a session has been resumed" |
| 2727 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2728 | # Tests for Session Tickets with DTLS |
| 2729 | |
| 2730 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2731 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2732 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2733 | 0 \ |
| 2734 | -c "client hello, adding session ticket extension" \ |
| 2735 | -s "found session ticket extension" \ |
| 2736 | -s "server hello, adding session ticket extension" \ |
| 2737 | -c "found session_ticket extension" \ |
| 2738 | -c "parse new session ticket" \ |
| 2739 | -S "session successfully restored from cache" \ |
| 2740 | -s "session successfully restored from ticket" \ |
| 2741 | -s "a session has been resumed" \ |
| 2742 | -c "a session has been resumed" |
| 2743 | |
| 2744 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2745 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2746 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2747 | 0 \ |
| 2748 | -c "client hello, adding session ticket extension" \ |
| 2749 | -s "found session ticket extension" \ |
| 2750 | -s "server hello, adding session ticket extension" \ |
| 2751 | -c "found session_ticket extension" \ |
| 2752 | -c "parse new session ticket" \ |
| 2753 | -S "session successfully restored from cache" \ |
| 2754 | -s "session successfully restored from ticket" \ |
| 2755 | -s "a session has been resumed" \ |
| 2756 | -c "a session has been resumed" |
| 2757 | |
| 2758 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2759 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2760 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2761 | 0 \ |
| 2762 | -c "client hello, adding session ticket extension" \ |
| 2763 | -s "found session ticket extension" \ |
| 2764 | -s "server hello, adding session ticket extension" \ |
| 2765 | -c "found session_ticket extension" \ |
| 2766 | -c "parse new session ticket" \ |
| 2767 | -S "session successfully restored from cache" \ |
| 2768 | -S "session successfully restored from ticket" \ |
| 2769 | -S "a session has been resumed" \ |
| 2770 | -C "a session has been resumed" |
| 2771 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2772 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2773 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2774 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2775 | 0 \ |
| 2776 | -c "client hello, adding session ticket extension" \ |
| 2777 | -s "found session ticket extension" \ |
| 2778 | -s "server hello, adding session ticket extension" \ |
| 2779 | -c "found session_ticket extension" \ |
| 2780 | -c "parse new session ticket" \ |
| 2781 | -S "session successfully restored from cache" \ |
| 2782 | -s "session successfully restored from ticket" \ |
| 2783 | -s "a session has been resumed" \ |
| 2784 | -c "a session has been resumed" |
| 2785 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2786 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2787 | "$O_SRV -dtls1" \ |
| 2788 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2789 | 0 \ |
| 2790 | -c "client hello, adding session ticket extension" \ |
| 2791 | -c "found session_ticket extension" \ |
| 2792 | -c "parse new session ticket" \ |
| 2793 | -c "a session has been resumed" |
| 2794 | |
| 2795 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2796 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2797 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2798 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2799 | rm -f $SESSION )" \ |
| 2800 | 0 \ |
| 2801 | -s "found session ticket extension" \ |
| 2802 | -s "server hello, adding session ticket extension" \ |
| 2803 | -S "session successfully restored from cache" \ |
| 2804 | -s "session successfully restored from ticket" \ |
| 2805 | -s "a session has been resumed" |
| 2806 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2807 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2808 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2809 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2810 | "$P_SRV debug_level=3 tickets=0" \ |
| 2811 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2812 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2813 | -c "client hello, adding session ticket extension" \ |
| 2814 | -s "found session ticket extension" \ |
| 2815 | -S "server hello, adding session ticket extension" \ |
| 2816 | -C "found session_ticket extension" \ |
| 2817 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2818 | -s "session successfully restored from cache" \ |
| 2819 | -S "session successfully restored from ticket" \ |
| 2820 | -s "a session has been resumed" \ |
| 2821 | -c "a session has been resumed" |
| 2822 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2823 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2824 | "$P_SRV debug_level=3 tickets=1" \ |
| 2825 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2826 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2827 | -C "client hello, adding session ticket extension" \ |
| 2828 | -S "found session ticket extension" \ |
| 2829 | -S "server hello, adding session ticket extension" \ |
| 2830 | -C "found session_ticket extension" \ |
| 2831 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2832 | -s "session successfully restored from cache" \ |
| 2833 | -S "session successfully restored from ticket" \ |
| 2834 | -s "a session has been resumed" \ |
| 2835 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2837 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2838 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2839 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2840 | 0 \ |
| 2841 | -S "session successfully restored from cache" \ |
| 2842 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2843 | -S "a session has been resumed" \ |
| 2844 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2846 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2847 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2848 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2849 | 0 \ |
| 2850 | -s "session successfully restored from cache" \ |
| 2851 | -S "session successfully restored from ticket" \ |
| 2852 | -s "a session has been resumed" \ |
| 2853 | -c "a session has been resumed" |
| 2854 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2855 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2856 | "$P_SRV debug_level=3 tickets=0" \ |
| 2857 | "$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] | 2858 | 0 \ |
| 2859 | -s "session successfully restored from cache" \ |
| 2860 | -S "session successfully restored from ticket" \ |
| 2861 | -s "a session has been resumed" \ |
| 2862 | -c "a session has been resumed" |
| 2863 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2864 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2865 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2866 | "$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] | 2867 | 0 \ |
| 2868 | -S "session successfully restored from cache" \ |
| 2869 | -S "session successfully restored from ticket" \ |
| 2870 | -S "a session has been resumed" \ |
| 2871 | -C "a session has been resumed" |
| 2872 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2873 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2874 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2875 | "$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] | 2876 | 0 \ |
| 2877 | -s "session successfully restored from cache" \ |
| 2878 | -S "session successfully restored from ticket" \ |
| 2879 | -s "a session has been resumed" \ |
| 2880 | -c "a session has been resumed" |
| 2881 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2882 | run_test "Session resume using cache: session copy" \ |
| 2883 | "$P_SRV debug_level=3 tickets=0" \ |
| 2884 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2885 | 0 \ |
| 2886 | -s "session successfully restored from cache" \ |
| 2887 | -S "session successfully restored from ticket" \ |
| 2888 | -s "a session has been resumed" \ |
| 2889 | -c "a session has been resumed" |
| 2890 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2891 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2892 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2893 | "( $O_CLI -sess_out $SESSION; \ |
| 2894 | $O_CLI -sess_in $SESSION; \ |
| 2895 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2896 | 0 \ |
| 2897 | -s "found session ticket extension" \ |
| 2898 | -S "server hello, adding session ticket extension" \ |
| 2899 | -s "session successfully restored from cache" \ |
| 2900 | -S "session successfully restored from ticket" \ |
| 2901 | -s "a session has been resumed" |
| 2902 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2903 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2904 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2905 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2906 | 0 \ |
| 2907 | -C "found session_ticket extension" \ |
| 2908 | -C "parse new session ticket" \ |
| 2909 | -c "a session has been resumed" |
| 2910 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2911 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2912 | |
| 2913 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2914 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2915 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2916 | 0 \ |
| 2917 | -c "client hello, adding session ticket extension" \ |
| 2918 | -s "found session ticket extension" \ |
| 2919 | -S "server hello, adding session ticket extension" \ |
| 2920 | -C "found session_ticket extension" \ |
| 2921 | -C "parse new session ticket" \ |
| 2922 | -s "session successfully restored from cache" \ |
| 2923 | -S "session successfully restored from ticket" \ |
| 2924 | -s "a session has been resumed" \ |
| 2925 | -c "a session has been resumed" |
| 2926 | |
| 2927 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2928 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2929 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2930 | 0 \ |
| 2931 | -C "client hello, adding session ticket extension" \ |
| 2932 | -S "found session ticket extension" \ |
| 2933 | -S "server hello, adding session ticket extension" \ |
| 2934 | -C "found session_ticket extension" \ |
| 2935 | -C "parse new session ticket" \ |
| 2936 | -s "session successfully restored from cache" \ |
| 2937 | -S "session successfully restored from ticket" \ |
| 2938 | -s "a session has been resumed" \ |
| 2939 | -c "a session has been resumed" |
| 2940 | |
| 2941 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2942 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2943 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2944 | 0 \ |
| 2945 | -S "session successfully restored from cache" \ |
| 2946 | -S "session successfully restored from ticket" \ |
| 2947 | -S "a session has been resumed" \ |
| 2948 | -C "a session has been resumed" |
| 2949 | |
| 2950 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2951 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2952 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2953 | 0 \ |
| 2954 | -s "session successfully restored from cache" \ |
| 2955 | -S "session successfully restored from ticket" \ |
| 2956 | -s "a session has been resumed" \ |
| 2957 | -c "a session has been resumed" |
| 2958 | |
| 2959 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2960 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2961 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2962 | 0 \ |
| 2963 | -s "session successfully restored from cache" \ |
| 2964 | -S "session successfully restored from ticket" \ |
| 2965 | -s "a session has been resumed" \ |
| 2966 | -c "a session has been resumed" |
| 2967 | |
| 2968 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2969 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2970 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2971 | 0 \ |
| 2972 | -S "session successfully restored from cache" \ |
| 2973 | -S "session successfully restored from ticket" \ |
| 2974 | -S "a session has been resumed" \ |
| 2975 | -C "a session has been resumed" |
| 2976 | |
| 2977 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2978 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2979 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2980 | 0 \ |
| 2981 | -s "session successfully restored from cache" \ |
| 2982 | -S "session successfully restored from ticket" \ |
| 2983 | -s "a session has been resumed" \ |
| 2984 | -c "a session has been resumed" |
| 2985 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2986 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2987 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2988 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2989 | 0 \ |
| 2990 | -s "session successfully restored from cache" \ |
| 2991 | -S "session successfully restored from ticket" \ |
| 2992 | -s "a session has been resumed" \ |
| 2993 | -c "a session has been resumed" |
| 2994 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2995 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2996 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2997 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 2998 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 2999 | rm -f $SESSION )" \ |
| 3000 | 0 \ |
| 3001 | -s "found session ticket extension" \ |
| 3002 | -S "server hello, adding session ticket extension" \ |
| 3003 | -s "session successfully restored from cache" \ |
| 3004 | -S "session successfully restored from ticket" \ |
| 3005 | -s "a session has been resumed" |
| 3006 | |
| 3007 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3008 | "$O_SRV -dtls1" \ |
| 3009 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3010 | 0 \ |
| 3011 | -C "found session_ticket extension" \ |
| 3012 | -C "parse new session ticket" \ |
| 3013 | -c "a session has been resumed" |
| 3014 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3015 | # Tests for Max Fragment Length extension |
| 3016 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3017 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 3018 | 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] | 3019 | exit 1 |
| 3020 | fi |
| 3021 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3022 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 3023 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 3024 | fi |
| 3025 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3027 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3028 | "$P_SRV debug_level=3" \ |
| 3029 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3030 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3031 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3032 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3033 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3034 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3035 | -C "client hello, adding max_fragment_length extension" \ |
| 3036 | -S "found max fragment length extension" \ |
| 3037 | -S "server hello, max_fragment_length extension" \ |
| 3038 | -C "found max_fragment_length extension" |
| 3039 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3040 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3041 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3042 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3043 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3044 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3045 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3046 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3047 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3048 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3049 | -C "client hello, adding max_fragment_length extension" \ |
| 3050 | -S "found max fragment length extension" \ |
| 3051 | -S "server hello, max_fragment_length extension" \ |
| 3052 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3053 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3054 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3055 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3056 | |
| 3057 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3058 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3059 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3060 | "$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] | 3061 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3062 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3063 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3064 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3065 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3066 | -C "client hello, adding max_fragment_length extension" \ |
| 3067 | -S "found max fragment length extension" \ |
| 3068 | -S "server hello, max_fragment_length extension" \ |
| 3069 | -C "found max_fragment_length extension" \ |
| 3070 | -c "fragment larger than.*maximum " |
| 3071 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3072 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3073 | # (session fragment length will be 16384 regardless of mbedtls |
| 3074 | # content length configuration.) |
| 3075 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3076 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3077 | run_test "Max fragment length: disabled, larger message" \ |
| 3078 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3079 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3080 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3081 | -C "Maximum input fragment length is 16384" \ |
| 3082 | -C "Maximum output fragment length is 16384" \ |
| 3083 | -S "Maximum input fragment length is 16384" \ |
| 3084 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3085 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3086 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3087 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3088 | |
| 3089 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3090 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 3091 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3092 | "$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] | 3093 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3094 | -C "Maximum input fragment length is 16384" \ |
| 3095 | -C "Maximum output fragment length is 16384" \ |
| 3096 | -S "Maximum input fragment length is 16384" \ |
| 3097 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3098 | -c "fragment larger than.*maximum " |
| 3099 | |
| 3100 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3101 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3102 | "$P_SRV debug_level=3" \ |
| 3103 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3104 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3105 | -c "Maximum input fragment length is 4096" \ |
| 3106 | -c "Maximum output fragment length is 4096" \ |
| 3107 | -s "Maximum input fragment length is 4096" \ |
| 3108 | -s "Maximum output fragment length is 4096" \ |
| 3109 | -c "client hello, adding max_fragment_length extension" \ |
| 3110 | -s "found max fragment length extension" \ |
| 3111 | -s "server hello, max_fragment_length extension" \ |
| 3112 | -c "found max_fragment_length extension" |
| 3113 | |
| 3114 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3115 | run_test "Max fragment length: client 512, server 1024" \ |
| 3116 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3117 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3118 | 0 \ |
| 3119 | -c "Maximum input fragment length is 512" \ |
| 3120 | -c "Maximum output fragment length is 512" \ |
| 3121 | -s "Maximum input fragment length is 512" \ |
| 3122 | -s "Maximum output fragment length is 512" \ |
| 3123 | -c "client hello, adding max_fragment_length extension" \ |
| 3124 | -s "found max fragment length extension" \ |
| 3125 | -s "server hello, max_fragment_length extension" \ |
| 3126 | -c "found max_fragment_length extension" |
| 3127 | |
| 3128 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3129 | run_test "Max fragment length: client 512, server 2048" \ |
| 3130 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3131 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3132 | 0 \ |
| 3133 | -c "Maximum input fragment length is 512" \ |
| 3134 | -c "Maximum output fragment length is 512" \ |
| 3135 | -s "Maximum input fragment length is 512" \ |
| 3136 | -s "Maximum output fragment length is 512" \ |
| 3137 | -c "client hello, adding max_fragment_length extension" \ |
| 3138 | -s "found max fragment length extension" \ |
| 3139 | -s "server hello, max_fragment_length extension" \ |
| 3140 | -c "found max_fragment_length extension" |
| 3141 | |
| 3142 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3143 | run_test "Max fragment length: client 512, server 4096" \ |
| 3144 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3145 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3146 | 0 \ |
| 3147 | -c "Maximum input fragment length is 512" \ |
| 3148 | -c "Maximum output fragment length is 512" \ |
| 3149 | -s "Maximum input fragment length is 512" \ |
| 3150 | -s "Maximum output fragment length is 512" \ |
| 3151 | -c "client hello, adding max_fragment_length extension" \ |
| 3152 | -s "found max fragment length extension" \ |
| 3153 | -s "server hello, max_fragment_length extension" \ |
| 3154 | -c "found max_fragment_length extension" |
| 3155 | |
| 3156 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3157 | run_test "Max fragment length: client 1024, server 512" \ |
| 3158 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3159 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3160 | 0 \ |
| 3161 | -c "Maximum input fragment length is 1024" \ |
| 3162 | -c "Maximum output fragment length is 1024" \ |
| 3163 | -s "Maximum input fragment length is 1024" \ |
| 3164 | -s "Maximum output fragment length is 512" \ |
| 3165 | -c "client hello, adding max_fragment_length extension" \ |
| 3166 | -s "found max fragment length extension" \ |
| 3167 | -s "server hello, max_fragment_length extension" \ |
| 3168 | -c "found max_fragment_length extension" |
| 3169 | |
| 3170 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3171 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3172 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3173 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3174 | 0 \ |
| 3175 | -c "Maximum input fragment length is 1024" \ |
| 3176 | -c "Maximum output fragment length is 1024" \ |
| 3177 | -s "Maximum input fragment length is 1024" \ |
| 3178 | -s "Maximum output fragment length is 1024" \ |
| 3179 | -c "client hello, adding max_fragment_length extension" \ |
| 3180 | -s "found max fragment length extension" \ |
| 3181 | -s "server hello, max_fragment_length extension" \ |
| 3182 | -c "found max_fragment_length extension" |
| 3183 | |
| 3184 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3185 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3186 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3187 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3188 | 0 \ |
| 3189 | -c "Maximum input fragment length is 1024" \ |
| 3190 | -c "Maximum output fragment length is 1024" \ |
| 3191 | -s "Maximum input fragment length is 1024" \ |
| 3192 | -s "Maximum output fragment length is 1024" \ |
| 3193 | -c "client hello, adding max_fragment_length extension" \ |
| 3194 | -s "found max fragment length extension" \ |
| 3195 | -s "server hello, max_fragment_length extension" \ |
| 3196 | -c "found max_fragment_length extension" |
| 3197 | |
| 3198 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3199 | run_test "Max fragment length: client 2048, server 512" \ |
| 3200 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3201 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3202 | 0 \ |
| 3203 | -c "Maximum input fragment length is 2048" \ |
| 3204 | -c "Maximum output fragment length is 2048" \ |
| 3205 | -s "Maximum input fragment length is 2048" \ |
| 3206 | -s "Maximum output fragment length is 512" \ |
| 3207 | -c "client hello, adding max_fragment_length extension" \ |
| 3208 | -s "found max fragment length extension" \ |
| 3209 | -s "server hello, max_fragment_length extension" \ |
| 3210 | -c "found max_fragment_length extension" |
| 3211 | |
| 3212 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3213 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3214 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3215 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3216 | 0 \ |
| 3217 | -c "Maximum input fragment length is 2048" \ |
| 3218 | -c "Maximum output fragment length is 2048" \ |
| 3219 | -s "Maximum input fragment length is 2048" \ |
| 3220 | -s "Maximum output fragment length is 1024" \ |
| 3221 | -c "client hello, adding max_fragment_length extension" \ |
| 3222 | -s "found max fragment length extension" \ |
| 3223 | -s "server hello, max_fragment_length extension" \ |
| 3224 | -c "found max_fragment_length extension" |
| 3225 | |
| 3226 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3227 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3228 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3229 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3230 | 0 \ |
| 3231 | -c "Maximum input fragment length is 2048" \ |
| 3232 | -c "Maximum output fragment length is 2048" \ |
| 3233 | -s "Maximum input fragment length is 2048" \ |
| 3234 | -s "Maximum output fragment length is 2048" \ |
| 3235 | -c "client hello, adding max_fragment_length extension" \ |
| 3236 | -s "found max fragment length extension" \ |
| 3237 | -s "server hello, max_fragment_length extension" \ |
| 3238 | -c "found max_fragment_length extension" |
| 3239 | |
| 3240 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3241 | run_test "Max fragment length: client 4096, server 512" \ |
| 3242 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3243 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3244 | 0 \ |
| 3245 | -c "Maximum input fragment length is 4096" \ |
| 3246 | -c "Maximum output fragment length is 4096" \ |
| 3247 | -s "Maximum input fragment length is 4096" \ |
| 3248 | -s "Maximum output fragment length is 512" \ |
| 3249 | -c "client hello, adding max_fragment_length extension" \ |
| 3250 | -s "found max fragment length extension" \ |
| 3251 | -s "server hello, max_fragment_length extension" \ |
| 3252 | -c "found max_fragment_length extension" |
| 3253 | |
| 3254 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3255 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3256 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3257 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3258 | 0 \ |
| 3259 | -c "Maximum input fragment length is 4096" \ |
| 3260 | -c "Maximum output fragment length is 4096" \ |
| 3261 | -s "Maximum input fragment length is 4096" \ |
| 3262 | -s "Maximum output fragment length is 1024" \ |
| 3263 | -c "client hello, adding max_fragment_length extension" \ |
| 3264 | -s "found max fragment length extension" \ |
| 3265 | -s "server hello, max_fragment_length extension" \ |
| 3266 | -c "found max_fragment_length extension" |
| 3267 | |
| 3268 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3269 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3270 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3271 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3272 | 0 \ |
| 3273 | -c "Maximum input fragment length is 4096" \ |
| 3274 | -c "Maximum output fragment length is 4096" \ |
| 3275 | -s "Maximum input fragment length is 4096" \ |
| 3276 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3277 | -c "client hello, adding max_fragment_length extension" \ |
| 3278 | -s "found max fragment length extension" \ |
| 3279 | -s "server hello, max_fragment_length extension" \ |
| 3280 | -c "found max_fragment_length extension" |
| 3281 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3283 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3284 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3285 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3286 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3287 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3288 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3289 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3290 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3291 | -C "client hello, adding max_fragment_length extension" \ |
| 3292 | -S "found max fragment length extension" \ |
| 3293 | -S "server hello, max_fragment_length extension" \ |
| 3294 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3295 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3297 | requires_gnutls |
| 3298 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3299 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3300 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3301 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3302 | -c "Maximum input fragment length is 4096" \ |
| 3303 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3304 | -c "client hello, adding max_fragment_length extension" \ |
| 3305 | -c "found max_fragment_length extension" |
| 3306 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3307 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3308 | run_test "Max fragment length: client, message just fits" \ |
| 3309 | "$P_SRV debug_level=3" \ |
| 3310 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3311 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3312 | -c "Maximum input fragment length is 2048" \ |
| 3313 | -c "Maximum output fragment length is 2048" \ |
| 3314 | -s "Maximum input fragment length is 2048" \ |
| 3315 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3316 | -c "client hello, adding max_fragment_length extension" \ |
| 3317 | -s "found max fragment length extension" \ |
| 3318 | -s "server hello, max_fragment_length extension" \ |
| 3319 | -c "found max_fragment_length extension" \ |
| 3320 | -c "2048 bytes written in 1 fragments" \ |
| 3321 | -s "2048 bytes read" |
| 3322 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3323 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3324 | run_test "Max fragment length: client, larger message" \ |
| 3325 | "$P_SRV debug_level=3" \ |
| 3326 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3327 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3328 | -c "Maximum input fragment length is 2048" \ |
| 3329 | -c "Maximum output fragment length is 2048" \ |
| 3330 | -s "Maximum input fragment length is 2048" \ |
| 3331 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3332 | -c "client hello, adding max_fragment_length extension" \ |
| 3333 | -s "found max fragment length extension" \ |
| 3334 | -s "server hello, max_fragment_length extension" \ |
| 3335 | -c "found max_fragment_length extension" \ |
| 3336 | -c "2345 bytes written in 2 fragments" \ |
| 3337 | -s "2048 bytes read" \ |
| 3338 | -s "297 bytes read" |
| 3339 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3340 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3341 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3342 | "$P_SRV debug_level=3 dtls=1" \ |
| 3343 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3344 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3345 | -c "Maximum input fragment length is 2048" \ |
| 3346 | -c "Maximum output fragment length is 2048" \ |
| 3347 | -s "Maximum input fragment length is 2048" \ |
| 3348 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3349 | -c "client hello, adding max_fragment_length extension" \ |
| 3350 | -s "found max fragment length extension" \ |
| 3351 | -s "server hello, max_fragment_length extension" \ |
| 3352 | -c "found max_fragment_length extension" \ |
| 3353 | -c "fragment larger than.*maximum" |
| 3354 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3355 | # Tests for renegotiation |
| 3356 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3357 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3358 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3359 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3360 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3361 | 0 \ |
| 3362 | -C "client hello, adding renegotiation extension" \ |
| 3363 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3364 | -S "found renegotiation extension" \ |
| 3365 | -s "server hello, secure renegotiation extension" \ |
| 3366 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3367 | -C "=> renegotiate" \ |
| 3368 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3369 | -S "write hello request" |
| 3370 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3372 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3373 | "$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] | 3374 | "$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] | 3375 | 0 \ |
| 3376 | -c "client hello, adding renegotiation extension" \ |
| 3377 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3378 | -s "found renegotiation extension" \ |
| 3379 | -s "server hello, secure renegotiation extension" \ |
| 3380 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3381 | -c "=> renegotiate" \ |
| 3382 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3383 | -S "write hello request" |
| 3384 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3386 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3387 | "$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] | 3388 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3389 | 0 \ |
| 3390 | -c "client hello, adding renegotiation extension" \ |
| 3391 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3392 | -s "found renegotiation extension" \ |
| 3393 | -s "server hello, secure renegotiation extension" \ |
| 3394 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3395 | -c "=> renegotiate" \ |
| 3396 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3397 | -s "write hello request" |
| 3398 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3399 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3400 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3401 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3403 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3404 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3405 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3406 | 0 \ |
| 3407 | -c "client hello, adding renegotiation extension" \ |
| 3408 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3409 | -s "found renegotiation extension" \ |
| 3410 | -s "server hello, secure renegotiation extension" \ |
| 3411 | -c "found renegotiation extension" \ |
| 3412 | -c "=> renegotiate" \ |
| 3413 | -s "=> renegotiate" \ |
| 3414 | -S "write hello request" \ |
| 3415 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3416 | |
| 3417 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3418 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3419 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3420 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3421 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3422 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3423 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3424 | 0 \ |
| 3425 | -c "client hello, adding renegotiation extension" \ |
| 3426 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3427 | -s "found renegotiation extension" \ |
| 3428 | -s "server hello, secure renegotiation extension" \ |
| 3429 | -c "found renegotiation extension" \ |
| 3430 | -c "=> renegotiate" \ |
| 3431 | -s "=> renegotiate" \ |
| 3432 | -s "write hello request" \ |
| 3433 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3434 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3436 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3437 | "$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] | 3438 | "$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] | 3439 | 0 \ |
| 3440 | -c "client hello, adding renegotiation extension" \ |
| 3441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3442 | -s "found renegotiation extension" \ |
| 3443 | -s "server hello, secure renegotiation extension" \ |
| 3444 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3445 | -c "=> renegotiate" \ |
| 3446 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3447 | -s "write hello request" |
| 3448 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3451 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3452 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3453 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3454 | 0 \ |
| 3455 | -c "Maximum input fragment length is 2048" \ |
| 3456 | -c "Maximum output fragment length is 2048" \ |
| 3457 | -s "Maximum input fragment length is 2048" \ |
| 3458 | -s "Maximum output fragment length is 512" \ |
| 3459 | -c "client hello, adding max_fragment_length extension" \ |
| 3460 | -s "found max fragment length extension" \ |
| 3461 | -s "server hello, max_fragment_length extension" \ |
| 3462 | -c "found max_fragment_length extension" \ |
| 3463 | -c "client hello, adding renegotiation extension" \ |
| 3464 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3465 | -s "found renegotiation extension" \ |
| 3466 | -s "server hello, secure renegotiation extension" \ |
| 3467 | -c "found renegotiation extension" \ |
| 3468 | -c "=> renegotiate" \ |
| 3469 | -s "=> renegotiate" \ |
| 3470 | -s "write hello request" |
| 3471 | |
| 3472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3473 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3474 | "$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] | 3475 | "$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] | 3476 | 1 \ |
| 3477 | -c "client hello, adding renegotiation extension" \ |
| 3478 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3479 | -S "found renegotiation extension" \ |
| 3480 | -s "server hello, secure renegotiation extension" \ |
| 3481 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3482 | -c "=> renegotiate" \ |
| 3483 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3484 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3485 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3486 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3487 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3489 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3490 | "$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] | 3491 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3492 | 0 \ |
| 3493 | -C "client hello, adding renegotiation extension" \ |
| 3494 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3495 | -S "found renegotiation extension" \ |
| 3496 | -s "server hello, secure renegotiation extension" \ |
| 3497 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3498 | -C "=> renegotiate" \ |
| 3499 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3500 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3501 | -S "SSL - An unexpected message was received from our peer" \ |
| 3502 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3503 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3505 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3506 | "$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] | 3507 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3508 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3509 | 0 \ |
| 3510 | -C "client hello, adding renegotiation extension" \ |
| 3511 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3512 | -S "found renegotiation extension" \ |
| 3513 | -s "server hello, secure renegotiation extension" \ |
| 3514 | -c "found renegotiation extension" \ |
| 3515 | -C "=> renegotiate" \ |
| 3516 | -S "=> renegotiate" \ |
| 3517 | -s "write hello request" \ |
| 3518 | -S "SSL - An unexpected message was received from our peer" \ |
| 3519 | -S "failed" |
| 3520 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3521 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3523 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3524 | "$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] | 3525 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3526 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3527 | 0 \ |
| 3528 | -C "client hello, adding renegotiation extension" \ |
| 3529 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3530 | -S "found renegotiation extension" \ |
| 3531 | -s "server hello, secure renegotiation extension" \ |
| 3532 | -c "found renegotiation extension" \ |
| 3533 | -C "=> renegotiate" \ |
| 3534 | -S "=> renegotiate" \ |
| 3535 | -s "write hello request" \ |
| 3536 | -S "SSL - An unexpected message was received from our peer" \ |
| 3537 | -S "failed" |
| 3538 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3540 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3541 | "$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] | 3542 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3543 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3544 | 0 \ |
| 3545 | -C "client hello, adding renegotiation extension" \ |
| 3546 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3547 | -S "found renegotiation extension" \ |
| 3548 | -s "server hello, secure renegotiation extension" \ |
| 3549 | -c "found renegotiation extension" \ |
| 3550 | -C "=> renegotiate" \ |
| 3551 | -S "=> renegotiate" \ |
| 3552 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3553 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3554 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3555 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3556 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3557 | "$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] | 3558 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3559 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3560 | 0 \ |
| 3561 | -c "client hello, adding renegotiation extension" \ |
| 3562 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3563 | -s "found renegotiation extension" \ |
| 3564 | -s "server hello, secure renegotiation extension" \ |
| 3565 | -c "found renegotiation extension" \ |
| 3566 | -c "=> renegotiate" \ |
| 3567 | -s "=> renegotiate" \ |
| 3568 | -s "write hello request" \ |
| 3569 | -S "SSL - An unexpected message was received from our peer" \ |
| 3570 | -S "failed" |
| 3571 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3573 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3574 | "$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] | 3575 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3576 | 0 \ |
| 3577 | -C "client hello, adding renegotiation extension" \ |
| 3578 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3579 | -S "found renegotiation extension" \ |
| 3580 | -s "server hello, secure renegotiation extension" \ |
| 3581 | -c "found renegotiation extension" \ |
| 3582 | -S "record counter limit reached: renegotiate" \ |
| 3583 | -C "=> renegotiate" \ |
| 3584 | -S "=> renegotiate" \ |
| 3585 | -S "write hello request" \ |
| 3586 | -S "SSL - An unexpected message was received from our peer" \ |
| 3587 | -S "failed" |
| 3588 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3589 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3591 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3592 | "$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] | 3593 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3594 | 0 \ |
| 3595 | -c "client hello, adding renegotiation extension" \ |
| 3596 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3597 | -s "found renegotiation extension" \ |
| 3598 | -s "server hello, secure renegotiation extension" \ |
| 3599 | -c "found renegotiation extension" \ |
| 3600 | -s "record counter limit reached: renegotiate" \ |
| 3601 | -c "=> renegotiate" \ |
| 3602 | -s "=> renegotiate" \ |
| 3603 | -s "write hello request" \ |
| 3604 | -S "SSL - An unexpected message was received from our peer" \ |
| 3605 | -S "failed" |
| 3606 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3608 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3609 | "$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] | 3610 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3611 | 0 \ |
| 3612 | -c "client hello, adding renegotiation extension" \ |
| 3613 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3614 | -s "found renegotiation extension" \ |
| 3615 | -s "server hello, secure renegotiation extension" \ |
| 3616 | -c "found renegotiation extension" \ |
| 3617 | -s "record counter limit reached: renegotiate" \ |
| 3618 | -c "=> renegotiate" \ |
| 3619 | -s "=> renegotiate" \ |
| 3620 | -s "write hello request" \ |
| 3621 | -S "SSL - An unexpected message was received from our peer" \ |
| 3622 | -S "failed" |
| 3623 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3625 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3626 | "$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] | 3627 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3628 | 0 \ |
| 3629 | -C "client hello, adding renegotiation extension" \ |
| 3630 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3631 | -S "found renegotiation extension" \ |
| 3632 | -s "server hello, secure renegotiation extension" \ |
| 3633 | -c "found renegotiation extension" \ |
| 3634 | -S "record counter limit reached: renegotiate" \ |
| 3635 | -C "=> renegotiate" \ |
| 3636 | -S "=> renegotiate" \ |
| 3637 | -S "write hello request" \ |
| 3638 | -S "SSL - An unexpected message was received from our peer" \ |
| 3639 | -S "failed" |
| 3640 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3642 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3643 | "$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] | 3644 | "$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] | 3645 | 0 \ |
| 3646 | -c "client hello, adding renegotiation extension" \ |
| 3647 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3648 | -s "found renegotiation extension" \ |
| 3649 | -s "server hello, secure renegotiation extension" \ |
| 3650 | -c "found renegotiation extension" \ |
| 3651 | -c "=> renegotiate" \ |
| 3652 | -s "=> renegotiate" \ |
| 3653 | -S "write hello request" |
| 3654 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3655 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3656 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3657 | "$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] | 3658 | "$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] | 3659 | 0 \ |
| 3660 | -c "client hello, adding renegotiation extension" \ |
| 3661 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3662 | -s "found renegotiation extension" \ |
| 3663 | -s "server hello, secure renegotiation extension" \ |
| 3664 | -c "found renegotiation extension" \ |
| 3665 | -c "=> renegotiate" \ |
| 3666 | -s "=> renegotiate" \ |
| 3667 | -s "write hello request" |
| 3668 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3669 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3670 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3671 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3672 | "$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] | 3673 | 0 \ |
| 3674 | -c "client hello, adding renegotiation extension" \ |
| 3675 | -c "found renegotiation extension" \ |
| 3676 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3677 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3678 | -C "error" \ |
| 3679 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3680 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3681 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3683 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3684 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3685 | "$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] | 3686 | 0 \ |
| 3687 | -c "client hello, adding renegotiation extension" \ |
| 3688 | -c "found renegotiation extension" \ |
| 3689 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3690 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3691 | -C "error" \ |
| 3692 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3693 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3694 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3695 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3696 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3697 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3698 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3699 | 1 \ |
| 3700 | -c "client hello, adding renegotiation extension" \ |
| 3701 | -C "found renegotiation extension" \ |
| 3702 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3703 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3704 | -c "error" \ |
| 3705 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3706 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3707 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3709 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3710 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3711 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3712 | allow_legacy=0" \ |
| 3713 | 1 \ |
| 3714 | -c "client hello, adding renegotiation extension" \ |
| 3715 | -C "found renegotiation extension" \ |
| 3716 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3717 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3718 | -c "error" \ |
| 3719 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3720 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3721 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3723 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3724 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3725 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3726 | allow_legacy=1" \ |
| 3727 | 0 \ |
| 3728 | -c "client hello, adding renegotiation extension" \ |
| 3729 | -C "found renegotiation extension" \ |
| 3730 | -c "=> renegotiate" \ |
| 3731 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3732 | -C "error" \ |
| 3733 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3734 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3736 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3737 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3738 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3739 | 0 \ |
| 3740 | -c "client hello, adding renegotiation extension" \ |
| 3741 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3742 | -s "found renegotiation extension" \ |
| 3743 | -s "server hello, secure renegotiation extension" \ |
| 3744 | -c "found renegotiation extension" \ |
| 3745 | -c "=> renegotiate" \ |
| 3746 | -s "=> renegotiate" \ |
| 3747 | -S "write hello request" |
| 3748 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3750 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3751 | "$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] | 3752 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3753 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3754 | 0 \ |
| 3755 | -c "client hello, adding renegotiation extension" \ |
| 3756 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3757 | -s "found renegotiation extension" \ |
| 3758 | -s "server hello, secure renegotiation extension" \ |
| 3759 | -c "found renegotiation extension" \ |
| 3760 | -c "=> renegotiate" \ |
| 3761 | -s "=> renegotiate" \ |
| 3762 | -s "write hello request" |
| 3763 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3764 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3765 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3766 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3767 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3768 | 0 \ |
| 3769 | -c "client hello, adding renegotiation extension" \ |
| 3770 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3771 | -s "found renegotiation extension" \ |
| 3772 | -s "server hello, secure renegotiation extension" \ |
| 3773 | -s "record counter limit reached: renegotiate" \ |
| 3774 | -c "=> renegotiate" \ |
| 3775 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3776 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3777 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3778 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3779 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3780 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3781 | "$G_SRV -u --mtu 4096" \ |
| 3782 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3783 | 0 \ |
| 3784 | -c "client hello, adding renegotiation extension" \ |
| 3785 | -c "found renegotiation extension" \ |
| 3786 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3787 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3788 | -C "error" \ |
| 3789 | -s "Extra-header:" |
| 3790 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3791 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3792 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3793 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3794 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3795 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3796 | "$P_CLI debug_level=3" \ |
| 3797 | 0 \ |
| 3798 | -c "found renegotiation extension" \ |
| 3799 | -C "error" \ |
| 3800 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3801 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3802 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3803 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3804 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3805 | "$P_CLI debug_level=3" \ |
| 3806 | 0 \ |
| 3807 | -C "found renegotiation extension" \ |
| 3808 | -C "error" \ |
| 3809 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3810 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3811 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3812 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3813 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3814 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3815 | 1 \ |
| 3816 | -C "found renegotiation extension" \ |
| 3817 | -c "error" \ |
| 3818 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3819 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3820 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3821 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3822 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3823 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3824 | 0 \ |
| 3825 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3826 | -s "server hello, secure renegotiation extension" |
| 3827 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3828 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3829 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3830 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3831 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3832 | 0 \ |
| 3833 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3834 | -S "server hello, secure renegotiation extension" |
| 3835 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3836 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3837 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3838 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3839 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3840 | 1 \ |
| 3841 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3842 | -S "server hello, secure renegotiation extension" |
| 3843 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3844 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3845 | |
| 3846 | requires_gnutls |
| 3847 | run_test "DER format: no trailing bytes" \ |
| 3848 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3849 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3850 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3851 | 0 \ |
| 3852 | -c "Handshake was completed" \ |
| 3853 | |
| 3854 | requires_gnutls |
| 3855 | run_test "DER format: with a trailing zero byte" \ |
| 3856 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3857 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3858 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3859 | 0 \ |
| 3860 | -c "Handshake was completed" \ |
| 3861 | |
| 3862 | requires_gnutls |
| 3863 | run_test "DER format: with a trailing random byte" \ |
| 3864 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3865 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3866 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -c "Handshake was completed" \ |
| 3869 | |
| 3870 | requires_gnutls |
| 3871 | run_test "DER format: with 2 trailing random bytes" \ |
| 3872 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3873 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3874 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3875 | 0 \ |
| 3876 | -c "Handshake was completed" \ |
| 3877 | |
| 3878 | requires_gnutls |
| 3879 | run_test "DER format: with 4 trailing random bytes" \ |
| 3880 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3881 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3882 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -c "Handshake was completed" \ |
| 3885 | |
| 3886 | requires_gnutls |
| 3887 | run_test "DER format: with 8 trailing random bytes" \ |
| 3888 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3889 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3890 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3891 | 0 \ |
| 3892 | -c "Handshake was completed" \ |
| 3893 | |
| 3894 | requires_gnutls |
| 3895 | run_test "DER format: with 9 trailing random bytes" \ |
| 3896 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3897 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3898 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3899 | 0 \ |
| 3900 | -c "Handshake was completed" \ |
| 3901 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3902 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3903 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3905 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3906 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3907 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3908 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3909 | 1 \ |
| 3910 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3911 | -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] | 3912 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3913 | -c "X509 - Certificate verification failed" |
| 3914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3915 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3916 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3917 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3918 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3919 | 0 \ |
| 3920 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3921 | -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] | 3922 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3923 | -C "X509 - Certificate verification failed" |
| 3924 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3925 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3926 | "$P_SRV" \ |
| 3927 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3928 | 0 \ |
| 3929 | -c "x509_verify_cert() returned" \ |
| 3930 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3931 | -c "! Certificate verification flags"\ |
| 3932 | -C "! mbedtls_ssl_handshake returned" \ |
| 3933 | -C "X509 - Certificate verification failed" \ |
| 3934 | -C "SSL - No CA Chain is set, but required to operate" |
| 3935 | |
| 3936 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3937 | "$P_SRV" \ |
| 3938 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3939 | 1 \ |
| 3940 | -c "x509_verify_cert() returned" \ |
| 3941 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3942 | -c "! Certificate verification flags"\ |
| 3943 | -c "! mbedtls_ssl_handshake returned" \ |
| 3944 | -c "SSL - No CA Chain is set, but required to operate" |
| 3945 | |
| 3946 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3947 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3948 | # the client informs the server about the supported curves - it does, though, in the |
| 3949 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3950 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3951 | # different means to have the server ignoring the client's supported curve list. |
| 3952 | |
| 3953 | requires_config_enabled MBEDTLS_ECP_C |
| 3954 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3955 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3956 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3957 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3958 | 1 \ |
| 3959 | -c "bad certificate (EC key curve)"\ |
| 3960 | -c "! Certificate verification flags"\ |
| 3961 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3962 | |
| 3963 | requires_config_enabled MBEDTLS_ECP_C |
| 3964 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3965 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3966 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3967 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3968 | 1 \ |
| 3969 | -c "bad certificate (EC key curve)"\ |
| 3970 | -c "! Certificate verification flags"\ |
| 3971 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3972 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3973 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3974 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3975 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3976 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3977 | 0 \ |
| 3978 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3979 | -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] | 3980 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3981 | -C "X509 - Certificate verification failed" |
| 3982 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3983 | run_test "Authentication: client SHA256, server required" \ |
| 3984 | "$P_SRV auth_mode=required" \ |
| 3985 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3986 | key_file=data_files/server6.key \ |
| 3987 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3988 | 0 \ |
| 3989 | -c "Supported Signature Algorithm found: 4," \ |
| 3990 | -c "Supported Signature Algorithm found: 5," |
| 3991 | |
| 3992 | run_test "Authentication: client SHA384, server required" \ |
| 3993 | "$P_SRV auth_mode=required" \ |
| 3994 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3995 | key_file=data_files/server6.key \ |
| 3996 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3997 | 0 \ |
| 3998 | -c "Supported Signature Algorithm found: 4," \ |
| 3999 | -c "Supported Signature Algorithm found: 5," |
| 4000 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4001 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4002 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4003 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4004 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4005 | key_file=data_files/server5.key" \ |
| 4006 | 1 \ |
| 4007 | -S "skip write certificate request" \ |
| 4008 | -C "skip parse certificate request" \ |
| 4009 | -c "got a certificate request" \ |
| 4010 | -c "got no certificate to send" \ |
| 4011 | -S "x509_verify_cert() returned" \ |
| 4012 | -s "client has no certificate" \ |
| 4013 | -s "! mbedtls_ssl_handshake returned" \ |
| 4014 | -c "! mbedtls_ssl_handshake returned" \ |
| 4015 | -s "No client certification received from the client, but required by the authentication mode" |
| 4016 | |
| 4017 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4018 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4019 | "$P_CLI debug_level=3 crt_file=none \ |
| 4020 | key_file=data_files/server5.key" \ |
| 4021 | 1 \ |
| 4022 | -S "skip write certificate request" \ |
| 4023 | -C "skip parse certificate request" \ |
| 4024 | -c "got a certificate request" \ |
| 4025 | -c "= write certificate$" \ |
| 4026 | -C "skip write certificate$" \ |
| 4027 | -S "x509_verify_cert() returned" \ |
| 4028 | -s "client has no certificate" \ |
| 4029 | -s "! mbedtls_ssl_handshake returned" \ |
| 4030 | -c "! mbedtls_ssl_handshake returned" \ |
| 4031 | -s "No client certification received from the client, but required by the authentication mode" |
| 4032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4033 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4034 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4035 | "$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] | 4036 | key_file=data_files/server5.key" \ |
| 4037 | 1 \ |
| 4038 | -S "skip write certificate request" \ |
| 4039 | -C "skip parse certificate request" \ |
| 4040 | -c "got a certificate request" \ |
| 4041 | -C "skip write certificate" \ |
| 4042 | -C "skip write certificate verify" \ |
| 4043 | -S "skip parse certificate verify" \ |
| 4044 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4045 | -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] | 4046 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4047 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4048 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4049 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4050 | # We don't check that the client receives the alert because it might |
| 4051 | # detect that its write end of the connection is closed and abort |
| 4052 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4053 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4054 | run_test "Authentication: client cert not trusted, server required" \ |
| 4055 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4056 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4057 | key_file=data_files/server5.key" \ |
| 4058 | 1 \ |
| 4059 | -S "skip write certificate request" \ |
| 4060 | -C "skip parse certificate request" \ |
| 4061 | -c "got a certificate request" \ |
| 4062 | -C "skip write certificate" \ |
| 4063 | -C "skip write certificate verify" \ |
| 4064 | -S "skip parse certificate verify" \ |
| 4065 | -s "x509_verify_cert() returned" \ |
| 4066 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4067 | -s "! mbedtls_ssl_handshake returned" \ |
| 4068 | -c "! mbedtls_ssl_handshake returned" \ |
| 4069 | -s "X509 - Certificate verification failed" |
| 4070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4071 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4072 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4073 | "$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] | 4074 | key_file=data_files/server5.key" \ |
| 4075 | 0 \ |
| 4076 | -S "skip write certificate request" \ |
| 4077 | -C "skip parse certificate request" \ |
| 4078 | -c "got a certificate request" \ |
| 4079 | -C "skip write certificate" \ |
| 4080 | -C "skip write certificate verify" \ |
| 4081 | -S "skip parse certificate verify" \ |
| 4082 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4083 | -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] | 4084 | -S "! mbedtls_ssl_handshake returned" \ |
| 4085 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4086 | -S "X509 - Certificate verification failed" |
| 4087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4088 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4089 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4090 | "$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] | 4091 | key_file=data_files/server5.key" \ |
| 4092 | 0 \ |
| 4093 | -s "skip write certificate request" \ |
| 4094 | -C "skip parse certificate request" \ |
| 4095 | -c "got no certificate request" \ |
| 4096 | -c "skip write certificate" \ |
| 4097 | -c "skip write certificate verify" \ |
| 4098 | -s "skip parse certificate verify" \ |
| 4099 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4100 | -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] | 4101 | -S "! mbedtls_ssl_handshake returned" \ |
| 4102 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4103 | -S "X509 - Certificate verification failed" |
| 4104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4106 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4107 | "$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] | 4108 | 0 \ |
| 4109 | -S "skip write certificate request" \ |
| 4110 | -C "skip parse certificate request" \ |
| 4111 | -c "got a certificate request" \ |
| 4112 | -C "skip write certificate$" \ |
| 4113 | -C "got no certificate to send" \ |
| 4114 | -S "SSLv3 client has no certificate" \ |
| 4115 | -c "skip write certificate verify" \ |
| 4116 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4117 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4118 | -S "! mbedtls_ssl_handshake returned" \ |
| 4119 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4120 | -S "X509 - Certificate verification failed" |
| 4121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4122 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4123 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4124 | "$O_CLI" \ |
| 4125 | 0 \ |
| 4126 | -S "skip write certificate request" \ |
| 4127 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4128 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4129 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4130 | -S "X509 - Certificate verification failed" |
| 4131 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4132 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4133 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4134 | "$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] | 4135 | 0 \ |
| 4136 | -C "skip parse certificate request" \ |
| 4137 | -c "got a certificate request" \ |
| 4138 | -C "skip write certificate$" \ |
| 4139 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4140 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4141 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4142 | run_test "Authentication: client no cert, openssl server required" \ |
| 4143 | "$O_SRV -Verify 10" \ |
| 4144 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4145 | 1 \ |
| 4146 | -C "skip parse certificate request" \ |
| 4147 | -c "got a certificate request" \ |
| 4148 | -C "skip write certificate$" \ |
| 4149 | -c "skip write certificate verify" \ |
| 4150 | -c "! mbedtls_ssl_handshake returned" |
| 4151 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4152 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4153 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4154 | "$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] | 4155 | "$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] | 4156 | 0 \ |
| 4157 | -S "skip write certificate request" \ |
| 4158 | -C "skip parse certificate request" \ |
| 4159 | -c "got a certificate request" \ |
| 4160 | -C "skip write certificate$" \ |
| 4161 | -c "skip write certificate verify" \ |
| 4162 | -c "got no certificate to send" \ |
| 4163 | -s "SSLv3 client has no certificate" \ |
| 4164 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4165 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4166 | -S "! mbedtls_ssl_handshake returned" \ |
| 4167 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4168 | -S "X509 - Certificate verification failed" |
| 4169 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4170 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 4171 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4172 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4173 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4174 | 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] | 4175 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4176 | 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] | 4177 | 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] | 4178 | 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] | 4179 | printf "test value of ${MAX_IM_CA}. \n" |
| 4180 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4181 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 4182 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4183 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4184 | |
| 4185 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4186 | fi |
| 4187 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4188 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4189 | run_test "Authentication: server max_int chain, client default" \ |
| 4190 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4191 | key_file=data_files/dir-maxpath/09.key" \ |
| 4192 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4193 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4194 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4195 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4196 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4197 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4198 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4199 | key_file=data_files/dir-maxpath/10.key" \ |
| 4200 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4201 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4202 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4203 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4204 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4205 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4206 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4207 | key_file=data_files/dir-maxpath/10.key" \ |
| 4208 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4209 | auth_mode=optional" \ |
| 4210 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4211 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4212 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4213 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4214 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4215 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4216 | key_file=data_files/dir-maxpath/10.key" \ |
| 4217 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4218 | auth_mode=none" \ |
| 4219 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4220 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4221 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4222 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4223 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4224 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4225 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4226 | key_file=data_files/dir-maxpath/10.key" \ |
| 4227 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4228 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4229 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4230 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4231 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4232 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4233 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4234 | key_file=data_files/dir-maxpath/10.key" \ |
| 4235 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4236 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4237 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4238 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4239 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4240 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4241 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4242 | key_file=data_files/dir-maxpath/10.key" \ |
| 4243 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4244 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4245 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4246 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4247 | run_test "Authentication: client max_int chain, server required" \ |
| 4248 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4249 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4250 | key_file=data_files/dir-maxpath/09.key" \ |
| 4251 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4252 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4253 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4254 | # Tests for CA list in CertificateRequest messages |
| 4255 | |
| 4256 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4257 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4258 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4259 | key_file=data_files/server6.key" \ |
| 4260 | 0 \ |
| 4261 | -s "requested DN" |
| 4262 | |
| 4263 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4264 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4265 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4266 | key_file=data_files/server6.key" \ |
| 4267 | 0 \ |
| 4268 | -S "requested DN" |
| 4269 | |
| 4270 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4271 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4272 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4273 | key_file=data_files/server5.key" \ |
| 4274 | 1 \ |
| 4275 | -S "requested DN" \ |
| 4276 | -s "x509_verify_cert() returned" \ |
| 4277 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4278 | -s "! mbedtls_ssl_handshake returned" \ |
| 4279 | -c "! mbedtls_ssl_handshake returned" \ |
| 4280 | -s "X509 - Certificate verification failed" |
| 4281 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4282 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4283 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4284 | |
| 4285 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4286 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4287 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4288 | key_file=data_files/server5.key" \ |
| 4289 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4290 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4291 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4292 | -c "x509_verify_cert() returned" \ |
| 4293 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4294 | -c "! mbedtls_ssl_handshake returned" \ |
| 4295 | -c "X509 - Certificate verification failed" |
| 4296 | |
| 4297 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4298 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4299 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4300 | key_file=data_files/server5.key" \ |
| 4301 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4302 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4303 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4304 | -c "x509_verify_cert() returned" \ |
| 4305 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4306 | -C "! mbedtls_ssl_handshake returned" \ |
| 4307 | -C "X509 - Certificate verification failed" |
| 4308 | |
| 4309 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4310 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4311 | # the client informs the server about the supported curves - it does, though, in the |
| 4312 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4313 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4314 | # different means to have the server ignoring the client's supported curve list. |
| 4315 | |
| 4316 | requires_config_enabled MBEDTLS_ECP_C |
| 4317 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4318 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4319 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4320 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4321 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4322 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4323 | -c "use CA callback for X.509 CRT verification" \ |
| 4324 | -c "bad certificate (EC key curve)" \ |
| 4325 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4326 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4327 | |
| 4328 | requires_config_enabled MBEDTLS_ECP_C |
| 4329 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4330 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4331 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4332 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4333 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4334 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4335 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4336 | -c "bad certificate (EC key curve)"\ |
| 4337 | -c "! Certificate verification flags"\ |
| 4338 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4339 | |
| 4340 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4341 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4342 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4343 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4344 | key_file=data_files/server6.key \ |
| 4345 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4346 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4347 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4348 | -c "Supported Signature Algorithm found: 4," \ |
| 4349 | -c "Supported Signature Algorithm found: 5," |
| 4350 | |
| 4351 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4352 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4353 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4354 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4355 | key_file=data_files/server6.key \ |
| 4356 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4357 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4358 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4359 | -c "Supported Signature Algorithm found: 4," \ |
| 4360 | -c "Supported Signature Algorithm found: 5," |
| 4361 | |
| 4362 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4363 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4364 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4365 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4366 | key_file=data_files/server5.key" \ |
| 4367 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4368 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4369 | -S "skip write certificate request" \ |
| 4370 | -C "skip parse certificate request" \ |
| 4371 | -c "got a certificate request" \ |
| 4372 | -C "skip write certificate" \ |
| 4373 | -C "skip write certificate verify" \ |
| 4374 | -S "skip parse certificate verify" \ |
| 4375 | -s "x509_verify_cert() returned" \ |
| 4376 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4377 | -s "! mbedtls_ssl_handshake returned" \ |
| 4378 | -s "send alert level=2 message=48" \ |
| 4379 | -c "! mbedtls_ssl_handshake returned" \ |
| 4380 | -s "X509 - Certificate verification failed" |
| 4381 | # We don't check that the client receives the alert because it might |
| 4382 | # detect that its write end of the connection is closed and abort |
| 4383 | # before reading the alert message. |
| 4384 | |
| 4385 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4386 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4387 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4388 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4389 | key_file=data_files/server5.key" \ |
| 4390 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4391 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4392 | -S "skip write certificate request" \ |
| 4393 | -C "skip parse certificate request" \ |
| 4394 | -c "got a certificate request" \ |
| 4395 | -C "skip write certificate" \ |
| 4396 | -C "skip write certificate verify" \ |
| 4397 | -S "skip parse certificate verify" \ |
| 4398 | -s "x509_verify_cert() returned" \ |
| 4399 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4400 | -s "! mbedtls_ssl_handshake returned" \ |
| 4401 | -c "! mbedtls_ssl_handshake returned" \ |
| 4402 | -s "X509 - Certificate verification failed" |
| 4403 | |
| 4404 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4405 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4406 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4407 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4408 | key_file=data_files/server5.key" \ |
| 4409 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4410 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4411 | -S "skip write certificate request" \ |
| 4412 | -C "skip parse certificate request" \ |
| 4413 | -c "got a certificate request" \ |
| 4414 | -C "skip write certificate" \ |
| 4415 | -C "skip write certificate verify" \ |
| 4416 | -S "skip parse certificate verify" \ |
| 4417 | -s "x509_verify_cert() returned" \ |
| 4418 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4419 | -S "! mbedtls_ssl_handshake returned" \ |
| 4420 | -C "! mbedtls_ssl_handshake returned" \ |
| 4421 | -S "X509 - Certificate verification failed" |
| 4422 | |
| 4423 | requires_full_size_output_buffer |
| 4424 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4425 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4426 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4427 | key_file=data_files/dir-maxpath/09.key" \ |
| 4428 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4429 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4430 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4431 | -C "X509 - A fatal error occurred" |
| 4432 | |
| 4433 | requires_full_size_output_buffer |
| 4434 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4435 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4436 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4437 | key_file=data_files/dir-maxpath/10.key" \ |
| 4438 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4439 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4440 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4441 | -c "X509 - A fatal error occurred" |
| 4442 | |
| 4443 | requires_full_size_output_buffer |
| 4444 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4445 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4446 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4447 | key_file=data_files/dir-maxpath/10.key" \ |
| 4448 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4449 | debug_level=3 auth_mode=optional" \ |
| 4450 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4451 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4452 | -c "X509 - A fatal error occurred" |
| 4453 | |
| 4454 | requires_full_size_output_buffer |
| 4455 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4456 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4457 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4458 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4459 | key_file=data_files/dir-maxpath/10.key" \ |
| 4460 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4461 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4462 | -s "X509 - A fatal error occurred" |
| 4463 | |
| 4464 | requires_full_size_output_buffer |
| 4465 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4466 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4467 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4468 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4469 | key_file=data_files/dir-maxpath/10.key" \ |
| 4470 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4471 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4472 | -s "X509 - A fatal error occurred" |
| 4473 | |
| 4474 | requires_full_size_output_buffer |
| 4475 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4476 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4477 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4478 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4479 | key_file=data_files/dir-maxpath/09.key" \ |
| 4480 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4481 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4482 | -S "X509 - A fatal error occurred" |
| 4483 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4484 | # Tests for certificate selection based on SHA verson |
| 4485 | |
| 4486 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4487 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4488 | key_file=data_files/server5.key \ |
| 4489 | crt_file2=data_files/server5-sha1.crt \ |
| 4490 | key_file2=data_files/server5.key" \ |
| 4491 | "$P_CLI force_version=tls1_2" \ |
| 4492 | 0 \ |
| 4493 | -c "signed using.*ECDSA with SHA256" \ |
| 4494 | -C "signed using.*ECDSA with SHA1" |
| 4495 | |
| 4496 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4497 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4498 | key_file=data_files/server5.key \ |
| 4499 | crt_file2=data_files/server5-sha1.crt \ |
| 4500 | key_file2=data_files/server5.key" \ |
| 4501 | "$P_CLI force_version=tls1_1" \ |
| 4502 | 0 \ |
| 4503 | -C "signed using.*ECDSA with SHA256" \ |
| 4504 | -c "signed using.*ECDSA with SHA1" |
| 4505 | |
| 4506 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4507 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4508 | key_file=data_files/server5.key \ |
| 4509 | crt_file2=data_files/server5-sha1.crt \ |
| 4510 | key_file2=data_files/server5.key" \ |
| 4511 | "$P_CLI force_version=tls1" \ |
| 4512 | 0 \ |
| 4513 | -C "signed using.*ECDSA with SHA256" \ |
| 4514 | -c "signed using.*ECDSA with SHA1" |
| 4515 | |
| 4516 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4517 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4518 | key_file=data_files/server5.key \ |
| 4519 | crt_file2=data_files/server6.crt \ |
| 4520 | key_file2=data_files/server6.key" \ |
| 4521 | "$P_CLI force_version=tls1_1" \ |
| 4522 | 0 \ |
| 4523 | -c "serial number.*09" \ |
| 4524 | -c "signed using.*ECDSA with SHA256" \ |
| 4525 | -C "signed using.*ECDSA with SHA1" |
| 4526 | |
| 4527 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4528 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4529 | key_file=data_files/server6.key \ |
| 4530 | crt_file2=data_files/server5.crt \ |
| 4531 | key_file2=data_files/server5.key" \ |
| 4532 | "$P_CLI force_version=tls1_1" \ |
| 4533 | 0 \ |
| 4534 | -c "serial number.*0A" \ |
| 4535 | -c "signed using.*ECDSA with SHA256" \ |
| 4536 | -C "signed using.*ECDSA with SHA1" |
| 4537 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4538 | # tests for SNI |
| 4539 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4540 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4541 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4542 | 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] | 4543 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4544 | 0 \ |
| 4545 | -S "parse ServerName extension" \ |
| 4546 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4547 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4548 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4549 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4550 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4551 | 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] | 4552 | 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] | 4553 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4554 | 0 \ |
| 4555 | -s "parse ServerName extension" \ |
| 4556 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4557 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4558 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4559 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4560 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4561 | 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] | 4562 | 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] | 4563 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4564 | 0 \ |
| 4565 | -s "parse ServerName extension" \ |
| 4566 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4567 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4568 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4569 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4570 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4571 | 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] | 4572 | 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] | 4573 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4574 | 1 \ |
| 4575 | -s "parse ServerName extension" \ |
| 4576 | -s "ssl_sni_wrapper() returned" \ |
| 4577 | -s "mbedtls_ssl_handshake returned" \ |
| 4578 | -c "mbedtls_ssl_handshake returned" \ |
| 4579 | -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] | 4580 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4581 | run_test "SNI: client auth no override: optional" \ |
| 4582 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4583 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4584 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4585 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4586 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4587 | -S "skip write certificate request" \ |
| 4588 | -C "skip parse certificate request" \ |
| 4589 | -c "got a certificate request" \ |
| 4590 | -C "skip write certificate" \ |
| 4591 | -C "skip write certificate verify" \ |
| 4592 | -S "skip parse certificate verify" |
| 4593 | |
| 4594 | run_test "SNI: client auth override: none -> optional" \ |
| 4595 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4596 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4597 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4598 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4599 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4600 | -S "skip write certificate request" \ |
| 4601 | -C "skip parse certificate request" \ |
| 4602 | -c "got a certificate request" \ |
| 4603 | -C "skip write certificate" \ |
| 4604 | -C "skip write certificate verify" \ |
| 4605 | -S "skip parse certificate verify" |
| 4606 | |
| 4607 | run_test "SNI: client auth override: optional -> none" \ |
| 4608 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4609 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4610 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4611 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4612 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4613 | -s "skip write certificate request" \ |
| 4614 | -C "skip parse certificate request" \ |
| 4615 | -c "got no certificate request" \ |
| 4616 | -c "skip write certificate" \ |
| 4617 | -c "skip write certificate verify" \ |
| 4618 | -s "skip parse certificate verify" |
| 4619 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4620 | run_test "SNI: CA no override" \ |
| 4621 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4622 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4623 | ca_file=data_files/test-ca.crt \ |
| 4624 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4625 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4626 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4627 | 1 \ |
| 4628 | -S "skip write certificate request" \ |
| 4629 | -C "skip parse certificate request" \ |
| 4630 | -c "got a certificate request" \ |
| 4631 | -C "skip write certificate" \ |
| 4632 | -C "skip write certificate verify" \ |
| 4633 | -S "skip parse certificate verify" \ |
| 4634 | -s "x509_verify_cert() returned" \ |
| 4635 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4636 | -S "The certificate has been revoked (is on a CRL)" |
| 4637 | |
| 4638 | run_test "SNI: CA override" \ |
| 4639 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4640 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4641 | ca_file=data_files/test-ca.crt \ |
| 4642 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4643 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4644 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4645 | 0 \ |
| 4646 | -S "skip write certificate request" \ |
| 4647 | -C "skip parse certificate request" \ |
| 4648 | -c "got a certificate request" \ |
| 4649 | -C "skip write certificate" \ |
| 4650 | -C "skip write certificate verify" \ |
| 4651 | -S "skip parse certificate verify" \ |
| 4652 | -S "x509_verify_cert() returned" \ |
| 4653 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4654 | -S "The certificate has been revoked (is on a CRL)" |
| 4655 | |
| 4656 | run_test "SNI: CA override with CRL" \ |
| 4657 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4658 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4659 | ca_file=data_files/test-ca.crt \ |
| 4660 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4661 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4662 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4663 | 1 \ |
| 4664 | -S "skip write certificate request" \ |
| 4665 | -C "skip parse certificate request" \ |
| 4666 | -c "got a certificate request" \ |
| 4667 | -C "skip write certificate" \ |
| 4668 | -C "skip write certificate verify" \ |
| 4669 | -S "skip parse certificate verify" \ |
| 4670 | -s "x509_verify_cert() returned" \ |
| 4671 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4672 | -s "The certificate has been revoked (is on a CRL)" |
| 4673 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4674 | # Tests for SNI and DTLS |
| 4675 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4676 | run_test "SNI: DTLS, no SNI callback" \ |
| 4677 | "$P_SRV debug_level=3 dtls=1 \ |
| 4678 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4679 | "$P_CLI server_name=localhost dtls=1" \ |
| 4680 | 0 \ |
| 4681 | -S "parse ServerName extension" \ |
| 4682 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4683 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4684 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4685 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4686 | "$P_SRV debug_level=3 dtls=1 \ |
| 4687 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4688 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4689 | "$P_CLI server_name=localhost dtls=1" \ |
| 4690 | 0 \ |
| 4691 | -s "parse ServerName extension" \ |
| 4692 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4693 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4694 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4695 | run_test "SNI: DTLS, matching cert 2" \ |
| 4696 | "$P_SRV debug_level=3 dtls=1 \ |
| 4697 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4698 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4699 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4700 | 0 \ |
| 4701 | -s "parse ServerName extension" \ |
| 4702 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4703 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4704 | |
| 4705 | run_test "SNI: DTLS, no matching cert" \ |
| 4706 | "$P_SRV debug_level=3 dtls=1 \ |
| 4707 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4708 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4709 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4710 | 1 \ |
| 4711 | -s "parse ServerName extension" \ |
| 4712 | -s "ssl_sni_wrapper() returned" \ |
| 4713 | -s "mbedtls_ssl_handshake returned" \ |
| 4714 | -c "mbedtls_ssl_handshake returned" \ |
| 4715 | -c "SSL - A fatal alert message was received from our peer" |
| 4716 | |
| 4717 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4718 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4719 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4720 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4721 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4722 | 0 \ |
| 4723 | -S "skip write certificate request" \ |
| 4724 | -C "skip parse certificate request" \ |
| 4725 | -c "got a certificate request" \ |
| 4726 | -C "skip write certificate" \ |
| 4727 | -C "skip write certificate verify" \ |
| 4728 | -S "skip parse certificate verify" |
| 4729 | |
| 4730 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4731 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4732 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4733 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4734 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4735 | 0 \ |
| 4736 | -S "skip write certificate request" \ |
| 4737 | -C "skip parse certificate request" \ |
| 4738 | -c "got a certificate request" \ |
| 4739 | -C "skip write certificate" \ |
| 4740 | -C "skip write certificate verify" \ |
| 4741 | -S "skip parse certificate verify" |
| 4742 | |
| 4743 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4744 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4745 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4746 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4747 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4748 | 0 \ |
| 4749 | -s "skip write certificate request" \ |
| 4750 | -C "skip parse certificate request" \ |
| 4751 | -c "got no certificate request" \ |
| 4752 | -c "skip write certificate" \ |
| 4753 | -c "skip write certificate verify" \ |
| 4754 | -s "skip parse certificate verify" |
| 4755 | |
| 4756 | run_test "SNI: DTLS, CA no override" \ |
| 4757 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4758 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4759 | ca_file=data_files/test-ca.crt \ |
| 4760 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4761 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4762 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4763 | 1 \ |
| 4764 | -S "skip write certificate request" \ |
| 4765 | -C "skip parse certificate request" \ |
| 4766 | -c "got a certificate request" \ |
| 4767 | -C "skip write certificate" \ |
| 4768 | -C "skip write certificate verify" \ |
| 4769 | -S "skip parse certificate verify" \ |
| 4770 | -s "x509_verify_cert() returned" \ |
| 4771 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4772 | -S "The certificate has been revoked (is on a CRL)" |
| 4773 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4774 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4775 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4776 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4777 | ca_file=data_files/test-ca.crt \ |
| 4778 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4779 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4780 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4781 | 0 \ |
| 4782 | -S "skip write certificate request" \ |
| 4783 | -C "skip parse certificate request" \ |
| 4784 | -c "got a certificate request" \ |
| 4785 | -C "skip write certificate" \ |
| 4786 | -C "skip write certificate verify" \ |
| 4787 | -S "skip parse certificate verify" \ |
| 4788 | -S "x509_verify_cert() returned" \ |
| 4789 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4790 | -S "The certificate has been revoked (is on a CRL)" |
| 4791 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4792 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4793 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4794 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4795 | ca_file=data_files/test-ca.crt \ |
| 4796 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4797 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4798 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4799 | 1 \ |
| 4800 | -S "skip write certificate request" \ |
| 4801 | -C "skip parse certificate request" \ |
| 4802 | -c "got a certificate request" \ |
| 4803 | -C "skip write certificate" \ |
| 4804 | -C "skip write certificate verify" \ |
| 4805 | -S "skip parse certificate verify" \ |
| 4806 | -s "x509_verify_cert() returned" \ |
| 4807 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4808 | -s "The certificate has been revoked (is on a CRL)" |
| 4809 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4810 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4811 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4812 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4813 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4814 | "$P_CLI nbio=2 tickets=0" \ |
| 4815 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4816 | -S "mbedtls_ssl_handshake returned" \ |
| 4817 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4818 | -c "Read from server: .* bytes read" |
| 4819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4820 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4821 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4822 | "$P_CLI nbio=2 tickets=0" \ |
| 4823 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4824 | -S "mbedtls_ssl_handshake returned" \ |
| 4825 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4826 | -c "Read from server: .* bytes read" |
| 4827 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4828 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4829 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4830 | "$P_CLI nbio=2 tickets=1" \ |
| 4831 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4832 | -S "mbedtls_ssl_handshake returned" \ |
| 4833 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4834 | -c "Read from server: .* bytes read" |
| 4835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4836 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4837 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4838 | "$P_CLI nbio=2 tickets=1" \ |
| 4839 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4840 | -S "mbedtls_ssl_handshake returned" \ |
| 4841 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4842 | -c "Read from server: .* bytes read" |
| 4843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4844 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4845 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4846 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4847 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4848 | -S "mbedtls_ssl_handshake returned" \ |
| 4849 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4850 | -c "Read from server: .* bytes read" |
| 4851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4852 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4853 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4854 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4855 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4856 | -S "mbedtls_ssl_handshake returned" \ |
| 4857 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4858 | -c "Read from server: .* bytes read" |
| 4859 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4860 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4861 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4862 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4863 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4864 | -S "mbedtls_ssl_handshake returned" \ |
| 4865 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4866 | -c "Read from server: .* bytes read" |
| 4867 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4868 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4869 | |
| 4870 | run_test "Event-driven I/O: basic handshake" \ |
| 4871 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4872 | "$P_CLI event=1 tickets=0" \ |
| 4873 | 0 \ |
| 4874 | -S "mbedtls_ssl_handshake returned" \ |
| 4875 | -C "mbedtls_ssl_handshake returned" \ |
| 4876 | -c "Read from server: .* bytes read" |
| 4877 | |
| 4878 | run_test "Event-driven I/O: client auth" \ |
| 4879 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4880 | "$P_CLI event=1 tickets=0" \ |
| 4881 | 0 \ |
| 4882 | -S "mbedtls_ssl_handshake returned" \ |
| 4883 | -C "mbedtls_ssl_handshake returned" \ |
| 4884 | -c "Read from server: .* bytes read" |
| 4885 | |
| 4886 | run_test "Event-driven I/O: ticket" \ |
| 4887 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4888 | "$P_CLI event=1 tickets=1" \ |
| 4889 | 0 \ |
| 4890 | -S "mbedtls_ssl_handshake returned" \ |
| 4891 | -C "mbedtls_ssl_handshake returned" \ |
| 4892 | -c "Read from server: .* bytes read" |
| 4893 | |
| 4894 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4895 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4896 | "$P_CLI event=1 tickets=1" \ |
| 4897 | 0 \ |
| 4898 | -S "mbedtls_ssl_handshake returned" \ |
| 4899 | -C "mbedtls_ssl_handshake returned" \ |
| 4900 | -c "Read from server: .* bytes read" |
| 4901 | |
| 4902 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4903 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4904 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4905 | 0 \ |
| 4906 | -S "mbedtls_ssl_handshake returned" \ |
| 4907 | -C "mbedtls_ssl_handshake returned" \ |
| 4908 | -c "Read from server: .* bytes read" |
| 4909 | |
| 4910 | run_test "Event-driven I/O: ticket + resume" \ |
| 4911 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4912 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4913 | 0 \ |
| 4914 | -S "mbedtls_ssl_handshake returned" \ |
| 4915 | -C "mbedtls_ssl_handshake returned" \ |
| 4916 | -c "Read from server: .* bytes read" |
| 4917 | |
| 4918 | run_test "Event-driven I/O: session-id resume" \ |
| 4919 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4920 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4921 | 0 \ |
| 4922 | -S "mbedtls_ssl_handshake returned" \ |
| 4923 | -C "mbedtls_ssl_handshake returned" \ |
| 4924 | -c "Read from server: .* bytes read" |
| 4925 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4926 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4927 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4928 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4929 | 0 \ |
| 4930 | -c "Read from server: .* bytes read" |
| 4931 | |
| 4932 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4933 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4934 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4935 | 0 \ |
| 4936 | -c "Read from server: .* bytes read" |
| 4937 | |
| 4938 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4939 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4940 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4941 | 0 \ |
| 4942 | -c "Read from server: .* bytes read" |
| 4943 | |
| 4944 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4945 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4946 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4947 | 0 \ |
| 4948 | -c "Read from server: .* bytes read" |
| 4949 | |
| 4950 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4951 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4952 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4953 | 0 \ |
| 4954 | -c "Read from server: .* bytes read" |
| 4955 | |
| 4956 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4957 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4958 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4959 | 0 \ |
| 4960 | -c "Read from server: .* bytes read" |
| 4961 | |
| 4962 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4963 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4964 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4965 | 0 \ |
| 4966 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4967 | |
| 4968 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4969 | # During session resumption, the client will send its ApplicationData record |
| 4970 | # within the same datagram as the Finished messages. In this situation, the |
| 4971 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4972 | # because the ApplicationData request has already been queued internally. |
| 4973 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4974 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4975 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4976 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4977 | 0 \ |
| 4978 | -c "Read from server: .* bytes read" |
| 4979 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4980 | # Tests for version negotiation |
| 4981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4983 | "$P_SRV" \ |
| 4984 | "$P_CLI" \ |
| 4985 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4986 | -S "mbedtls_ssl_handshake returned" \ |
| 4987 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4988 | -s "Protocol is TLSv1.2" \ |
| 4989 | -c "Protocol is TLSv1.2" |
| 4990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4992 | "$P_SRV" \ |
| 4993 | "$P_CLI max_version=tls1_1" \ |
| 4994 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4995 | -S "mbedtls_ssl_handshake returned" \ |
| 4996 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4997 | -s "Protocol is TLSv1.1" \ |
| 4998 | -c "Protocol is TLSv1.1" |
| 4999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5000 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5001 | "$P_SRV max_version=tls1_1" \ |
| 5002 | "$P_CLI" \ |
| 5003 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5004 | -S "mbedtls_ssl_handshake returned" \ |
| 5005 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5006 | -s "Protocol is TLSv1.1" \ |
| 5007 | -c "Protocol is TLSv1.1" |
| 5008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5009 | 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] | 5010 | "$P_SRV max_version=tls1_1" \ |
| 5011 | "$P_CLI max_version=tls1_1" \ |
| 5012 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5013 | -S "mbedtls_ssl_handshake returned" \ |
| 5014 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5015 | -s "Protocol is TLSv1.1" \ |
| 5016 | -c "Protocol is TLSv1.1" |
| 5017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5018 | 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] | 5019 | "$P_SRV min_version=tls1_1" \ |
| 5020 | "$P_CLI max_version=tls1_1" \ |
| 5021 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5022 | -S "mbedtls_ssl_handshake returned" \ |
| 5023 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5024 | -s "Protocol is TLSv1.1" \ |
| 5025 | -c "Protocol is TLSv1.1" |
| 5026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5027 | 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] | 5028 | "$P_SRV max_version=tls1_1" \ |
| 5029 | "$P_CLI min_version=tls1_1" \ |
| 5030 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5031 | -S "mbedtls_ssl_handshake returned" \ |
| 5032 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5033 | -s "Protocol is TLSv1.1" \ |
| 5034 | -c "Protocol is TLSv1.1" |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | 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] | 5037 | "$P_SRV max_version=tls1_1" \ |
| 5038 | "$P_CLI min_version=tls1_2" \ |
| 5039 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5040 | -s "mbedtls_ssl_handshake returned" \ |
| 5041 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5042 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5044 | 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] | 5045 | "$P_SRV min_version=tls1_2" \ |
| 5046 | "$P_CLI max_version=tls1_1" \ |
| 5047 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5048 | -s "mbedtls_ssl_handshake returned" \ |
| 5049 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5050 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5051 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5052 | # Tests for ALPN extension |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5055 | "$P_SRV debug_level=3" \ |
| 5056 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5057 | 0 \ |
| 5058 | -C "client hello, adding alpn extension" \ |
| 5059 | -S "found alpn extension" \ |
| 5060 | -C "got an alert message, type: \\[2:120]" \ |
| 5061 | -S "server hello, adding alpn extension" \ |
| 5062 | -C "found alpn extension " \ |
| 5063 | -C "Application Layer Protocol is" \ |
| 5064 | -S "Application Layer Protocol is" |
| 5065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5066 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5067 | "$P_SRV debug_level=3" \ |
| 5068 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5069 | 0 \ |
| 5070 | -c "client hello, adding alpn extension" \ |
| 5071 | -s "found alpn extension" \ |
| 5072 | -C "got an alert message, type: \\[2:120]" \ |
| 5073 | -S "server hello, adding alpn extension" \ |
| 5074 | -C "found alpn extension " \ |
| 5075 | -c "Application Layer Protocol is (none)" \ |
| 5076 | -S "Application Layer Protocol is" |
| 5077 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5078 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5079 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5080 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5081 | 0 \ |
| 5082 | -C "client hello, adding alpn extension" \ |
| 5083 | -S "found alpn extension" \ |
| 5084 | -C "got an alert message, type: \\[2:120]" \ |
| 5085 | -S "server hello, adding alpn extension" \ |
| 5086 | -C "found alpn extension " \ |
| 5087 | -C "Application Layer Protocol is" \ |
| 5088 | -s "Application Layer Protocol is (none)" |
| 5089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5090 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5091 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5092 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5093 | 0 \ |
| 5094 | -c "client hello, adding alpn extension" \ |
| 5095 | -s "found alpn extension" \ |
| 5096 | -C "got an alert message, type: \\[2:120]" \ |
| 5097 | -s "server hello, adding alpn extension" \ |
| 5098 | -c "found alpn extension" \ |
| 5099 | -c "Application Layer Protocol is abc" \ |
| 5100 | -s "Application Layer Protocol is abc" |
| 5101 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5102 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5103 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5104 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5105 | 0 \ |
| 5106 | -c "client hello, adding alpn extension" \ |
| 5107 | -s "found alpn extension" \ |
| 5108 | -C "got an alert message, type: \\[2:120]" \ |
| 5109 | -s "server hello, adding alpn extension" \ |
| 5110 | -c "found alpn extension" \ |
| 5111 | -c "Application Layer Protocol is abc" \ |
| 5112 | -s "Application Layer Protocol is abc" |
| 5113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5114 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5115 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5116 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5117 | 0 \ |
| 5118 | -c "client hello, adding alpn extension" \ |
| 5119 | -s "found alpn extension" \ |
| 5120 | -C "got an alert message, type: \\[2:120]" \ |
| 5121 | -s "server hello, adding alpn extension" \ |
| 5122 | -c "found alpn extension" \ |
| 5123 | -c "Application Layer Protocol is 1234" \ |
| 5124 | -s "Application Layer Protocol is 1234" |
| 5125 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5126 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5127 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5128 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5129 | 1 \ |
| 5130 | -c "client hello, adding alpn extension" \ |
| 5131 | -s "found alpn extension" \ |
| 5132 | -c "got an alert message, type: \\[2:120]" \ |
| 5133 | -S "server hello, adding alpn extension" \ |
| 5134 | -C "found alpn extension" \ |
| 5135 | -C "Application Layer Protocol is 1234" \ |
| 5136 | -S "Application Layer Protocol is 1234" |
| 5137 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5138 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5139 | # Tests for keyUsage in leaf certificates, part 1: |
| 5140 | # server-side certificate/suite selection |
| 5141 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5142 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5143 | "$P_SRV key_file=data_files/server2.key \ |
| 5144 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5145 | "$P_CLI" \ |
| 5146 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5147 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5148 | |
| 5149 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5150 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5151 | "$P_SRV key_file=data_files/server2.key \ |
| 5152 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5153 | "$P_CLI" \ |
| 5154 | 0 \ |
| 5155 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5157 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5158 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5159 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5160 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5161 | 1 \ |
| 5162 | -C "Ciphersuite is " |
| 5163 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5164 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5165 | "$P_SRV key_file=data_files/server5.key \ |
| 5166 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5167 | "$P_CLI" \ |
| 5168 | 0 \ |
| 5169 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5170 | |
| 5171 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5172 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5173 | "$P_SRV key_file=data_files/server5.key \ |
| 5174 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5175 | "$P_CLI" \ |
| 5176 | 0 \ |
| 5177 | -c "Ciphersuite is TLS-ECDH-" |
| 5178 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5179 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5180 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5181 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5182 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5183 | 1 \ |
| 5184 | -C "Ciphersuite is " |
| 5185 | |
| 5186 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5187 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5188 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5189 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5190 | "$O_SRV -key data_files/server2.key \ |
| 5191 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5192 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5193 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5194 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5195 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5196 | -C "Processing of the Certificate handshake message failed" \ |
| 5197 | -c "Ciphersuite is TLS-" |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5200 | "$O_SRV -key data_files/server2.key \ |
| 5201 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5202 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5203 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5204 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5205 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5206 | -C "Processing of the Certificate handshake message failed" \ |
| 5207 | -c "Ciphersuite is TLS-" |
| 5208 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5209 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5210 | "$O_SRV -key data_files/server2.key \ |
| 5211 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5212 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5213 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5214 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5215 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5216 | -C "Processing of the Certificate handshake message failed" \ |
| 5217 | -c "Ciphersuite is TLS-" |
| 5218 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5219 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5220 | "$O_SRV -key data_files/server2.key \ |
| 5221 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5222 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5223 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5224 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5225 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5226 | -c "Processing of the Certificate handshake message failed" \ |
| 5227 | -C "Ciphersuite is TLS-" |
| 5228 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5229 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5230 | "$O_SRV -key data_files/server2.key \ |
| 5231 | -cert data_files/server2.ku-ke.crt" \ |
| 5232 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5233 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5234 | 0 \ |
| 5235 | -c "bad certificate (usage extensions)" \ |
| 5236 | -C "Processing of the Certificate handshake message failed" \ |
| 5237 | -c "Ciphersuite is TLS-" \ |
| 5238 | -c "! Usage does not match the keyUsage extension" |
| 5239 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5240 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5241 | "$O_SRV -key data_files/server2.key \ |
| 5242 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5243 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5244 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5245 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5246 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5247 | -C "Processing of the Certificate handshake message failed" \ |
| 5248 | -c "Ciphersuite is TLS-" |
| 5249 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5250 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5251 | "$O_SRV -key data_files/server2.key \ |
| 5252 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5253 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5254 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5255 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5256 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5257 | -c "Processing of the Certificate handshake message failed" \ |
| 5258 | -C "Ciphersuite is TLS-" |
| 5259 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5260 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5261 | "$O_SRV -key data_files/server2.key \ |
| 5262 | -cert data_files/server2.ku-ds.crt" \ |
| 5263 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5264 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5265 | 0 \ |
| 5266 | -c "bad certificate (usage extensions)" \ |
| 5267 | -C "Processing of the Certificate handshake message failed" \ |
| 5268 | -c "Ciphersuite is TLS-" \ |
| 5269 | -c "! Usage does not match the keyUsage extension" |
| 5270 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5271 | # Tests for keyUsage in leaf certificates, part 3: |
| 5272 | # server-side checking of client cert |
| 5273 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5274 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5275 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5276 | "$O_CLI -key data_files/server2.key \ |
| 5277 | -cert data_files/server2.ku-ds.crt" \ |
| 5278 | 0 \ |
| 5279 | -S "bad certificate (usage extensions)" \ |
| 5280 | -S "Processing of the Certificate handshake message failed" |
| 5281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5282 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5283 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5284 | "$O_CLI -key data_files/server2.key \ |
| 5285 | -cert data_files/server2.ku-ke.crt" \ |
| 5286 | 0 \ |
| 5287 | -s "bad certificate (usage extensions)" \ |
| 5288 | -S "Processing of the Certificate handshake message failed" |
| 5289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5290 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5291 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5292 | "$O_CLI -key data_files/server2.key \ |
| 5293 | -cert data_files/server2.ku-ke.crt" \ |
| 5294 | 1 \ |
| 5295 | -s "bad certificate (usage extensions)" \ |
| 5296 | -s "Processing of the Certificate handshake message failed" |
| 5297 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5298 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5299 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5300 | "$O_CLI -key data_files/server5.key \ |
| 5301 | -cert data_files/server5.ku-ds.crt" \ |
| 5302 | 0 \ |
| 5303 | -S "bad certificate (usage extensions)" \ |
| 5304 | -S "Processing of the Certificate handshake message failed" |
| 5305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5306 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5307 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5308 | "$O_CLI -key data_files/server5.key \ |
| 5309 | -cert data_files/server5.ku-ka.crt" \ |
| 5310 | 0 \ |
| 5311 | -s "bad certificate (usage extensions)" \ |
| 5312 | -S "Processing of the Certificate handshake message failed" |
| 5313 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5314 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5315 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5316 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5317 | "$P_SRV key_file=data_files/server5.key \ |
| 5318 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5319 | "$P_CLI" \ |
| 5320 | 0 |
| 5321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5322 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5323 | "$P_SRV key_file=data_files/server5.key \ |
| 5324 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5325 | "$P_CLI" \ |
| 5326 | 0 |
| 5327 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5328 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5329 | "$P_SRV key_file=data_files/server5.key \ |
| 5330 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5331 | "$P_CLI" \ |
| 5332 | 0 |
| 5333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5334 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5335 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5336 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5337 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5338 | 1 |
| 5339 | |
| 5340 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5343 | "$O_SRV -key data_files/server5.key \ |
| 5344 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5345 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5346 | 0 \ |
| 5347 | -C "bad certificate (usage extensions)" \ |
| 5348 | -C "Processing of the Certificate handshake message failed" \ |
| 5349 | -c "Ciphersuite is TLS-" |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5352 | "$O_SRV -key data_files/server5.key \ |
| 5353 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5354 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5355 | 0 \ |
| 5356 | -C "bad certificate (usage extensions)" \ |
| 5357 | -C "Processing of the Certificate handshake message failed" \ |
| 5358 | -c "Ciphersuite is TLS-" |
| 5359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5360 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5361 | "$O_SRV -key data_files/server5.key \ |
| 5362 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5363 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5364 | 0 \ |
| 5365 | -C "bad certificate (usage extensions)" \ |
| 5366 | -C "Processing of the Certificate handshake message failed" \ |
| 5367 | -c "Ciphersuite is TLS-" |
| 5368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5369 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5370 | "$O_SRV -key data_files/server5.key \ |
| 5371 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5372 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5373 | 1 \ |
| 5374 | -c "bad certificate (usage extensions)" \ |
| 5375 | -c "Processing of the Certificate handshake message failed" \ |
| 5376 | -C "Ciphersuite is TLS-" |
| 5377 | |
| 5378 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5379 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5380 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5381 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5382 | "$O_CLI -key data_files/server5.key \ |
| 5383 | -cert data_files/server5.eku-cli.crt" \ |
| 5384 | 0 \ |
| 5385 | -S "bad certificate (usage extensions)" \ |
| 5386 | -S "Processing of the Certificate handshake message failed" |
| 5387 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5388 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5389 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5390 | "$O_CLI -key data_files/server5.key \ |
| 5391 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5392 | 0 \ |
| 5393 | -S "bad certificate (usage extensions)" \ |
| 5394 | -S "Processing of the Certificate handshake message failed" |
| 5395 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5396 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5397 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5398 | "$O_CLI -key data_files/server5.key \ |
| 5399 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5400 | 0 \ |
| 5401 | -S "bad certificate (usage extensions)" \ |
| 5402 | -S "Processing of the Certificate handshake message failed" |
| 5403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5405 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5406 | "$O_CLI -key data_files/server5.key \ |
| 5407 | -cert data_files/server5.eku-cs.crt" \ |
| 5408 | 0 \ |
| 5409 | -s "bad certificate (usage extensions)" \ |
| 5410 | -S "Processing of the Certificate handshake message failed" |
| 5411 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5412 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5413 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5414 | "$O_CLI -key data_files/server5.key \ |
| 5415 | -cert data_files/server5.eku-cs.crt" \ |
| 5416 | 1 \ |
| 5417 | -s "bad certificate (usage extensions)" \ |
| 5418 | -s "Processing of the Certificate handshake message failed" |
| 5419 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5420 | # Tests for DHM parameters loading |
| 5421 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5422 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5423 | "$P_SRV" \ |
| 5424 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5425 | debug_level=3" \ |
| 5426 | 0 \ |
| 5427 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5428 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5429 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5430 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5431 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5432 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5433 | debug_level=3" \ |
| 5434 | 0 \ |
| 5435 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5436 | -c "value of 'DHM: G ' (2 bits)" |
| 5437 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5438 | # Tests for DHM client-side size checking |
| 5439 | |
| 5440 | run_test "DHM size: server default, client default, OK" \ |
| 5441 | "$P_SRV" \ |
| 5442 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5443 | debug_level=1" \ |
| 5444 | 0 \ |
| 5445 | -C "DHM prime too short:" |
| 5446 | |
| 5447 | run_test "DHM size: server default, client 2048, OK" \ |
| 5448 | "$P_SRV" \ |
| 5449 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5450 | debug_level=1 dhmlen=2048" \ |
| 5451 | 0 \ |
| 5452 | -C "DHM prime too short:" |
| 5453 | |
| 5454 | run_test "DHM size: server 1024, client default, OK" \ |
| 5455 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5456 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5457 | debug_level=1" \ |
| 5458 | 0 \ |
| 5459 | -C "DHM prime too short:" |
| 5460 | |
| 5461 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5462 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5463 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5464 | debug_level=1" \ |
| 5465 | 1 \ |
| 5466 | -c "DHM prime too short:" |
| 5467 | |
| 5468 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5469 | "$P_SRV" \ |
| 5470 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5471 | debug_level=1 dhmlen=2049" \ |
| 5472 | 1 \ |
| 5473 | -c "DHM prime too short:" |
| 5474 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5475 | # Tests for PSK callback |
| 5476 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5477 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5478 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5479 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5480 | psk_identity=foo psk=abc123" \ |
| 5481 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5482 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5483 | -S "SSL - Unknown identity received" \ |
| 5484 | -S "SSL - Verification of the message MAC failed" |
| 5485 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5486 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5487 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5488 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5489 | "$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] | 5490 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5491 | 0 \ |
| 5492 | -c "skip PMS generation for opaque PSK"\ |
| 5493 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5494 | -C "session hash for extended master secret"\ |
| 5495 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5496 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5497 | -S "SSL - Unknown identity received" \ |
| 5498 | -S "SSL - Verification of the message MAC failed" |
| 5499 | |
| 5500 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5501 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5502 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5503 | "$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] | 5504 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5505 | 0 \ |
| 5506 | -c "skip PMS generation for opaque PSK"\ |
| 5507 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5508 | -C "session hash for extended master secret"\ |
| 5509 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5510 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5511 | -S "SSL - Unknown identity received" \ |
| 5512 | -S "SSL - Verification of the message MAC failed" |
| 5513 | |
| 5514 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5515 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5516 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5517 | "$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] | 5518 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5519 | 0 \ |
| 5520 | -c "skip PMS generation for opaque PSK"\ |
| 5521 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5522 | -c "session hash for extended master secret"\ |
| 5523 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5524 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5525 | -S "SSL - Unknown identity received" \ |
| 5526 | -S "SSL - Verification of the message MAC failed" |
| 5527 | |
| 5528 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5529 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5530 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5531 | "$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] | 5532 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5533 | 0 \ |
| 5534 | -c "skip PMS generation for opaque PSK"\ |
| 5535 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5536 | -c "session hash for extended master secret"\ |
| 5537 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5538 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5539 | -S "SSL - Unknown identity received" \ |
| 5540 | -S "SSL - Verification of the message MAC failed" |
| 5541 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5542 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5543 | 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] | 5544 | "$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] | 5545 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5546 | psk_identity=foo psk=abc123" \ |
| 5547 | 0 \ |
| 5548 | -C "skip PMS generation for opaque PSK"\ |
| 5549 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5550 | -C "session hash for extended master secret"\ |
| 5551 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5552 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5553 | -S "SSL - Unknown identity received" \ |
| 5554 | -S "SSL - Verification of the message MAC failed" |
| 5555 | |
| 5556 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5557 | 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] | 5558 | "$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] | 5559 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5560 | psk_identity=foo psk=abc123" \ |
| 5561 | 0 \ |
| 5562 | -C "skip PMS generation for opaque PSK"\ |
| 5563 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5564 | -C "session hash for extended master secret"\ |
| 5565 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5566 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5567 | -S "SSL - Unknown identity received" \ |
| 5568 | -S "SSL - Verification of the message MAC failed" |
| 5569 | |
| 5570 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5571 | 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] | 5572 | "$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] | 5573 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5574 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5575 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5576 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5577 | -c "session hash for extended master secret"\ |
| 5578 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5579 | -C "skip PMS generation for opaque PSK"\ |
| 5580 | -s "skip PMS generation for opaque PSK"\ |
| 5581 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5582 | -S "SSL - Unknown identity received" \ |
| 5583 | -S "SSL - Verification of the message MAC failed" |
| 5584 | |
| 5585 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5586 | 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] | 5587 | "$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] | 5588 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5589 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5590 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5591 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5592 | -c "session hash for extended master secret"\ |
| 5593 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5594 | -C "skip PMS generation for opaque PSK"\ |
| 5595 | -s "skip PMS generation for opaque PSK"\ |
| 5596 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5597 | -S "SSL - Unknown identity received" \ |
| 5598 | -S "SSL - Verification of the message MAC failed" |
| 5599 | |
| 5600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5601 | 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] | 5602 | "$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] | 5603 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5604 | psk_identity=def psk=beef" \ |
| 5605 | 0 \ |
| 5606 | -C "skip PMS generation for opaque PSK"\ |
| 5607 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5608 | -C "session hash for extended master secret"\ |
| 5609 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5610 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5611 | -S "SSL - Unknown identity received" \ |
| 5612 | -S "SSL - Verification of the message MAC failed" |
| 5613 | |
| 5614 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5615 | 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] | 5616 | "$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] | 5617 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5618 | psk_identity=def psk=beef" \ |
| 5619 | 0 \ |
| 5620 | -C "skip PMS generation for opaque PSK"\ |
| 5621 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5622 | -C "session hash for extended master secret"\ |
| 5623 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5624 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5625 | -S "SSL - Unknown identity received" \ |
| 5626 | -S "SSL - Verification of the message MAC failed" |
| 5627 | |
| 5628 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5629 | 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] | 5630 | "$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] | 5631 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5632 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5633 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5634 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5635 | -c "session hash for extended master secret"\ |
| 5636 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5637 | -C "skip PMS generation for opaque PSK"\ |
| 5638 | -s "skip PMS generation for opaque PSK"\ |
| 5639 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5640 | -S "SSL - Unknown identity received" \ |
| 5641 | -S "SSL - Verification of the message MAC failed" |
| 5642 | |
| 5643 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5644 | 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] | 5645 | "$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] | 5646 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5647 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5648 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5649 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5650 | -c "session hash for extended master secret"\ |
| 5651 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5652 | -C "skip PMS generation for opaque PSK"\ |
| 5653 | -s "skip PMS generation for opaque PSK"\ |
| 5654 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5655 | -S "SSL - Unknown identity received" \ |
| 5656 | -S "SSL - Verification of the message MAC failed" |
| 5657 | |
| 5658 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5659 | 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] | 5660 | "$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] | 5661 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5662 | psk_identity=def psk=beef" \ |
| 5663 | 0 \ |
| 5664 | -C "skip PMS generation for opaque PSK"\ |
| 5665 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5666 | -C "session hash for extended master secret"\ |
| 5667 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5668 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5669 | -S "SSL - Unknown identity received" \ |
| 5670 | -S "SSL - Verification of the message MAC failed" |
| 5671 | |
| 5672 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5673 | 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] | 5674 | "$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] | 5675 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5676 | psk_identity=def psk=beef" \ |
| 5677 | 0 \ |
| 5678 | -C "skip PMS generation for opaque PSK"\ |
| 5679 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5680 | -C "session hash for extended master secret"\ |
| 5681 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5682 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5683 | -S "SSL - Unknown identity received" \ |
| 5684 | -S "SSL - Verification of the message MAC failed" |
| 5685 | |
| 5686 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5687 | 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] | 5688 | "$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] | 5689 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5690 | psk_identity=def psk=beef" \ |
| 5691 | 0 \ |
| 5692 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5693 | -C "session hash for extended master secret"\ |
| 5694 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5695 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5696 | -S "SSL - Unknown identity received" \ |
| 5697 | -S "SSL - Verification of the message MAC failed" |
| 5698 | |
| 5699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5700 | 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] | 5701 | "$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] | 5702 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5703 | psk_identity=def psk=beef" \ |
| 5704 | 0 \ |
| 5705 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5706 | -C "session hash for extended master secret"\ |
| 5707 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5708 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5709 | -S "SSL - Unknown identity received" \ |
| 5710 | -S "SSL - Verification of the message MAC failed" |
| 5711 | |
| 5712 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5713 | 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] | 5714 | "$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] | 5715 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5716 | psk_identity=def psk=beef" \ |
| 5717 | 1 \ |
| 5718 | -s "SSL - Verification of the message MAC failed" |
| 5719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5720 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5721 | "$P_SRV" \ |
| 5722 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5723 | psk_identity=foo psk=abc123" \ |
| 5724 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5725 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5726 | -S "SSL - Unknown identity received" \ |
| 5727 | -S "SSL - Verification of the message MAC failed" |
| 5728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5729 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5730 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5731 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5732 | psk_identity=foo psk=abc123" \ |
| 5733 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5734 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5735 | -s "SSL - Unknown identity received" \ |
| 5736 | -S "SSL - Verification of the message MAC failed" |
| 5737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5738 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5739 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5740 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5741 | psk_identity=abc psk=dead" \ |
| 5742 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5743 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5744 | -S "SSL - Unknown identity received" \ |
| 5745 | -S "SSL - Verification of the message MAC failed" |
| 5746 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5747 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5748 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5749 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5750 | psk_identity=def psk=beef" \ |
| 5751 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5752 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5753 | -S "SSL - Unknown identity received" \ |
| 5754 | -S "SSL - Verification of the message MAC failed" |
| 5755 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5756 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5757 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5758 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5759 | psk_identity=ghi psk=beef" \ |
| 5760 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5761 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5762 | -s "SSL - Unknown identity received" \ |
| 5763 | -S "SSL - Verification of the message MAC failed" |
| 5764 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5765 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5766 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5767 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5768 | psk_identity=abc psk=beef" \ |
| 5769 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5770 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5771 | -S "SSL - Unknown identity received" \ |
| 5772 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5773 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5774 | # Tests for EC J-PAKE |
| 5775 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5776 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5777 | run_test "ECJPAKE: client not configured" \ |
| 5778 | "$P_SRV debug_level=3" \ |
| 5779 | "$P_CLI debug_level=3" \ |
| 5780 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5781 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5782 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5783 | -S "found ecjpake kkpp extension" \ |
| 5784 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5785 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5786 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5787 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5788 | -S "None of the common ciphersuites is usable" |
| 5789 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5790 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5791 | run_test "ECJPAKE: server not configured" \ |
| 5792 | "$P_SRV debug_level=3" \ |
| 5793 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5794 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5795 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5796 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5797 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5798 | -s "found ecjpake kkpp extension" \ |
| 5799 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5800 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5801 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5802 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5803 | -s "None of the common ciphersuites is usable" |
| 5804 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5806 | run_test "ECJPAKE: working, TLS" \ |
| 5807 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5808 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5809 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5810 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5811 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5812 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5813 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5814 | -s "found ecjpake kkpp extension" \ |
| 5815 | -S "skip ecjpake kkpp extension" \ |
| 5816 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5817 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5818 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5819 | -S "None of the common ciphersuites is usable" \ |
| 5820 | -S "SSL - Verification of the message MAC failed" |
| 5821 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5822 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5823 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5824 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5825 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5826 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5827 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5828 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5829 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5830 | -s "SSL - Verification of the message MAC failed" |
| 5831 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5832 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5833 | run_test "ECJPAKE: working, DTLS" \ |
| 5834 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5835 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5836 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5837 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5838 | -c "re-using cached ecjpake parameters" \ |
| 5839 | -S "SSL - Verification of the message MAC failed" |
| 5840 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5842 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5843 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5844 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5845 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5846 | 0 \ |
| 5847 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5848 | -S "SSL - Verification of the message MAC failed" |
| 5849 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5850 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5851 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5852 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5853 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5854 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5855 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5856 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5857 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5858 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5859 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5860 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5861 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5862 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5863 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5864 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5865 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5866 | 0 |
| 5867 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5868 | # Tests for ciphersuites per version |
| 5869 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5870 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5871 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5872 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5873 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5874 | "$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] | 5875 | "$P_CLI force_version=ssl3" \ |
| 5876 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5877 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5878 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 5880 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5881 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5882 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5883 | "$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] | 5884 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5885 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5886 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5887 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5889 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5890 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5891 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5892 | "$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] | 5893 | "$P_CLI force_version=tls1_1" \ |
| 5894 | 0 \ |
| 5895 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 5896 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5897 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 5898 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 5899 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5900 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5901 | "$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] | 5902 | "$P_CLI force_version=tls1_2" \ |
| 5903 | 0 \ |
| 5904 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 5905 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5906 | # Test for ClientHello without extensions |
| 5907 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5908 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5909 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5910 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5911 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5912 | 0 \ |
| 5913 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5914 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5915 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5916 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5917 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5918 | "$P_SRV" \ |
| 5919 | "$P_CLI request_size=100" \ |
| 5920 | 0 \ |
| 5921 | -s "Read from client: 100 bytes read$" |
| 5922 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5923 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5924 | "$P_SRV" \ |
| 5925 | "$P_CLI request_size=500" \ |
| 5926 | 0 \ |
| 5927 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5928 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5929 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5930 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5931 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5932 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 5933 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5934 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5935 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5936 | 0 \ |
| 5937 | -s "Read from client: 1 bytes read" |
| 5938 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5939 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5940 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5941 | "$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] | 5942 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 5943 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5944 | 0 \ |
| 5945 | -s "Read from client: 1 bytes read" |
| 5946 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5947 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5948 | "$P_SRV" \ |
| 5949 | "$P_CLI request_size=1 force_version=tls1 \ |
| 5950 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5951 | 0 \ |
| 5952 | -s "Read from client: 1 bytes read" |
| 5953 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5954 | 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] | 5955 | "$P_SRV" \ |
| 5956 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 5957 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5958 | 0 \ |
| 5959 | -s "Read from client: 1 bytes read" |
| 5960 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5961 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5962 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5963 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5964 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5965 | 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] | 5966 | 0 \ |
| 5967 | -s "Read from client: 1 bytes read" |
| 5968 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5969 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5970 | 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] | 5971 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5972 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5973 | 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] | 5974 | 0 \ |
| 5975 | -s "Read from client: 1 bytes read" |
| 5976 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5977 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5978 | "$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] | 5979 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5980 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5981 | 0 \ |
| 5982 | -s "Read from client: 1 bytes read" |
| 5983 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5984 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5985 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5986 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5987 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5988 | 0 \ |
| 5989 | -s "Read from client: 1 bytes read" |
| 5990 | |
| 5991 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5992 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5993 | "$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] | 5994 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5995 | 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] | 5996 | 0 \ |
| 5997 | -s "Read from client: 1 bytes read" |
| 5998 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5999 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6000 | 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] | 6001 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6002 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6003 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6004 | 0 \ |
| 6005 | -s "Read from client: 1 bytes read" |
| 6006 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6007 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6008 | "$P_SRV" \ |
| 6009 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6010 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6011 | 0 \ |
| 6012 | -s "Read from client: 1 bytes read" |
| 6013 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6014 | 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] | 6015 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6016 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6017 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6018 | 0 \ |
| 6019 | -s "Read from client: 1 bytes read" |
| 6020 | |
| 6021 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6022 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6023 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6024 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6025 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6026 | 0 \ |
| 6027 | -s "Read from client: 1 bytes read" |
| 6028 | |
| 6029 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6030 | 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] | 6031 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6032 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6033 | 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] | 6034 | 0 \ |
| 6035 | -s "Read from client: 1 bytes read" |
| 6036 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6037 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6038 | "$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] | 6039 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6040 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6041 | 0 \ |
| 6042 | -s "Read from client: 1 bytes read" |
| 6043 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6044 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6045 | "$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] | 6046 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6047 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6048 | 0 \ |
| 6049 | -s "Read from client: 1 bytes read" |
| 6050 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6051 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6052 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6053 | "$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] | 6054 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6055 | 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] | 6056 | 0 \ |
| 6057 | -s "Read from client: 1 bytes read" |
| 6058 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6060 | 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] | 6061 | "$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] | 6062 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6063 | 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] | 6064 | 0 \ |
| 6065 | -s "Read from client: 1 bytes read" |
| 6066 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6067 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6068 | "$P_SRV" \ |
| 6069 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6070 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6071 | 0 \ |
| 6072 | -s "Read from client: 1 bytes read" |
| 6073 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6074 | 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] | 6075 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6076 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6077 | 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] | 6078 | 0 \ |
| 6079 | -s "Read from client: 1 bytes read" |
| 6080 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6081 | 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] | 6082 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6083 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6084 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6085 | 0 \ |
| 6086 | -s "Read from client: 1 bytes read" |
| 6087 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6088 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6089 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6090 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6091 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6092 | 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] | 6093 | 0 \ |
| 6094 | -s "Read from client: 1 bytes read" |
| 6095 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6096 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6097 | 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] | 6098 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6099 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6100 | 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] | 6101 | 0 \ |
| 6102 | -s "Read from client: 1 bytes read" |
| 6103 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6104 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6105 | "$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] | 6106 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6107 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6108 | 0 \ |
| 6109 | -s "Read from client: 1 bytes read" |
| 6110 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6111 | 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] | 6112 | "$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] | 6113 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6114 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6115 | 0 \ |
| 6116 | -s "Read from client: 1 bytes read" |
| 6117 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6118 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6119 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6120 | "$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] | 6121 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6122 | 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] | 6123 | 0 \ |
| 6124 | -s "Read from client: 1 bytes read" |
| 6125 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6126 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6127 | 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] | 6128 | "$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] | 6129 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6130 | 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] | 6131 | 0 \ |
| 6132 | -s "Read from client: 1 bytes read" |
| 6133 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6134 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6135 | "$P_SRV" \ |
| 6136 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6137 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6138 | 0 \ |
| 6139 | -s "Read from client: 1 bytes read" |
| 6140 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6141 | 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] | 6142 | "$P_SRV" \ |
| 6143 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 6144 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6145 | 0 \ |
| 6146 | -s "Read from client: 1 bytes read" |
| 6147 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6148 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6149 | |
| 6150 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6151 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6152 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6153 | "$P_CLI dtls=1 request_size=1 \ |
| 6154 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6155 | 0 \ |
| 6156 | -s "Read from client: 1 bytes read" |
| 6157 | |
| 6158 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6159 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6160 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6161 | "$P_CLI dtls=1 request_size=1 \ |
| 6162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6163 | 0 \ |
| 6164 | -s "Read from client: 1 bytes read" |
| 6165 | |
| 6166 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6167 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6168 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6169 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6170 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6171 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6172 | 0 \ |
| 6173 | -s "Read from client: 1 bytes read" |
| 6174 | |
| 6175 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6176 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6177 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6178 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6179 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6180 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6181 | 0 \ |
| 6182 | -s "Read from client: 1 bytes read" |
| 6183 | |
| 6184 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6185 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6186 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 6187 | "$P_CLI dtls=1 request_size=1 \ |
| 6188 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6189 | 0 \ |
| 6190 | -s "Read from client: 1 bytes read" |
| 6191 | |
| 6192 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6193 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6194 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6195 | "$P_CLI dtls=1 request_size=1 \ |
| 6196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6197 | 0 \ |
| 6198 | -s "Read from client: 1 bytes read" |
| 6199 | |
| 6200 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6201 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6202 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6203 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6204 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6205 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6206 | 0 \ |
| 6207 | -s "Read from client: 1 bytes read" |
| 6208 | |
| 6209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6210 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6211 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6212 | "$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] | 6213 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6214 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6215 | 0 \ |
| 6216 | -s "Read from client: 1 bytes read" |
| 6217 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6218 | # Tests for small server packets |
| 6219 | |
| 6220 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6221 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6222 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6223 | "$P_CLI force_version=ssl3 \ |
| 6224 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6225 | 0 \ |
| 6226 | -c "Read from server: 1 bytes read" |
| 6227 | |
| 6228 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6229 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6230 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6231 | "$P_CLI force_version=ssl3 \ |
| 6232 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6233 | 0 \ |
| 6234 | -c "Read from server: 1 bytes read" |
| 6235 | |
| 6236 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6237 | "$P_SRV response_size=1" \ |
| 6238 | "$P_CLI force_version=tls1 \ |
| 6239 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6240 | 0 \ |
| 6241 | -c "Read from server: 1 bytes read" |
| 6242 | |
| 6243 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6244 | "$P_SRV response_size=1" \ |
| 6245 | "$P_CLI force_version=tls1 etm=0 \ |
| 6246 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6247 | 0 \ |
| 6248 | -c "Read from server: 1 bytes read" |
| 6249 | |
| 6250 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6251 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6252 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6253 | "$P_CLI force_version=tls1 \ |
| 6254 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6255 | 0 \ |
| 6256 | -c "Read from server: 1 bytes read" |
| 6257 | |
| 6258 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6259 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6260 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6261 | "$P_CLI force_version=tls1 \ |
| 6262 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6263 | 0 \ |
| 6264 | -c "Read from server: 1 bytes read" |
| 6265 | |
| 6266 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6267 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6268 | "$P_CLI force_version=tls1 \ |
| 6269 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6270 | 0 \ |
| 6271 | -c "Read from server: 1 bytes read" |
| 6272 | |
| 6273 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6274 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6275 | "$P_CLI force_version=tls1 \ |
| 6276 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6277 | 0 \ |
| 6278 | -c "Read from server: 1 bytes read" |
| 6279 | |
| 6280 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6281 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6282 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6283 | "$P_CLI force_version=tls1 \ |
| 6284 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6285 | 0 \ |
| 6286 | -c "Read from server: 1 bytes read" |
| 6287 | |
| 6288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6289 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6290 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6291 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6292 | trunc_hmac=1 etm=0" \ |
| 6293 | 0 \ |
| 6294 | -c "Read from server: 1 bytes read" |
| 6295 | |
| 6296 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6297 | "$P_SRV response_size=1" \ |
| 6298 | "$P_CLI force_version=tls1_1 \ |
| 6299 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6300 | 0 \ |
| 6301 | -c "Read from server: 1 bytes read" |
| 6302 | |
| 6303 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6304 | "$P_SRV response_size=1" \ |
| 6305 | "$P_CLI force_version=tls1_1 \ |
| 6306 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6307 | 0 \ |
| 6308 | -c "Read from server: 1 bytes read" |
| 6309 | |
| 6310 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6311 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6312 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6313 | "$P_CLI force_version=tls1_1 \ |
| 6314 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6315 | 0 \ |
| 6316 | -c "Read from server: 1 bytes read" |
| 6317 | |
| 6318 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6319 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6320 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6321 | "$P_CLI force_version=tls1_1 \ |
| 6322 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6323 | 0 \ |
| 6324 | -c "Read from server: 1 bytes read" |
| 6325 | |
| 6326 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6327 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6328 | "$P_CLI force_version=tls1_1 \ |
| 6329 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6330 | 0 \ |
| 6331 | -c "Read from server: 1 bytes read" |
| 6332 | |
| 6333 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6334 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6335 | "$P_CLI force_version=tls1_1 \ |
| 6336 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6337 | 0 \ |
| 6338 | -c "Read from server: 1 bytes read" |
| 6339 | |
| 6340 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6341 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6342 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6343 | "$P_CLI force_version=tls1_1 \ |
| 6344 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6345 | 0 \ |
| 6346 | -c "Read from server: 1 bytes read" |
| 6347 | |
| 6348 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6349 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6350 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6351 | "$P_CLI force_version=tls1_1 \ |
| 6352 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6353 | 0 \ |
| 6354 | -c "Read from server: 1 bytes read" |
| 6355 | |
| 6356 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6357 | "$P_SRV response_size=1" \ |
| 6358 | "$P_CLI force_version=tls1_2 \ |
| 6359 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6360 | 0 \ |
| 6361 | -c "Read from server: 1 bytes read" |
| 6362 | |
| 6363 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6364 | "$P_SRV response_size=1" \ |
| 6365 | "$P_CLI force_version=tls1_2 \ |
| 6366 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6367 | 0 \ |
| 6368 | -c "Read from server: 1 bytes read" |
| 6369 | |
| 6370 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6371 | "$P_SRV response_size=1" \ |
| 6372 | "$P_CLI force_version=tls1_2 \ |
| 6373 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6374 | 0 \ |
| 6375 | -c "Read from server: 1 bytes read" |
| 6376 | |
| 6377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6378 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6379 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6380 | "$P_CLI force_version=tls1_2 \ |
| 6381 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6382 | 0 \ |
| 6383 | -c "Read from server: 1 bytes read" |
| 6384 | |
| 6385 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6386 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6387 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6388 | "$P_CLI force_version=tls1_2 \ |
| 6389 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6390 | 0 \ |
| 6391 | -c "Read from server: 1 bytes read" |
| 6392 | |
| 6393 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6394 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6395 | "$P_CLI force_version=tls1_2 \ |
| 6396 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6397 | 0 \ |
| 6398 | -c "Read from server: 1 bytes read" |
| 6399 | |
| 6400 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6401 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6402 | "$P_CLI force_version=tls1_2 \ |
| 6403 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6404 | 0 \ |
| 6405 | -c "Read from server: 1 bytes read" |
| 6406 | |
| 6407 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6408 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6409 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6410 | "$P_CLI force_version=tls1_2 \ |
| 6411 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6412 | 0 \ |
| 6413 | -c "Read from server: 1 bytes read" |
| 6414 | |
| 6415 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6416 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6417 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6418 | "$P_CLI force_version=tls1_2 \ |
| 6419 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6420 | 0 \ |
| 6421 | -c "Read from server: 1 bytes read" |
| 6422 | |
| 6423 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6424 | "$P_SRV response_size=1" \ |
| 6425 | "$P_CLI force_version=tls1_2 \ |
| 6426 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6427 | 0 \ |
| 6428 | -c "Read from server: 1 bytes read" |
| 6429 | |
| 6430 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6431 | "$P_SRV response_size=1" \ |
| 6432 | "$P_CLI force_version=tls1_2 \ |
| 6433 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6434 | 0 \ |
| 6435 | -c "Read from server: 1 bytes read" |
| 6436 | |
| 6437 | # Tests for small server packets in DTLS |
| 6438 | |
| 6439 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6440 | run_test "Small server packet DTLS 1.0" \ |
| 6441 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6442 | "$P_CLI dtls=1 \ |
| 6443 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6444 | 0 \ |
| 6445 | -c "Read from server: 1 bytes read" |
| 6446 | |
| 6447 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6448 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6449 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6450 | "$P_CLI dtls=1 \ |
| 6451 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6452 | 0 \ |
| 6453 | -c "Read from server: 1 bytes read" |
| 6454 | |
| 6455 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6456 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6457 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6458 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6459 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6460 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6461 | 0 \ |
| 6462 | -c "Read from server: 1 bytes read" |
| 6463 | |
| 6464 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6465 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6466 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6467 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6468 | "$P_CLI dtls=1 \ |
| 6469 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6470 | 0 \ |
| 6471 | -c "Read from server: 1 bytes read" |
| 6472 | |
| 6473 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6474 | run_test "Small server packet DTLS 1.2" \ |
| 6475 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 6476 | "$P_CLI dtls=1 \ |
| 6477 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6478 | 0 \ |
| 6479 | -c "Read from server: 1 bytes read" |
| 6480 | |
| 6481 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6482 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 6483 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 6484 | "$P_CLI dtls=1 \ |
| 6485 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6486 | 0 \ |
| 6487 | -c "Read from server: 1 bytes read" |
| 6488 | |
| 6489 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6490 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6491 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 6492 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 6493 | "$P_CLI dtls=1 \ |
| 6494 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6495 | 0 \ |
| 6496 | -c "Read from server: 1 bytes read" |
| 6497 | |
| 6498 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6499 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6500 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 6501 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 6502 | "$P_CLI dtls=1 \ |
| 6503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6504 | 0 \ |
| 6505 | -c "Read from server: 1 bytes read" |
| 6506 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6507 | # A test for extensions in SSLv3 |
| 6508 | |
| 6509 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6510 | run_test "SSLv3 with extensions, server side" \ |
| 6511 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6512 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6513 | 0 \ |
| 6514 | -S "dumping 'client hello extensions'" \ |
| 6515 | -S "server hello, total extension length:" |
| 6516 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6517 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6518 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6519 | # How many fragments do we expect to write $1 bytes? |
| 6520 | fragments_for_write() { |
| 6521 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6522 | } |
| 6523 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6524 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6525 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6526 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6527 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6528 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6529 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6530 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6531 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6532 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6533 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6534 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6535 | "$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] | 6536 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6537 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6538 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6539 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6540 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6541 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6542 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6543 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6544 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6545 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6546 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6547 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6548 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6549 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6550 | 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] | 6551 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6552 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6553 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6554 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6555 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6556 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6557 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6558 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6559 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6560 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6561 | 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] | 6562 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6563 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6564 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6565 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6566 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6567 | 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] | 6568 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6569 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6570 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6571 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6572 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6573 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6574 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6575 | "$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] | 6576 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6577 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6578 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6579 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6580 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6581 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6582 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6583 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6584 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6585 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6586 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6587 | |
| 6588 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6589 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6590 | "$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] | 6591 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6592 | 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] | 6593 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6594 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6595 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6596 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6597 | 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] | 6598 | "$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] | 6599 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6600 | 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] | 6601 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6602 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6603 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6604 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6605 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6606 | "$P_SRV" \ |
| 6607 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6608 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6609 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6610 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6611 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6612 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6613 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6614 | "$P_SRV" \ |
| 6615 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6616 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6617 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6618 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6619 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6620 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6621 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6622 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6623 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6624 | 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] | 6625 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6626 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6627 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6628 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6629 | 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] | 6630 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6631 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6632 | 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] | 6633 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6634 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6635 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6636 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6637 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6638 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6639 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6640 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6641 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6642 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6643 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6644 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6645 | "$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] | 6646 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6648 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6649 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6650 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6651 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6652 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6653 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6654 | "$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] | 6655 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6656 | 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] | 6657 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6658 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6659 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6660 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6661 | 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] | 6662 | "$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] | 6663 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6664 | 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] | 6665 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6666 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6667 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6668 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6669 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6670 | "$P_SRV" \ |
| 6671 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6673 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6674 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6675 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6676 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6677 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6678 | "$P_SRV" \ |
| 6679 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 6680 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6681 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6682 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6683 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6684 | 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] | 6685 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6686 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6687 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6688 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6689 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6690 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6691 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6692 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6693 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6694 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6695 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6696 | 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] | 6697 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6698 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6699 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6700 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6701 | 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] | 6702 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6703 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6704 | 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] | 6705 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6706 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6707 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6708 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6709 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6710 | "$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] | 6711 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6712 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6713 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6714 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6715 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6716 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6717 | 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] | 6718 | "$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] | 6719 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6720 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6721 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6722 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6723 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6724 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6725 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6726 | "$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] | 6727 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6728 | 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] | 6729 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6730 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6731 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6732 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6733 | 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] | 6734 | "$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] | 6735 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6736 | 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] | 6737 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6738 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6739 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6740 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6741 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6742 | "$P_SRV" \ |
| 6743 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6745 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6746 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6747 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6748 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6749 | 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] | 6750 | "$P_SRV" \ |
| 6751 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 6752 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6753 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6754 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6755 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6756 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6757 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6758 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6759 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 6760 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6761 | "$P_CLI force_version=ssl3 \ |
| 6762 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6763 | 0 \ |
| 6764 | -c "Read from server: 16384 bytes read" |
| 6765 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6766 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 6767 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6768 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 6769 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 6770 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 6771 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6772 | 0 \ |
| 6773 | -c "Read from server: 1 bytes read"\ |
| 6774 | -c "16383 bytes read"\ |
| 6775 | -C "Read from server: 16384 bytes read" |
| 6776 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6777 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 6778 | "$P_SRV response_size=16384" \ |
| 6779 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6780 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6781 | 0 \ |
| 6782 | -c "Read from server: 1 bytes read"\ |
| 6783 | -c "16383 bytes read"\ |
| 6784 | -C "Read from server: 16384 bytes read" |
| 6785 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6786 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6787 | "$P_SRV response_size=16384" \ |
| 6788 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 6789 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6790 | 0 \ |
| 6791 | -c "Read from server: 1 bytes read"\ |
| 6792 | -c "16383 bytes read"\ |
| 6793 | -C "Read from server: 16384 bytes read" |
| 6794 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6796 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 6797 | "$P_SRV response_size=16384" \ |
| 6798 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 6799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6800 | trunc_hmac=1" \ |
| 6801 | 0 \ |
| 6802 | -c "Read from server: 1 bytes read"\ |
| 6803 | -c "16383 bytes read"\ |
| 6804 | -C "Read from server: 16384 bytes read" |
| 6805 | |
| 6806 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6807 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 6808 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6809 | "$P_CLI force_version=tls1 \ |
| 6810 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6811 | trunc_hmac=1" \ |
| 6812 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6813 | -s "16384 bytes written in 1 fragments" \ |
| 6814 | -c "Read from server: 16384 bytes read" |
| 6815 | |
| 6816 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 6817 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6818 | "$P_CLI force_version=tls1 \ |
| 6819 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6820 | 0 \ |
| 6821 | -s "16384 bytes written in 1 fragments" \ |
| 6822 | -c "Read from server: 16384 bytes read" |
| 6823 | |
| 6824 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6825 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6826 | "$P_CLI force_version=tls1 \ |
| 6827 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6828 | 0 \ |
| 6829 | -s "16384 bytes written in 1 fragments" \ |
| 6830 | -c "Read from server: 16384 bytes read" |
| 6831 | |
| 6832 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6833 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6834 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6835 | "$P_CLI force_version=tls1 \ |
| 6836 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6837 | 0 \ |
| 6838 | -s "16384 bytes written in 1 fragments" \ |
| 6839 | -c "Read from server: 16384 bytes read" |
| 6840 | |
| 6841 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6842 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6843 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6844 | "$P_CLI force_version=tls1 \ |
| 6845 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6846 | 0 \ |
| 6847 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6848 | -c "Read from server: 16384 bytes read" |
| 6849 | |
| 6850 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 6851 | "$P_SRV response_size=16384" \ |
| 6852 | "$P_CLI force_version=tls1_1 \ |
| 6853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6854 | 0 \ |
| 6855 | -c "Read from server: 16384 bytes read" |
| 6856 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6857 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6858 | "$P_SRV response_size=16384" \ |
| 6859 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 6860 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6861 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6862 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6863 | -c "Read from server: 16384 bytes read" |
| 6864 | |
| 6865 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6866 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 6867 | "$P_SRV response_size=16384" \ |
| 6868 | "$P_CLI force_version=tls1_1 \ |
| 6869 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6870 | trunc_hmac=1" \ |
| 6871 | 0 \ |
| 6872 | -c "Read from server: 16384 bytes read" |
| 6873 | |
| 6874 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6875 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6876 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6877 | "$P_CLI force_version=tls1_1 \ |
| 6878 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6879 | 0 \ |
| 6880 | -s "16384 bytes written in 1 fragments" \ |
| 6881 | -c "Read from server: 16384 bytes read" |
| 6882 | |
| 6883 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 6884 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6885 | "$P_CLI force_version=tls1_1 \ |
| 6886 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6887 | 0 \ |
| 6888 | -c "Read from server: 16384 bytes read" |
| 6889 | |
| 6890 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6891 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6892 | "$P_CLI force_version=tls1_1 \ |
| 6893 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6894 | 0 \ |
| 6895 | -s "16384 bytes written in 1 fragments" \ |
| 6896 | -c "Read from server: 16384 bytes read" |
| 6897 | |
| 6898 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6899 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 6900 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6901 | "$P_CLI force_version=tls1_1 \ |
| 6902 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6903 | trunc_hmac=1" \ |
| 6904 | 0 \ |
| 6905 | -c "Read from server: 16384 bytes read" |
| 6906 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6907 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6908 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6909 | "$P_CLI force_version=tls1_1 \ |
| 6910 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6911 | 0 \ |
| 6912 | -s "16384 bytes written in 1 fragments" \ |
| 6913 | -c "Read from server: 16384 bytes read" |
| 6914 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6915 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 6916 | "$P_SRV response_size=16384" \ |
| 6917 | "$P_CLI force_version=tls1_2 \ |
| 6918 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6919 | 0 \ |
| 6920 | -c "Read from server: 16384 bytes read" |
| 6921 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6922 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6923 | "$P_SRV response_size=16384" \ |
| 6924 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 6925 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6926 | 0 \ |
| 6927 | -s "16384 bytes written in 1 fragments" \ |
| 6928 | -c "Read from server: 16384 bytes read" |
| 6929 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6930 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6931 | "$P_SRV response_size=16384" \ |
| 6932 | "$P_CLI force_version=tls1_2 \ |
| 6933 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6934 | 0 \ |
| 6935 | -c "Read from server: 16384 bytes read" |
| 6936 | |
| 6937 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6938 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 6939 | "$P_SRV response_size=16384" \ |
| 6940 | "$P_CLI force_version=tls1_2 \ |
| 6941 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 6942 | trunc_hmac=1" \ |
| 6943 | 0 \ |
| 6944 | -c "Read from server: 16384 bytes read" |
| 6945 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6946 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6947 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 6948 | "$P_CLI force_version=tls1_2 \ |
| 6949 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6950 | 0 \ |
| 6951 | -s "16384 bytes written in 1 fragments" \ |
| 6952 | -c "Read from server: 16384 bytes read" |
| 6953 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6954 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 6955 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6956 | "$P_CLI force_version=tls1_2 \ |
| 6957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6958 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6959 | -s "16384 bytes written in 1 fragments" \ |
| 6960 | -c "Read from server: 16384 bytes read" |
| 6961 | |
| 6962 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6963 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6964 | "$P_CLI force_version=tls1_2 \ |
| 6965 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6966 | 0 \ |
| 6967 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6968 | -c "Read from server: 16384 bytes read" |
| 6969 | |
| 6970 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6971 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 6972 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6973 | "$P_CLI force_version=tls1_2 \ |
| 6974 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6975 | trunc_hmac=1" \ |
| 6976 | 0 \ |
| 6977 | -c "Read from server: 16384 bytes read" |
| 6978 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6980 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6981 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6982 | "$P_CLI force_version=tls1_2 \ |
| 6983 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6984 | 0 \ |
| 6985 | -s "16384 bytes written in 1 fragments" \ |
| 6986 | -c "Read from server: 16384 bytes read" |
| 6987 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6988 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 6989 | "$P_SRV response_size=16384" \ |
| 6990 | "$P_CLI force_version=tls1_2 \ |
| 6991 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6992 | 0 \ |
| 6993 | -c "Read from server: 16384 bytes read" |
| 6994 | |
| 6995 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 6996 | "$P_SRV response_size=16384" \ |
| 6997 | "$P_CLI force_version=tls1_2 \ |
| 6998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6999 | 0 \ |
| 7000 | -c "Read from server: 16384 bytes read" |
| 7001 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7002 | # Tests for restartable ECC |
| 7003 | |
| 7004 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7005 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7006 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7007 | "$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] | 7008 | 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] | 7009 | debug_level=1" \ |
| 7010 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7011 | -C "x509_verify_cert.*4b00" \ |
| 7012 | -C "mbedtls_pk_verify.*4b00" \ |
| 7013 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7014 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7015 | |
| 7016 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7017 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7018 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7019 | "$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] | 7020 | 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] | 7021 | debug_level=1 ec_max_ops=0" \ |
| 7022 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7023 | -C "x509_verify_cert.*4b00" \ |
| 7024 | -C "mbedtls_pk_verify.*4b00" \ |
| 7025 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7026 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7027 | |
| 7028 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7029 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7030 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7031 | "$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] | 7032 | 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] | 7033 | debug_level=1 ec_max_ops=65535" \ |
| 7034 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7035 | -C "x509_verify_cert.*4b00" \ |
| 7036 | -C "mbedtls_pk_verify.*4b00" \ |
| 7037 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7038 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7039 | |
| 7040 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7041 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7042 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7043 | "$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] | 7044 | 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] | 7045 | debug_level=1 ec_max_ops=1000" \ |
| 7046 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7047 | -c "x509_verify_cert.*4b00" \ |
| 7048 | -c "mbedtls_pk_verify.*4b00" \ |
| 7049 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7050 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7051 | |
| 7052 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7053 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7054 | "$P_SRV auth_mode=required \ |
| 7055 | crt_file=data_files/server5-badsign.crt \ |
| 7056 | key_file=data_files/server5.key" \ |
| 7057 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7058 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7059 | debug_level=1 ec_max_ops=1000" \ |
| 7060 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7061 | -c "x509_verify_cert.*4b00" \ |
| 7062 | -C "mbedtls_pk_verify.*4b00" \ |
| 7063 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7064 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7065 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7066 | -c "! mbedtls_ssl_handshake returned" \ |
| 7067 | -c "X509 - Certificate verification failed" |
| 7068 | |
| 7069 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7070 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7071 | "$P_SRV auth_mode=required \ |
| 7072 | crt_file=data_files/server5-badsign.crt \ |
| 7073 | key_file=data_files/server5.key" \ |
| 7074 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7075 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7076 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7077 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7078 | -c "x509_verify_cert.*4b00" \ |
| 7079 | -c "mbedtls_pk_verify.*4b00" \ |
| 7080 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7081 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7082 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7083 | -C "! mbedtls_ssl_handshake returned" \ |
| 7084 | -C "X509 - Certificate verification failed" |
| 7085 | |
| 7086 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7087 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7088 | "$P_SRV auth_mode=required \ |
| 7089 | crt_file=data_files/server5-badsign.crt \ |
| 7090 | key_file=data_files/server5.key" \ |
| 7091 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7092 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7093 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7094 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7095 | -C "x509_verify_cert.*4b00" \ |
| 7096 | -c "mbedtls_pk_verify.*4b00" \ |
| 7097 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7098 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7099 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7100 | -C "! mbedtls_ssl_handshake returned" \ |
| 7101 | -C "X509 - Certificate verification failed" |
| 7102 | |
| 7103 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7104 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7105 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7106 | "$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] | 7107 | 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] | 7108 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7109 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7110 | -c "x509_verify_cert.*4b00" \ |
| 7111 | -c "mbedtls_pk_verify.*4b00" \ |
| 7112 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7113 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7114 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7115 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7116 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7117 | "$P_SRV" \ |
| 7118 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7119 | debug_level=1 ec_max_ops=1000" \ |
| 7120 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7121 | -c "x509_verify_cert.*4b00" \ |
| 7122 | -c "mbedtls_pk_verify.*4b00" \ |
| 7123 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7124 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7125 | |
| 7126 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7127 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7128 | "$P_SRV psk=abc123" \ |
| 7129 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7130 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7131 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7132 | -C "x509_verify_cert.*4b00" \ |
| 7133 | -C "mbedtls_pk_verify.*4b00" \ |
| 7134 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7135 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7136 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7137 | # Tests of asynchronous private key support in SSL |
| 7138 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7139 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7140 | run_test "SSL async private: sign, delay=0" \ |
| 7141 | "$P_SRV \ |
| 7142 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7143 | "$P_CLI" \ |
| 7144 | 0 \ |
| 7145 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7146 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7147 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7149 | run_test "SSL async private: sign, delay=1" \ |
| 7150 | "$P_SRV \ |
| 7151 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7152 | "$P_CLI" \ |
| 7153 | 0 \ |
| 7154 | -s "Async sign callback: using key slot " \ |
| 7155 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7156 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7157 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7158 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7159 | run_test "SSL async private: sign, delay=2" \ |
| 7160 | "$P_SRV \ |
| 7161 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7162 | "$P_CLI" \ |
| 7163 | 0 \ |
| 7164 | -s "Async sign callback: using key slot " \ |
| 7165 | -U "Async sign callback: using key slot " \ |
| 7166 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7167 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7168 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7169 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7170 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7171 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7172 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7173 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7174 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7175 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7176 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7177 | "$P_CLI force_version=tls1_1" \ |
| 7178 | 0 \ |
| 7179 | -s "Async sign callback: using key slot " \ |
| 7180 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7181 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7182 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7183 | run_test "SSL async private: sign, SNI" \ |
| 7184 | "$P_SRV debug_level=3 \ |
| 7185 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7186 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7187 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7188 | "$P_CLI server_name=polarssl.example" \ |
| 7189 | 0 \ |
| 7190 | -s "Async sign callback: using key slot " \ |
| 7191 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7192 | -s "parse ServerName extension" \ |
| 7193 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7194 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7195 | |
| 7196 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7197 | run_test "SSL async private: decrypt, delay=0" \ |
| 7198 | "$P_SRV \ |
| 7199 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7200 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7201 | 0 \ |
| 7202 | -s "Async decrypt callback: using key slot " \ |
| 7203 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7204 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7205 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7206 | run_test "SSL async private: decrypt, delay=1" \ |
| 7207 | "$P_SRV \ |
| 7208 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7209 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7210 | 0 \ |
| 7211 | -s "Async decrypt callback: using key slot " \ |
| 7212 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7213 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7214 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7215 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7216 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7217 | "$P_SRV psk=abc123 \ |
| 7218 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7219 | "$P_CLI psk=abc123 \ |
| 7220 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7221 | 0 \ |
| 7222 | -s "Async decrypt callback: using key slot " \ |
| 7223 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7224 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7225 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7226 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7227 | "$P_SRV psk=abc123 \ |
| 7228 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7229 | "$P_CLI psk=abc123 \ |
| 7230 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7231 | 0 \ |
| 7232 | -s "Async decrypt callback: using key slot " \ |
| 7233 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7234 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7235 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7236 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7237 | run_test "SSL async private: sign callback not present" \ |
| 7238 | "$P_SRV \ |
| 7239 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7240 | "$P_CLI; [ \$? -eq 1 ] && |
| 7241 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7242 | 0 \ |
| 7243 | -S "Async sign callback" \ |
| 7244 | -s "! mbedtls_ssl_handshake returned" \ |
| 7245 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7246 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7247 | -s "Successful connection" |
| 7248 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7249 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7250 | run_test "SSL async private: decrypt callback not present" \ |
| 7251 | "$P_SRV debug_level=1 \ |
| 7252 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7253 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7254 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7255 | 0 \ |
| 7256 | -S "Async decrypt callback" \ |
| 7257 | -s "! mbedtls_ssl_handshake returned" \ |
| 7258 | -s "got no RSA private key" \ |
| 7259 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7260 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7261 | |
| 7262 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7263 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7264 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7265 | "$P_SRV \ |
| 7266 | async_operations=s async_private_delay1=1 \ |
| 7267 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7268 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7269 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7270 | 0 \ |
| 7271 | -s "Async sign callback: using key slot 0," \ |
| 7272 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7273 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7274 | |
| 7275 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7277 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7278 | "$P_SRV \ |
| 7279 | async_operations=s async_private_delay2=1 \ |
| 7280 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7281 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7282 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7283 | 0 \ |
| 7284 | -s "Async sign callback: using key slot 0," \ |
| 7285 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7286 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7287 | |
| 7288 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7290 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7291 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7292 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7293 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7294 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7295 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7296 | 0 \ |
| 7297 | -s "Async sign callback: using key slot 1," \ |
| 7298 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7299 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7300 | |
| 7301 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7302 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7303 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7304 | "$P_SRV \ |
| 7305 | async_operations=s async_private_delay1=1 \ |
| 7306 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7307 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7308 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7309 | 0 \ |
| 7310 | -s "Async sign callback: no key matches this certificate." |
| 7311 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7312 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7313 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7314 | "$P_SRV \ |
| 7315 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7316 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7317 | "$P_CLI" \ |
| 7318 | 1 \ |
| 7319 | -s "Async sign callback: injected error" \ |
| 7320 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7321 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7322 | -s "! mbedtls_ssl_handshake returned" |
| 7323 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7324 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7325 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7326 | "$P_SRV \ |
| 7327 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7328 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7329 | "$P_CLI" \ |
| 7330 | 1 \ |
| 7331 | -s "Async sign callback: using key slot " \ |
| 7332 | -S "Async resume" \ |
| 7333 | -s "Async cancel" |
| 7334 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7335 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7336 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7337 | "$P_SRV \ |
| 7338 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7339 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7340 | "$P_CLI" \ |
| 7341 | 1 \ |
| 7342 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7343 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7344 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7345 | -s "! mbedtls_ssl_handshake returned" |
| 7346 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7347 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7348 | run_test "SSL async private: decrypt, error in start" \ |
| 7349 | "$P_SRV \ |
| 7350 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7351 | async_private_error=1" \ |
| 7352 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7353 | 1 \ |
| 7354 | -s "Async decrypt callback: injected error" \ |
| 7355 | -S "Async resume" \ |
| 7356 | -S "Async cancel" \ |
| 7357 | -s "! mbedtls_ssl_handshake returned" |
| 7358 | |
| 7359 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7360 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7361 | "$P_SRV \ |
| 7362 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7363 | async_private_error=2" \ |
| 7364 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7365 | 1 \ |
| 7366 | -s "Async decrypt callback: using key slot " \ |
| 7367 | -S "Async resume" \ |
| 7368 | -s "Async cancel" |
| 7369 | |
| 7370 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7371 | run_test "SSL async private: decrypt, error in resume" \ |
| 7372 | "$P_SRV \ |
| 7373 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7374 | async_private_error=3" \ |
| 7375 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7376 | 1 \ |
| 7377 | -s "Async decrypt callback: using key slot " \ |
| 7378 | -s "Async resume callback: decrypt done but injected error" \ |
| 7379 | -S "Async cancel" \ |
| 7380 | -s "! mbedtls_ssl_handshake returned" |
| 7381 | |
| 7382 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7383 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7384 | "$P_SRV \ |
| 7385 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7386 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7387 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7388 | 0 \ |
| 7389 | -s "Async cancel" \ |
| 7390 | -s "! mbedtls_ssl_handshake returned" \ |
| 7391 | -s "Async resume" \ |
| 7392 | -s "Successful connection" |
| 7393 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7394 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7395 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7396 | "$P_SRV \ |
| 7397 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7398 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7399 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7400 | 0 \ |
| 7401 | -s "! mbedtls_ssl_handshake returned" \ |
| 7402 | -s "Async resume" \ |
| 7403 | -s "Successful connection" |
| 7404 | |
| 7405 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7406 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7407 | 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] | 7408 | "$P_SRV \ |
| 7409 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7410 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7411 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7412 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7413 | [ \$? -eq 1 ] && |
| 7414 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7415 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7416 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7417 | -S "Async resume" \ |
| 7418 | -s "Async cancel" \ |
| 7419 | -s "! mbedtls_ssl_handshake returned" \ |
| 7420 | -s "Async sign callback: no key matches this certificate." \ |
| 7421 | -s "Successful connection" |
| 7422 | |
| 7423 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7424 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7425 | 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] | 7426 | "$P_SRV \ |
| 7427 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7428 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7429 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7430 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7431 | [ \$? -eq 1 ] && |
| 7432 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7433 | 0 \ |
| 7434 | -s "Async resume" \ |
| 7435 | -s "! mbedtls_ssl_handshake returned" \ |
| 7436 | -s "Async sign callback: no key matches this certificate." \ |
| 7437 | -s "Successful connection" |
| 7438 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7439 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7440 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7441 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7442 | "$P_SRV \ |
| 7443 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7444 | exchanges=2 renegotiation=1" \ |
| 7445 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7446 | 0 \ |
| 7447 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7448 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7449 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7450 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7452 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7453 | "$P_SRV \ |
| 7454 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7455 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7456 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7457 | 0 \ |
| 7458 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7459 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7460 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7463 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7464 | "$P_SRV \ |
| 7465 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7466 | exchanges=2 renegotiation=1" \ |
| 7467 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7468 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7469 | 0 \ |
| 7470 | -s "Async decrypt callback: using key slot " \ |
| 7471 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7472 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7473 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7475 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7476 | "$P_SRV \ |
| 7477 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7478 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7479 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7480 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7481 | 0 \ |
| 7482 | -s "Async decrypt callback: using key slot " \ |
| 7483 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7484 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7485 | # Tests for ECC extensions (rfc 4492) |
| 7486 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7487 | requires_config_enabled MBEDTLS_AES_C |
| 7488 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7489 | requires_config_enabled MBEDTLS_SHA256_C |
| 7490 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7491 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7492 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7493 | "$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] | 7494 | 0 \ |
| 7495 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7496 | -C "client hello, adding supported_point_formats extension" \ |
| 7497 | -S "found supported elliptic curves extension" \ |
| 7498 | -S "found supported point formats extension" |
| 7499 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7500 | requires_config_enabled MBEDTLS_AES_C |
| 7501 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7502 | requires_config_enabled MBEDTLS_SHA256_C |
| 7503 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7504 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7505 | "$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] | 7506 | "$P_CLI debug_level=3" \ |
| 7507 | 0 \ |
| 7508 | -C "found supported_point_formats extension" \ |
| 7509 | -S "server hello, supported_point_formats extension" |
| 7510 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7511 | requires_config_enabled MBEDTLS_AES_C |
| 7512 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7513 | requires_config_enabled MBEDTLS_SHA256_C |
| 7514 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7515 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7516 | "$P_SRV debug_level=3" \ |
| 7517 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7518 | 0 \ |
| 7519 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7520 | -c "client hello, adding supported_point_formats extension" \ |
| 7521 | -s "found supported elliptic curves extension" \ |
| 7522 | -s "found supported point formats extension" |
| 7523 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7524 | requires_config_enabled MBEDTLS_AES_C |
| 7525 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7526 | requires_config_enabled MBEDTLS_SHA256_C |
| 7527 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7528 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7529 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7530 | "$P_CLI debug_level=3" \ |
| 7531 | 0 \ |
| 7532 | -c "found supported_point_formats extension" \ |
| 7533 | -s "server hello, supported_point_formats extension" |
| 7534 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7535 | # Tests for DTLS HelloVerifyRequest |
| 7536 | |
| 7537 | run_test "DTLS cookie: enabled" \ |
| 7538 | "$P_SRV dtls=1 debug_level=2" \ |
| 7539 | "$P_CLI dtls=1 debug_level=2" \ |
| 7540 | 0 \ |
| 7541 | -s "cookie verification failed" \ |
| 7542 | -s "cookie verification passed" \ |
| 7543 | -S "cookie verification skipped" \ |
| 7544 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7545 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7546 | -S "SSL - The requested feature is not available" |
| 7547 | |
| 7548 | run_test "DTLS cookie: disabled" \ |
| 7549 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7550 | "$P_CLI dtls=1 debug_level=2" \ |
| 7551 | 0 \ |
| 7552 | -S "cookie verification failed" \ |
| 7553 | -S "cookie verification passed" \ |
| 7554 | -s "cookie verification skipped" \ |
| 7555 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7556 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7557 | -S "SSL - The requested feature is not available" |
| 7558 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7559 | run_test "DTLS cookie: default (failing)" \ |
| 7560 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7561 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7562 | 1 \ |
| 7563 | -s "cookie verification failed" \ |
| 7564 | -S "cookie verification passed" \ |
| 7565 | -S "cookie verification skipped" \ |
| 7566 | -C "received hello verify request" \ |
| 7567 | -S "hello verification requested" \ |
| 7568 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7569 | |
| 7570 | requires_ipv6 |
| 7571 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7572 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7573 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7574 | 0 \ |
| 7575 | -s "cookie verification failed" \ |
| 7576 | -s "cookie verification passed" \ |
| 7577 | -S "cookie verification skipped" \ |
| 7578 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7579 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7580 | -S "SSL - The requested feature is not available" |
| 7581 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7582 | run_test "DTLS cookie: enabled, nbio" \ |
| 7583 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7584 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7585 | 0 \ |
| 7586 | -s "cookie verification failed" \ |
| 7587 | -s "cookie verification passed" \ |
| 7588 | -S "cookie verification skipped" \ |
| 7589 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7590 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7591 | -S "SSL - The requested feature is not available" |
| 7592 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7593 | # Tests for client reconnecting from the same port with DTLS |
| 7594 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7595 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7596 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7597 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7598 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7599 | 0 \ |
| 7600 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7601 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7602 | -S "Client initiated reconnection from same port" |
| 7603 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7604 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7605 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7606 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7607 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7608 | 0 \ |
| 7609 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7610 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7611 | -s "Client initiated reconnection from same port" |
| 7612 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7613 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7614 | 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] | 7615 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7616 | "$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] | 7617 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7618 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7619 | -s "Client initiated reconnection from same port" |
| 7620 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7621 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7622 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7623 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7624 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7625 | 0 \ |
| 7626 | -S "The operation timed out" \ |
| 7627 | -s "Client initiated reconnection from same port" |
| 7628 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7629 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7630 | "$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] | 7631 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7632 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7633 | -s "The operation timed out" \ |
| 7634 | -S "Client initiated reconnection from same port" |
| 7635 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7636 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7637 | -p "$P_PXY inject_clihlo=1" \ |
| 7638 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7639 | "$P_CLI dtls=1 exchanges=2" \ |
| 7640 | 0 \ |
| 7641 | -s "possible client reconnect from the same port" \ |
| 7642 | -S "Client initiated reconnection from same port" |
| 7643 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7644 | # Tests for various cases of client authentication with DTLS |
| 7645 | # (focused on handshake flows and message parsing) |
| 7646 | |
| 7647 | run_test "DTLS client auth: required" \ |
| 7648 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7649 | "$P_CLI dtls=1" \ |
| 7650 | 0 \ |
| 7651 | -s "Verifying peer X.509 certificate... ok" |
| 7652 | |
| 7653 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7654 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7655 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7656 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7657 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7658 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7659 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7660 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7661 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7662 | 0 \ |
| 7663 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7664 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7665 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7666 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7667 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7668 | "$P_CLI dtls=1 psk=abc124" \ |
| 7669 | 1 \ |
| 7670 | -s "SSL - Verification of the message MAC failed" \ |
| 7671 | -c "SSL - A fatal alert message was received from our peer" |
| 7672 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7673 | # Tests for receiving fragmented handshake messages with DTLS |
| 7674 | |
| 7675 | requires_gnutls |
| 7676 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7677 | "$G_SRV -u --mtu 2048 -a" \ |
| 7678 | "$P_CLI dtls=1 debug_level=2" \ |
| 7679 | 0 \ |
| 7680 | -C "found fragmented DTLS handshake message" \ |
| 7681 | -C "error" |
| 7682 | |
| 7683 | requires_gnutls |
| 7684 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 7685 | "$G_SRV -u --mtu 512" \ |
| 7686 | "$P_CLI dtls=1 debug_level=2" \ |
| 7687 | 0 \ |
| 7688 | -c "found fragmented DTLS handshake message" \ |
| 7689 | -C "error" |
| 7690 | |
| 7691 | requires_gnutls |
| 7692 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 7693 | "$G_SRV -u --mtu 128" \ |
| 7694 | "$P_CLI dtls=1 debug_level=2" \ |
| 7695 | 0 \ |
| 7696 | -c "found fragmented DTLS handshake message" \ |
| 7697 | -C "error" |
| 7698 | |
| 7699 | requires_gnutls |
| 7700 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 7701 | "$G_SRV -u --mtu 128" \ |
| 7702 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7703 | 0 \ |
| 7704 | -c "found fragmented DTLS handshake message" \ |
| 7705 | -C "error" |
| 7706 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7707 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7709 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 7710 | "$G_SRV -u --mtu 256" \ |
| 7711 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7712 | 0 \ |
| 7713 | -c "found fragmented DTLS handshake message" \ |
| 7714 | -c "client hello, adding renegotiation extension" \ |
| 7715 | -c "found renegotiation extension" \ |
| 7716 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7717 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7718 | -C "error" \ |
| 7719 | -s "Extra-header:" |
| 7720 | |
| 7721 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7722 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7723 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 7724 | "$G_SRV -u --mtu 256" \ |
| 7725 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 7726 | 0 \ |
| 7727 | -c "found fragmented DTLS handshake message" \ |
| 7728 | -c "client hello, adding renegotiation extension" \ |
| 7729 | -c "found renegotiation extension" \ |
| 7730 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7731 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7732 | -C "error" \ |
| 7733 | -s "Extra-header:" |
| 7734 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7735 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 7736 | "$O_SRV -dtls1 -mtu 2048" \ |
| 7737 | "$P_CLI dtls=1 debug_level=2" \ |
| 7738 | 0 \ |
| 7739 | -C "found fragmented DTLS handshake message" \ |
| 7740 | -C "error" |
| 7741 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7742 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 7743 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7744 | "$P_CLI dtls=1 debug_level=2" \ |
| 7745 | 0 \ |
| 7746 | -c "found fragmented DTLS handshake message" \ |
| 7747 | -C "error" |
| 7748 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7749 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7750 | "$O_SRV -dtls1 -mtu 256" \ |
| 7751 | "$P_CLI dtls=1 debug_level=2" \ |
| 7752 | 0 \ |
| 7753 | -c "found fragmented DTLS handshake message" \ |
| 7754 | -C "error" |
| 7755 | |
| 7756 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 7757 | "$O_SRV -dtls1 -mtu 256" \ |
| 7758 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7759 | 0 \ |
| 7760 | -c "found fragmented DTLS handshake message" \ |
| 7761 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7762 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7763 | # Tests for sending fragmented handshake messages with DTLS |
| 7764 | # |
| 7765 | # Use client auth when we need the client to send large messages, |
| 7766 | # and use large cert chains on both sides too (the long chains we have all use |
| 7767 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 7768 | # Sizes reached (UDP payload): |
| 7769 | # - 2037B for server certificate |
| 7770 | # - 1542B for client certificate |
| 7771 | # - 1013B for newsessionticket |
| 7772 | # - all others below 512B |
| 7773 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 7774 | |
| 7775 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7776 | requires_config_enabled MBEDTLS_RSA_C |
| 7777 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7778 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7779 | run_test "DTLS fragmenting: none (for reference)" \ |
| 7780 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7781 | crt_file=data_files/server7_int-ca.crt \ |
| 7782 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7783 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7784 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7785 | "$P_CLI dtls=1 debug_level=2 \ |
| 7786 | crt_file=data_files/server8_int-ca2.crt \ |
| 7787 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7788 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7789 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7790 | 0 \ |
| 7791 | -S "found fragmented DTLS handshake message" \ |
| 7792 | -C "found fragmented DTLS handshake message" \ |
| 7793 | -C "error" |
| 7794 | |
| 7795 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7796 | requires_config_enabled MBEDTLS_RSA_C |
| 7797 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7798 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7799 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7800 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7801 | crt_file=data_files/server7_int-ca.crt \ |
| 7802 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7803 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7804 | max_frag_len=1024" \ |
| 7805 | "$P_CLI dtls=1 debug_level=2 \ |
| 7806 | crt_file=data_files/server8_int-ca2.crt \ |
| 7807 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7808 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7809 | max_frag_len=2048" \ |
| 7810 | 0 \ |
| 7811 | -S "found fragmented DTLS handshake message" \ |
| 7812 | -c "found fragmented DTLS handshake message" \ |
| 7813 | -C "error" |
| 7814 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7815 | # With the MFL extension, the server has no way of forcing |
| 7816 | # the client to not exceed a certain MTU; hence, the following |
| 7817 | # test can't be replicated with an MTU proxy such as the one |
| 7818 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7820 | requires_config_enabled MBEDTLS_RSA_C |
| 7821 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7822 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7823 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7824 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7825 | crt_file=data_files/server7_int-ca.crt \ |
| 7826 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7827 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7828 | max_frag_len=512" \ |
| 7829 | "$P_CLI dtls=1 debug_level=2 \ |
| 7830 | crt_file=data_files/server8_int-ca2.crt \ |
| 7831 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7832 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7833 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7834 | 0 \ |
| 7835 | -S "found fragmented DTLS handshake message" \ |
| 7836 | -c "found fragmented DTLS handshake message" \ |
| 7837 | -C "error" |
| 7838 | |
| 7839 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7840 | requires_config_enabled MBEDTLS_RSA_C |
| 7841 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7842 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7843 | 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] | 7844 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7845 | crt_file=data_files/server7_int-ca.crt \ |
| 7846 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7847 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7848 | max_frag_len=2048" \ |
| 7849 | "$P_CLI dtls=1 debug_level=2 \ |
| 7850 | crt_file=data_files/server8_int-ca2.crt \ |
| 7851 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7852 | hs_timeout=2500-60000 \ |
| 7853 | max_frag_len=1024" \ |
| 7854 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7855 | -S "found fragmented DTLS handshake message" \ |
| 7856 | -c "found fragmented DTLS handshake message" \ |
| 7857 | -C "error" |
| 7858 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7859 | # While not required by the standard defining the MFL extension |
| 7860 | # (according to which it only applies to records, not to datagrams), |
| 7861 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7862 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7863 | # to the peer. |
| 7864 | # The next test checks that no datagrams significantly larger than the |
| 7865 | # negotiated MFL are sent. |
| 7866 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7867 | requires_config_enabled MBEDTLS_RSA_C |
| 7868 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7869 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7870 | 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] | 7871 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7872 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 7873 | crt_file=data_files/server7_int-ca.crt \ |
| 7874 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7875 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7876 | max_frag_len=2048" \ |
| 7877 | "$P_CLI dtls=1 debug_level=2 \ |
| 7878 | crt_file=data_files/server8_int-ca2.crt \ |
| 7879 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7880 | hs_timeout=2500-60000 \ |
| 7881 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7882 | 0 \ |
| 7883 | -S "found fragmented DTLS handshake message" \ |
| 7884 | -c "found fragmented DTLS handshake message" \ |
| 7885 | -C "error" |
| 7886 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7887 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7888 | requires_config_enabled MBEDTLS_RSA_C |
| 7889 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7890 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7891 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7892 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7893 | crt_file=data_files/server7_int-ca.crt \ |
| 7894 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7895 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7896 | max_frag_len=2048" \ |
| 7897 | "$P_CLI dtls=1 debug_level=2 \ |
| 7898 | crt_file=data_files/server8_int-ca2.crt \ |
| 7899 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7900 | hs_timeout=2500-60000 \ |
| 7901 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7902 | 0 \ |
| 7903 | -s "found fragmented DTLS handshake message" \ |
| 7904 | -c "found fragmented DTLS handshake message" \ |
| 7905 | -C "error" |
| 7906 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7907 | # While not required by the standard defining the MFL extension |
| 7908 | # (according to which it only applies to records, not to datagrams), |
| 7909 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 7910 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 7911 | # to the peer. |
| 7912 | # The next test checks that no datagrams significantly larger than the |
| 7913 | # negotiated MFL are sent. |
| 7914 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7915 | requires_config_enabled MBEDTLS_RSA_C |
| 7916 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7917 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 7918 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7919 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7920 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7921 | crt_file=data_files/server7_int-ca.crt \ |
| 7922 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7923 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7924 | max_frag_len=2048" \ |
| 7925 | "$P_CLI dtls=1 debug_level=2 \ |
| 7926 | crt_file=data_files/server8_int-ca2.crt \ |
| 7927 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7928 | hs_timeout=2500-60000 \ |
| 7929 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7930 | 0 \ |
| 7931 | -s "found fragmented DTLS handshake message" \ |
| 7932 | -c "found fragmented DTLS handshake message" \ |
| 7933 | -C "error" |
| 7934 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7935 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7936 | requires_config_enabled MBEDTLS_RSA_C |
| 7937 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7938 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 7939 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7940 | crt_file=data_files/server7_int-ca.crt \ |
| 7941 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7942 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7943 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7944 | "$P_CLI dtls=1 debug_level=2 \ |
| 7945 | crt_file=data_files/server8_int-ca2.crt \ |
| 7946 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7947 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7948 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7949 | 0 \ |
| 7950 | -S "found fragmented DTLS handshake message" \ |
| 7951 | -C "found fragmented DTLS handshake message" \ |
| 7952 | -C "error" |
| 7953 | |
| 7954 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7955 | requires_config_enabled MBEDTLS_RSA_C |
| 7956 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7957 | run_test "DTLS fragmenting: client (MTU)" \ |
| 7958 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7959 | crt_file=data_files/server7_int-ca.crt \ |
| 7960 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7961 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7962 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7963 | "$P_CLI dtls=1 debug_level=2 \ |
| 7964 | crt_file=data_files/server8_int-ca2.crt \ |
| 7965 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7966 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7967 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7968 | 0 \ |
| 7969 | -s "found fragmented DTLS handshake message" \ |
| 7970 | -C "found fragmented DTLS handshake message" \ |
| 7971 | -C "error" |
| 7972 | |
| 7973 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7974 | requires_config_enabled MBEDTLS_RSA_C |
| 7975 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7976 | run_test "DTLS fragmenting: server (MTU)" \ |
| 7977 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7978 | crt_file=data_files/server7_int-ca.crt \ |
| 7979 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7980 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7981 | mtu=512" \ |
| 7982 | "$P_CLI dtls=1 debug_level=2 \ |
| 7983 | crt_file=data_files/server8_int-ca2.crt \ |
| 7984 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7985 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7986 | mtu=2048" \ |
| 7987 | 0 \ |
| 7988 | -S "found fragmented DTLS handshake message" \ |
| 7989 | -c "found fragmented DTLS handshake message" \ |
| 7990 | -C "error" |
| 7991 | |
| 7992 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7993 | requires_config_enabled MBEDTLS_RSA_C |
| 7994 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7995 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7996 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7997 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7998 | crt_file=data_files/server7_int-ca.crt \ |
| 7999 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8000 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8001 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8002 | "$P_CLI dtls=1 debug_level=2 \ |
| 8003 | crt_file=data_files/server8_int-ca2.crt \ |
| 8004 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8005 | hs_timeout=2500-60000 \ |
| 8006 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8007 | 0 \ |
| 8008 | -s "found fragmented DTLS handshake message" \ |
| 8009 | -c "found fragmented DTLS handshake message" \ |
| 8010 | -C "error" |
| 8011 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8012 | # 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] | 8013 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8014 | requires_config_enabled MBEDTLS_RSA_C |
| 8015 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8016 | requires_config_enabled MBEDTLS_SHA256_C |
| 8017 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8018 | requires_config_enabled MBEDTLS_AES_C |
| 8019 | requires_config_enabled MBEDTLS_GCM_C |
| 8020 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8021 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8022 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8023 | crt_file=data_files/server7_int-ca.crt \ |
| 8024 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8025 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8026 | mtu=512" \ |
| 8027 | "$P_CLI dtls=1 debug_level=2 \ |
| 8028 | crt_file=data_files/server8_int-ca2.crt \ |
| 8029 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8030 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8031 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8032 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8033 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8034 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8035 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8036 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8037 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8038 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8039 | # 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] | 8040 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8041 | # retransmissions, but in some cases (like both the server and client using |
| 8042 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8043 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8044 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8045 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8046 | requires_config_enabled MBEDTLS_RSA_C |
| 8047 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8048 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8049 | requires_config_enabled MBEDTLS_AES_C |
| 8050 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8051 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8052 | -p "$P_PXY mtu=508" \ |
| 8053 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8054 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8055 | key_file=data_files/server7.key \ |
| 8056 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8057 | "$P_CLI dtls=1 debug_level=2 \ |
| 8058 | crt_file=data_files/server8_int-ca2.crt \ |
| 8059 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8060 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8061 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8062 | 0 \ |
| 8063 | -s "found fragmented DTLS handshake message" \ |
| 8064 | -c "found fragmented DTLS handshake message" \ |
| 8065 | -C "error" |
| 8066 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8067 | # 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] | 8068 | only_with_valgrind |
| 8069 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8070 | requires_config_enabled MBEDTLS_RSA_C |
| 8071 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8072 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8073 | requires_config_enabled MBEDTLS_AES_C |
| 8074 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8075 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8076 | -p "$P_PXY mtu=508" \ |
| 8077 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8078 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8079 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8080 | hs_timeout=250-10000" \ |
| 8081 | "$P_CLI dtls=1 debug_level=2 \ |
| 8082 | crt_file=data_files/server8_int-ca2.crt \ |
| 8083 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8084 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8085 | hs_timeout=250-10000" \ |
| 8086 | 0 \ |
| 8087 | -s "found fragmented DTLS handshake message" \ |
| 8088 | -c "found fragmented DTLS handshake message" \ |
| 8089 | -C "error" |
| 8090 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8091 | # 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] | 8092 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8093 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8094 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8095 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8096 | requires_config_enabled MBEDTLS_RSA_C |
| 8097 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8098 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8099 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8100 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8101 | crt_file=data_files/server7_int-ca.crt \ |
| 8102 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8103 | hs_timeout=10000-60000 \ |
| 8104 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8105 | "$P_CLI dtls=1 debug_level=2 \ |
| 8106 | crt_file=data_files/server8_int-ca2.crt \ |
| 8107 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8108 | hs_timeout=10000-60000 \ |
| 8109 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8110 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8111 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8112 | -s "found fragmented DTLS handshake message" \ |
| 8113 | -c "found fragmented DTLS handshake message" \ |
| 8114 | -C "error" |
| 8115 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8116 | # 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] | 8117 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8118 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8119 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8120 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8121 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8122 | requires_config_enabled MBEDTLS_RSA_C |
| 8123 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8124 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8125 | requires_config_enabled MBEDTLS_AES_C |
| 8126 | requires_config_enabled MBEDTLS_GCM_C |
| 8127 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8128 | -p "$P_PXY mtu=512" \ |
| 8129 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8130 | crt_file=data_files/server7_int-ca.crt \ |
| 8131 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8132 | hs_timeout=10000-60000 \ |
| 8133 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8134 | "$P_CLI dtls=1 debug_level=2 \ |
| 8135 | crt_file=data_files/server8_int-ca2.crt \ |
| 8136 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8137 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8138 | hs_timeout=10000-60000 \ |
| 8139 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8140 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8141 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8142 | -s "found fragmented DTLS handshake message" \ |
| 8143 | -c "found fragmented DTLS handshake message" \ |
| 8144 | -C "error" |
| 8145 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8146 | not_with_valgrind # spurious autoreduction due to timeout |
| 8147 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8148 | requires_config_enabled MBEDTLS_RSA_C |
| 8149 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8150 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8151 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8152 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8153 | crt_file=data_files/server7_int-ca.crt \ |
| 8154 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8155 | hs_timeout=10000-60000 \ |
| 8156 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8157 | "$P_CLI dtls=1 debug_level=2 \ |
| 8158 | crt_file=data_files/server8_int-ca2.crt \ |
| 8159 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8160 | hs_timeout=10000-60000 \ |
| 8161 | mtu=1024 nbio=2" \ |
| 8162 | 0 \ |
| 8163 | -S "autoreduction" \ |
| 8164 | -s "found fragmented DTLS handshake message" \ |
| 8165 | -c "found fragmented DTLS handshake message" \ |
| 8166 | -C "error" |
| 8167 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8168 | # 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] | 8169 | not_with_valgrind # spurious autoreduction due to timeout |
| 8170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8171 | requires_config_enabled MBEDTLS_RSA_C |
| 8172 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8173 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8174 | requires_config_enabled MBEDTLS_AES_C |
| 8175 | requires_config_enabled MBEDTLS_GCM_C |
| 8176 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8177 | -p "$P_PXY mtu=512" \ |
| 8178 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8179 | crt_file=data_files/server7_int-ca.crt \ |
| 8180 | key_file=data_files/server7.key \ |
| 8181 | hs_timeout=10000-60000 \ |
| 8182 | mtu=512 nbio=2" \ |
| 8183 | "$P_CLI dtls=1 debug_level=2 \ |
| 8184 | crt_file=data_files/server8_int-ca2.crt \ |
| 8185 | key_file=data_files/server8.key \ |
| 8186 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8187 | hs_timeout=10000-60000 \ |
| 8188 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8189 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8190 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8191 | -s "found fragmented DTLS handshake message" \ |
| 8192 | -c "found fragmented DTLS handshake message" \ |
| 8193 | -C "error" |
| 8194 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8195 | # 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] | 8196 | # This ensures things still work after session_reset(). |
| 8197 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8198 | # Since we don't support reading fragmented ClientHello yet, |
| 8199 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8200 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8201 | # An autoreduction on the client-side might happen if the server is |
| 8202 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8203 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8204 | # resumed listening, which would result in a spurious autoreduction. |
| 8205 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8206 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8207 | requires_config_enabled MBEDTLS_RSA_C |
| 8208 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8209 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8210 | requires_config_enabled MBEDTLS_AES_C |
| 8211 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8212 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8213 | -p "$P_PXY mtu=1450" \ |
| 8214 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8215 | crt_file=data_files/server7_int-ca.crt \ |
| 8216 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8217 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8218 | mtu=1450" \ |
| 8219 | "$P_CLI dtls=1 debug_level=2 \ |
| 8220 | crt_file=data_files/server8_int-ca2.crt \ |
| 8221 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8222 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8223 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8224 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8225 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8226 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8227 | -s "found fragmented DTLS handshake message" \ |
| 8228 | -c "found fragmented DTLS handshake message" \ |
| 8229 | -C "error" |
| 8230 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8231 | # An autoreduction on the client-side might happen if the server is |
| 8232 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8233 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8234 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8235 | requires_config_enabled MBEDTLS_RSA_C |
| 8236 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8237 | requires_config_enabled MBEDTLS_SHA256_C |
| 8238 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8240 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 8241 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8242 | -p "$P_PXY mtu=512" \ |
| 8243 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8244 | crt_file=data_files/server7_int-ca.crt \ |
| 8245 | key_file=data_files/server7.key \ |
| 8246 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8247 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8248 | mtu=512" \ |
| 8249 | "$P_CLI dtls=1 debug_level=2 \ |
| 8250 | crt_file=data_files/server8_int-ca2.crt \ |
| 8251 | key_file=data_files/server8.key \ |
| 8252 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8253 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8254 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8255 | mtu=512" \ |
| 8256 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8257 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8258 | -s "found fragmented DTLS handshake message" \ |
| 8259 | -c "found fragmented DTLS handshake message" \ |
| 8260 | -C "error" |
| 8261 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8262 | # An autoreduction on the client-side might happen if the server is |
| 8263 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8264 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8265 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8266 | requires_config_enabled MBEDTLS_RSA_C |
| 8267 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8268 | requires_config_enabled MBEDTLS_SHA256_C |
| 8269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8271 | requires_config_enabled MBEDTLS_AES_C |
| 8272 | requires_config_enabled MBEDTLS_GCM_C |
| 8273 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8274 | -p "$P_PXY mtu=512" \ |
| 8275 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8276 | crt_file=data_files/server7_int-ca.crt \ |
| 8277 | key_file=data_files/server7.key \ |
| 8278 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8279 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8280 | mtu=512" \ |
| 8281 | "$P_CLI dtls=1 debug_level=2 \ |
| 8282 | crt_file=data_files/server8_int-ca2.crt \ |
| 8283 | key_file=data_files/server8.key \ |
| 8284 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8285 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8286 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8287 | mtu=512" \ |
| 8288 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8289 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8290 | -s "found fragmented DTLS handshake message" \ |
| 8291 | -c "found fragmented DTLS handshake message" \ |
| 8292 | -C "error" |
| 8293 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8294 | # An autoreduction on the client-side might happen if the server is |
| 8295 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8296 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8297 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8298 | requires_config_enabled MBEDTLS_RSA_C |
| 8299 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8300 | requires_config_enabled MBEDTLS_SHA256_C |
| 8301 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8302 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8303 | requires_config_enabled MBEDTLS_AES_C |
| 8304 | requires_config_enabled MBEDTLS_CCM_C |
| 8305 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8306 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8307 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8308 | crt_file=data_files/server7_int-ca.crt \ |
| 8309 | key_file=data_files/server7.key \ |
| 8310 | exchanges=2 renegotiation=1 \ |
| 8311 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8312 | hs_timeout=10000-60000 \ |
| 8313 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8314 | "$P_CLI dtls=1 debug_level=2 \ |
| 8315 | crt_file=data_files/server8_int-ca2.crt \ |
| 8316 | key_file=data_files/server8.key \ |
| 8317 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8318 | hs_timeout=10000-60000 \ |
| 8319 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8320 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8321 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8322 | -s "found fragmented DTLS handshake message" \ |
| 8323 | -c "found fragmented DTLS handshake message" \ |
| 8324 | -C "error" |
| 8325 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8326 | # An autoreduction on the client-side might happen if the server is |
| 8327 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8328 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8329 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8330 | requires_config_enabled MBEDTLS_RSA_C |
| 8331 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8332 | requires_config_enabled MBEDTLS_SHA256_C |
| 8333 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8334 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8335 | requires_config_enabled MBEDTLS_AES_C |
| 8336 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8337 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 8338 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8339 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8340 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8341 | crt_file=data_files/server7_int-ca.crt \ |
| 8342 | key_file=data_files/server7.key \ |
| 8343 | exchanges=2 renegotiation=1 \ |
| 8344 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8345 | hs_timeout=10000-60000 \ |
| 8346 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8347 | "$P_CLI dtls=1 debug_level=2 \ |
| 8348 | crt_file=data_files/server8_int-ca2.crt \ |
| 8349 | key_file=data_files/server8.key \ |
| 8350 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8351 | hs_timeout=10000-60000 \ |
| 8352 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8353 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8354 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8355 | -s "found fragmented DTLS handshake message" \ |
| 8356 | -c "found fragmented DTLS handshake message" \ |
| 8357 | -C "error" |
| 8358 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8359 | # An autoreduction on the client-side might happen if the server is |
| 8360 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8361 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8363 | requires_config_enabled MBEDTLS_RSA_C |
| 8364 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8365 | requires_config_enabled MBEDTLS_SHA256_C |
| 8366 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8368 | requires_config_enabled MBEDTLS_AES_C |
| 8369 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8370 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8371 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8372 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8373 | crt_file=data_files/server7_int-ca.crt \ |
| 8374 | key_file=data_files/server7.key \ |
| 8375 | exchanges=2 renegotiation=1 \ |
| 8376 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8377 | hs_timeout=10000-60000 \ |
| 8378 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8379 | "$P_CLI dtls=1 debug_level=2 \ |
| 8380 | crt_file=data_files/server8_int-ca2.crt \ |
| 8381 | key_file=data_files/server8.key \ |
| 8382 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8383 | hs_timeout=10000-60000 \ |
| 8384 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8385 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8386 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8387 | -s "found fragmented DTLS handshake message" \ |
| 8388 | -c "found fragmented DTLS handshake message" \ |
| 8389 | -C "error" |
| 8390 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8391 | # 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] | 8392 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8393 | requires_config_enabled MBEDTLS_RSA_C |
| 8394 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8395 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8396 | requires_config_enabled MBEDTLS_AES_C |
| 8397 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8398 | client_needs_more_time 2 |
| 8399 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8400 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8401 | "$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] | 8402 | crt_file=data_files/server7_int-ca.crt \ |
| 8403 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8404 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8405 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8406 | crt_file=data_files/server8_int-ca2.crt \ |
| 8407 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8408 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8409 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8410 | 0 \ |
| 8411 | -s "found fragmented DTLS handshake message" \ |
| 8412 | -c "found fragmented DTLS handshake message" \ |
| 8413 | -C "error" |
| 8414 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8415 | # 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] | 8416 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8417 | requires_config_enabled MBEDTLS_RSA_C |
| 8418 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8419 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 8420 | requires_config_enabled MBEDTLS_AES_C |
| 8421 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8422 | client_needs_more_time 2 |
| 8423 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8424 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8425 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8426 | crt_file=data_files/server7_int-ca.crt \ |
| 8427 | key_file=data_files/server7.key \ |
| 8428 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8429 | "$P_CLI dtls=1 debug_level=2 \ |
| 8430 | crt_file=data_files/server8_int-ca2.crt \ |
| 8431 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8432 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8433 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8434 | 0 \ |
| 8435 | -s "found fragmented DTLS handshake message" \ |
| 8436 | -c "found fragmented DTLS handshake message" \ |
| 8437 | -C "error" |
| 8438 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8439 | # interop tests for DTLS fragmentating with reliable connection |
| 8440 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8441 | # here and below we just want to test that the we fragment in a way that |
| 8442 | # pleases other implementations, so we don't need the peer to fragment |
| 8443 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8444 | requires_config_enabled MBEDTLS_RSA_C |
| 8445 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8446 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8447 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8448 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8449 | "$G_SRV -u" \ |
| 8450 | "$P_CLI dtls=1 debug_level=2 \ |
| 8451 | crt_file=data_files/server8_int-ca2.crt \ |
| 8452 | key_file=data_files/server8.key \ |
| 8453 | mtu=512 force_version=dtls1_2" \ |
| 8454 | 0 \ |
| 8455 | -c "fragmenting handshake message" \ |
| 8456 | -C "error" |
| 8457 | |
| 8458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8459 | requires_config_enabled MBEDTLS_RSA_C |
| 8460 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8462 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8463 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8464 | "$G_SRV -u" \ |
| 8465 | "$P_CLI dtls=1 debug_level=2 \ |
| 8466 | crt_file=data_files/server8_int-ca2.crt \ |
| 8467 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8468 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8469 | 0 \ |
| 8470 | -c "fragmenting handshake message" \ |
| 8471 | -C "error" |
| 8472 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8473 | # We use --insecure for the GnuTLS client because it expects |
| 8474 | # the hostname / IP it connects to to be the name used in the |
| 8475 | # certificate obtained from the server. Here, however, it |
| 8476 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8477 | # as the server name in the certificate. This will make the |
| 8478 | # certifiate validation fail, but passing --insecure makes |
| 8479 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8480 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8481 | requires_config_enabled MBEDTLS_RSA_C |
| 8482 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8484 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8485 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8486 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8487 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8488 | crt_file=data_files/server7_int-ca.crt \ |
| 8489 | key_file=data_files/server7.key \ |
| 8490 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8491 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8492 | 0 \ |
| 8493 | -s "fragmenting handshake message" |
| 8494 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8495 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8497 | requires_config_enabled MBEDTLS_RSA_C |
| 8498 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8500 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8501 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8502 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8503 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8504 | crt_file=data_files/server7_int-ca.crt \ |
| 8505 | key_file=data_files/server7.key \ |
| 8506 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8507 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8508 | 0 \ |
| 8509 | -s "fragmenting handshake message" |
| 8510 | |
| 8511 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8512 | requires_config_enabled MBEDTLS_RSA_C |
| 8513 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8514 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8515 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8516 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8517 | "$P_CLI dtls=1 debug_level=2 \ |
| 8518 | crt_file=data_files/server8_int-ca2.crt \ |
| 8519 | key_file=data_files/server8.key \ |
| 8520 | mtu=512 force_version=dtls1_2" \ |
| 8521 | 0 \ |
| 8522 | -c "fragmenting handshake message" \ |
| 8523 | -C "error" |
| 8524 | |
| 8525 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8526 | requires_config_enabled MBEDTLS_RSA_C |
| 8527 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8529 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8530 | "$O_SRV -dtls1 -verify 10" \ |
| 8531 | "$P_CLI dtls=1 debug_level=2 \ |
| 8532 | crt_file=data_files/server8_int-ca2.crt \ |
| 8533 | key_file=data_files/server8.key \ |
| 8534 | mtu=512 force_version=dtls1" \ |
| 8535 | 0 \ |
| 8536 | -c "fragmenting handshake message" \ |
| 8537 | -C "error" |
| 8538 | |
| 8539 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8540 | requires_config_enabled MBEDTLS_RSA_C |
| 8541 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8542 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8543 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8544 | "$P_SRV dtls=1 debug_level=2 \ |
| 8545 | crt_file=data_files/server7_int-ca.crt \ |
| 8546 | key_file=data_files/server7.key \ |
| 8547 | mtu=512 force_version=dtls1_2" \ |
| 8548 | "$O_CLI -dtls1_2" \ |
| 8549 | 0 \ |
| 8550 | -s "fragmenting handshake message" |
| 8551 | |
| 8552 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8553 | requires_config_enabled MBEDTLS_RSA_C |
| 8554 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8555 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8556 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8557 | "$P_SRV dtls=1 debug_level=2 \ |
| 8558 | crt_file=data_files/server7_int-ca.crt \ |
| 8559 | key_file=data_files/server7.key \ |
| 8560 | mtu=512 force_version=dtls1" \ |
| 8561 | "$O_CLI -dtls1" \ |
| 8562 | 0 \ |
| 8563 | -s "fragmenting handshake message" |
| 8564 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8565 | # interop tests for DTLS fragmentating with unreliable connection |
| 8566 | # |
| 8567 | # again we just want to test that the we fragment in a way that |
| 8568 | # pleases other implementations, so we don't need the peer to fragment |
| 8569 | requires_gnutls_next |
| 8570 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8571 | requires_config_enabled MBEDTLS_RSA_C |
| 8572 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8574 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8575 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8576 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8577 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8578 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8579 | crt_file=data_files/server8_int-ca2.crt \ |
| 8580 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8581 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8582 | 0 \ |
| 8583 | -c "fragmenting handshake message" \ |
| 8584 | -C "error" |
| 8585 | |
| 8586 | requires_gnutls_next |
| 8587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8588 | requires_config_enabled MBEDTLS_RSA_C |
| 8589 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8590 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8591 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8592 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8593 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8594 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8595 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8596 | crt_file=data_files/server8_int-ca2.crt \ |
| 8597 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8598 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8599 | 0 \ |
| 8600 | -c "fragmenting handshake message" \ |
| 8601 | -C "error" |
| 8602 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8603 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8604 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8605 | requires_config_enabled MBEDTLS_RSA_C |
| 8606 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8608 | client_needs_more_time 4 |
| 8609 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8610 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8611 | "$P_SRV dtls=1 debug_level=2 \ |
| 8612 | crt_file=data_files/server7_int-ca.crt \ |
| 8613 | key_file=data_files/server7.key \ |
| 8614 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8615 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8616 | 0 \ |
| 8617 | -s "fragmenting handshake message" |
| 8618 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8619 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8621 | requires_config_enabled MBEDTLS_RSA_C |
| 8622 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8624 | client_needs_more_time 4 |
| 8625 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8626 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8627 | "$P_SRV dtls=1 debug_level=2 \ |
| 8628 | crt_file=data_files/server7_int-ca.crt \ |
| 8629 | key_file=data_files/server7.key \ |
| 8630 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8631 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8632 | 0 \ |
| 8633 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8634 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8635 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8636 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8637 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8638 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8639 | ## (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] | 8640 | skip_next_test |
| 8641 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8642 | requires_config_enabled MBEDTLS_RSA_C |
| 8643 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8644 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8645 | client_needs_more_time 4 |
| 8646 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 8647 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8648 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8649 | "$P_CLI dtls=1 debug_level=2 \ |
| 8650 | crt_file=data_files/server8_int-ca2.crt \ |
| 8651 | key_file=data_files/server8.key \ |
| 8652 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8653 | 0 \ |
| 8654 | -c "fragmenting handshake message" \ |
| 8655 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8656 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8657 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8658 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8659 | requires_config_enabled MBEDTLS_RSA_C |
| 8660 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8662 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8663 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 8664 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8665 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8666 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8667 | crt_file=data_files/server8_int-ca2.crt \ |
| 8668 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8669 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8670 | 0 \ |
| 8671 | -c "fragmenting handshake message" \ |
| 8672 | -C "error" |
| 8673 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8674 | skip_next_test |
| 8675 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8676 | requires_config_enabled MBEDTLS_RSA_C |
| 8677 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8678 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8679 | client_needs_more_time 4 |
| 8680 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 8681 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8682 | "$P_SRV dtls=1 debug_level=2 \ |
| 8683 | crt_file=data_files/server7_int-ca.crt \ |
| 8684 | key_file=data_files/server7.key \ |
| 8685 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 8686 | "$O_CLI -dtls1_2" \ |
| 8687 | 0 \ |
| 8688 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8689 | |
| 8690 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 8691 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8692 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8694 | requires_config_enabled MBEDTLS_RSA_C |
| 8695 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8697 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8698 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 8699 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8700 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8701 | crt_file=data_files/server7_int-ca.crt \ |
| 8702 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8703 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8704 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8705 | 0 \ |
| 8706 | -s "fragmenting handshake message" |
| 8707 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8708 | # Tests for specific things with "unreliable" UDP connection |
| 8709 | |
| 8710 | not_with_valgrind # spurious resend due to timeout |
| 8711 | run_test "DTLS proxy: reference" \ |
| 8712 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8713 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8714 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8715 | 0 \ |
| 8716 | -C "replayed record" \ |
| 8717 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8718 | -C "Buffer record from epoch" \ |
| 8719 | -S "Buffer record from epoch" \ |
| 8720 | -C "ssl_buffer_message" \ |
| 8721 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8722 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8723 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8724 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8725 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8726 | -c "HTTP/1.0 200 OK" |
| 8727 | |
| 8728 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8729 | run_test "DTLS proxy: duplicate every packet" \ |
| 8730 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8731 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8732 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8733 | 0 \ |
| 8734 | -c "replayed record" \ |
| 8735 | -s "replayed record" \ |
| 8736 | -c "record from another epoch" \ |
| 8737 | -s "record from another epoch" \ |
| 8738 | -S "resend" \ |
| 8739 | -s "Extra-header:" \ |
| 8740 | -c "HTTP/1.0 200 OK" |
| 8741 | |
| 8742 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8743 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8744 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8745 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8746 | 0 \ |
| 8747 | -c "replayed record" \ |
| 8748 | -S "replayed record" \ |
| 8749 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8750 | -s "record from another epoch" \ |
| 8751 | -c "resend" \ |
| 8752 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8753 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8754 | -c "HTTP/1.0 200 OK" |
| 8755 | |
| 8756 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8757 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8758 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8759 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8760 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8761 | -c "next record in same datagram" \ |
| 8762 | -s "next record in same datagram" |
| 8763 | |
| 8764 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8765 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8766 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8767 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8768 | 0 \ |
| 8769 | -c "next record in same datagram" \ |
| 8770 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8771 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8772 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8773 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8774 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8775 | "$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] | 8776 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8777 | -c "discarding invalid record (mac)" \ |
| 8778 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8779 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8780 | -c "HTTP/1.0 200 OK" \ |
| 8781 | -S "too many records with bad MAC" \ |
| 8782 | -S "Verification of the message MAC failed" |
| 8783 | |
| 8784 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8785 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8786 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8787 | "$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] | 8788 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8789 | -C "discarding invalid record (mac)" \ |
| 8790 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8791 | -S "Extra-header:" \ |
| 8792 | -C "HTTP/1.0 200 OK" \ |
| 8793 | -s "too many records with bad MAC" \ |
| 8794 | -s "Verification of the message MAC failed" |
| 8795 | |
| 8796 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8797 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8798 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8799 | "$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] | 8800 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8801 | -c "discarding invalid record (mac)" \ |
| 8802 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8803 | -s "Extra-header:" \ |
| 8804 | -c "HTTP/1.0 200 OK" \ |
| 8805 | -S "too many records with bad MAC" \ |
| 8806 | -S "Verification of the message MAC failed" |
| 8807 | |
| 8808 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8809 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8810 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8811 | "$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] | 8812 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8813 | -c "discarding invalid record (mac)" \ |
| 8814 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8815 | -s "Extra-header:" \ |
| 8816 | -c "HTTP/1.0 200 OK" \ |
| 8817 | -s "too many records with bad MAC" \ |
| 8818 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8819 | |
| 8820 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8821 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8822 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8823 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8824 | 0 \ |
| 8825 | -c "record from another epoch" \ |
| 8826 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8827 | -s "Extra-header:" \ |
| 8828 | -c "HTTP/1.0 200 OK" |
| 8829 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8830 | # Tests for reordering support with DTLS |
| 8831 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8832 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8833 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8834 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8835 | hs_timeout=2500-60000" \ |
| 8836 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8837 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8838 | 0 \ |
| 8839 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8840 | -c "Next handshake message has been buffered - load"\ |
| 8841 | -S "Buffering HS message" \ |
| 8842 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8843 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8844 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8845 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8846 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8847 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8848 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8849 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8850 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8851 | hs_timeout=2500-60000" \ |
| 8852 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8853 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8854 | 0 \ |
| 8855 | -c "Buffering HS message" \ |
| 8856 | -c "found fragmented DTLS handshake message"\ |
| 8857 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8858 | -c "Next handshake message has been buffered - load"\ |
| 8859 | -S "Buffering HS message" \ |
| 8860 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8861 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8862 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8863 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8864 | -S "Remember CCS message" |
| 8865 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8866 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8867 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8868 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8869 | # while keeping the ServerKeyExchange. |
| 8870 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8871 | 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] | 8872 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8873 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8874 | hs_timeout=2500-60000" \ |
| 8875 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8876 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8877 | 0 \ |
| 8878 | -c "Buffering HS message" \ |
| 8879 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8880 | -C "attempt to make space by freeing buffered messages" \ |
| 8881 | -S "Buffering HS message" \ |
| 8882 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8883 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8884 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8885 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8886 | -S "Remember CCS message" |
| 8887 | |
| 8888 | # The size constraints ensure that the delayed certificate message can't |
| 8889 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8890 | # when dropping it first. |
| 8891 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8892 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8893 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8894 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8895 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8896 | hs_timeout=2500-60000" \ |
| 8897 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8898 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8899 | 0 \ |
| 8900 | -c "Buffering HS message" \ |
| 8901 | -c "attempt to make space by freeing buffered future messages" \ |
| 8902 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8903 | -S "Buffering HS message" \ |
| 8904 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8905 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8906 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8907 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8908 | -S "Remember CCS message" |
| 8909 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8910 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8911 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8912 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8913 | hs_timeout=2500-60000" \ |
| 8914 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8915 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8916 | 0 \ |
| 8917 | -C "Buffering HS message" \ |
| 8918 | -C "Next handshake message has been buffered - load"\ |
| 8919 | -s "Buffering HS message" \ |
| 8920 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8921 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8922 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8923 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8924 | -S "Remember CCS message" |
| 8925 | |
| 8926 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8927 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8928 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8929 | hs_timeout=2500-60000" \ |
| 8930 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8931 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8932 | 0 \ |
| 8933 | -C "Buffering HS message" \ |
| 8934 | -C "Next handshake message has been buffered - load"\ |
| 8935 | -S "Buffering HS message" \ |
| 8936 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8937 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8938 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8939 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8940 | -S "Remember CCS message" |
| 8941 | |
| 8942 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8943 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8944 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8945 | hs_timeout=2500-60000" \ |
| 8946 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8947 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8948 | 0 \ |
| 8949 | -C "Buffering HS message" \ |
| 8950 | -C "Next handshake message has been buffered - load"\ |
| 8951 | -S "Buffering HS message" \ |
| 8952 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8953 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8954 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8955 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8956 | -s "Remember CCS message" |
| 8957 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8958 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8959 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8960 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8961 | hs_timeout=2500-60000" \ |
| 8962 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8963 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8964 | 0 \ |
| 8965 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8966 | -s "Found buffered record from current epoch - load" \ |
| 8967 | -c "Buffer record from epoch 1" \ |
| 8968 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8969 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8970 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8971 | # from the server are delayed, so that the encrypted Finished message |
| 8972 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8973 | # in afterwards, the encrypted Finished message must be freed in order |
| 8974 | # to make space for the NewSessionTicket to be reassembled. |
| 8975 | # This works only in very particular circumstances: |
| 8976 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8977 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8978 | # the encrypted Finished message. |
| 8979 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8980 | # needs to be fragmented. |
| 8981 | # - All messages sent by the server must be small enough to be either sent |
| 8982 | # without fragmentation or be reassembled within the bounds of |
| 8983 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8984 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8985 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8986 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8987 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8988 | -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] | 8989 | "$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] | 8990 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8991 | 0 \ |
| 8992 | -s "Buffer record from epoch 1" \ |
| 8993 | -s "Found buffered record from current epoch - load" \ |
| 8994 | -c "Buffer record from epoch 1" \ |
| 8995 | -C "Found buffered record from current epoch - load" \ |
| 8996 | -c "Enough space available after freeing future epoch record" |
| 8997 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8998 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8999 | |
| 9000 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9001 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9002 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9003 | "$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] | 9004 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9005 | "$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] | 9006 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9007 | 0 \ |
| 9008 | -s "Extra-header:" \ |
| 9009 | -c "HTTP/1.0 200 OK" |
| 9010 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9011 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9012 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9013 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9014 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9015 | "$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] | 9016 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9017 | 0 \ |
| 9018 | -s "Extra-header:" \ |
| 9019 | -c "HTTP/1.0 200 OK" |
| 9020 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9021 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9022 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9023 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9024 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9025 | "$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] | 9026 | 0 \ |
| 9027 | -s "Extra-header:" \ |
| 9028 | -c "HTTP/1.0 200 OK" |
| 9029 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9030 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9031 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9032 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9033 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9034 | "$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] | 9035 | 0 \ |
| 9036 | -s "Extra-header:" \ |
| 9037 | -c "HTTP/1.0 200 OK" |
| 9038 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9039 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9040 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9041 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9042 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9043 | "$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] | 9044 | 0 \ |
| 9045 | -s "Extra-header:" \ |
| 9046 | -c "HTTP/1.0 200 OK" |
| 9047 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9048 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9049 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9050 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9051 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9052 | "$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] | 9053 | 0 \ |
| 9054 | -s "Extra-header:" \ |
| 9055 | -c "HTTP/1.0 200 OK" |
| 9056 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9057 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9058 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9059 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9060 | "$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] | 9061 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9062 | "$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] | 9063 | 0 \ |
| 9064 | -s "Extra-header:" \ |
| 9065 | -c "HTTP/1.0 200 OK" |
| 9066 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9067 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9068 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9069 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9070 | "$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] | 9071 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9072 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9073 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9074 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9075 | 0 \ |
| 9076 | -s "a session has been resumed" \ |
| 9077 | -c "a session has been resumed" \ |
| 9078 | -s "Extra-header:" \ |
| 9079 | -c "HTTP/1.0 200 OK" |
| 9080 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9081 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9082 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9083 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9084 | "$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] | 9085 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9086 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9087 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9088 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9089 | 0 \ |
| 9090 | -s "a session has been resumed" \ |
| 9091 | -c "a session has been resumed" \ |
| 9092 | -s "Extra-header:" \ |
| 9093 | -c "HTTP/1.0 200 OK" |
| 9094 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9095 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9097 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9098 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9099 | "$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] | 9100 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9101 | "$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] | 9102 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9103 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9104 | 0 \ |
| 9105 | -c "=> renegotiate" \ |
| 9106 | -s "=> renegotiate" \ |
| 9107 | -s "Extra-header:" \ |
| 9108 | -c "HTTP/1.0 200 OK" |
| 9109 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9110 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9111 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9112 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 9113 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9114 | "$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] | 9115 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9116 | "$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] | 9117 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9118 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9119 | 0 \ |
| 9120 | -c "=> renegotiate" \ |
| 9121 | -s "=> renegotiate" \ |
| 9122 | -s "Extra-header:" \ |
| 9123 | -c "HTTP/1.0 200 OK" |
| 9124 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9125 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9126 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9127 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9128 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9129 | "$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] | 9130 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9131 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9132 | "$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] | 9133 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9134 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9135 | 0 \ |
| 9136 | -c "=> renegotiate" \ |
| 9137 | -s "=> renegotiate" \ |
| 9138 | -s "Extra-header:" \ |
| 9139 | -c "HTTP/1.0 200 OK" |
| 9140 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9141 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9142 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9143 | 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] | 9144 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9145 | "$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] | 9146 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9147 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9148 | "$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] | 9149 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9150 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9151 | 0 \ |
| 9152 | -c "=> renegotiate" \ |
| 9153 | -s "=> renegotiate" \ |
| 9154 | -s "Extra-header:" \ |
| 9155 | -c "HTTP/1.0 200 OK" |
| 9156 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9157 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 9158 | ## all versions installed on the CI machines), reported here: |
| 9159 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 9160 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9161 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 9162 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9163 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9164 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9165 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9166 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9167 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9168 | "$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] | 9169 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9170 | -c "HTTP/1.0 200 OK" |
| 9171 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9172 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9173 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9174 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9175 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 9176 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9177 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9178 | "$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] | 9179 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9180 | -c "HTTP/1.0 200 OK" |
| 9181 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9182 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9183 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9184 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9185 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 9186 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 9187 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9188 | "$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] | 9189 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9190 | -c "HTTP/1.0 200 OK" |
| 9191 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9192 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9193 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9194 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9195 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 9196 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 9197 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9198 | "$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] | 9199 | 0 \ |
| 9200 | -s "Extra-header:" \ |
| 9201 | -c "Extra-header:" |
| 9202 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9203 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9204 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9205 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9206 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 9207 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9208 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9209 | "$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] | 9210 | 0 \ |
| 9211 | -s "Extra-header:" \ |
| 9212 | -c "Extra-header:" |
| 9213 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9214 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9215 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9216 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9217 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 9218 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9219 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9220 | "$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] | 9221 | 0 \ |
| 9222 | -s "Extra-header:" \ |
| 9223 | -c "Extra-header:" |
| 9224 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9225 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 9226 | run_test "export keys functionality" \ |
| 9227 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 9228 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 9229 | 0 \ |
| 9230 | -s "exported maclen is " \ |
| 9231 | -s "exported keylen is " \ |
| 9232 | -s "exported ivlen is " \ |
| 9233 | -c "exported maclen is " \ |
| 9234 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9235 | -c "exported ivlen is " \ |
| 9236 | -c "EAP-TLS key material is:"\ |
| 9237 | -s "EAP-TLS key material is:"\ |
| 9238 | -c "EAP-TLS IV is:" \ |
| 9239 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9240 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9241 | # Test heap memory usage after handshake |
| 9242 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 9243 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 9244 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 9245 | run_tests_memory_after_hanshake |
| 9246 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9247 | # Final report |
| 9248 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9249 | echo "------------------------------------------------------------------------" |
| 9250 | |
| 9251 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9252 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9253 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9254 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9255 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9256 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9257 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9258 | |
| 9259 | exit $FAILS |